cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping problem for IDOC to file scenario

Former Member
0 Kudos

Hello friends,

I am working on an IDOC to file scenario and when I am trying to map the IDOC it's taking the value only for the first node and when it fails the condition it's giving error.

The structure of the idoc is as below :

<E1EDK14 SEGMENT="">

         <QUALF>Z03</QUALF>

         <ORGID>ER-12345-ER</ORGID>

      </E1EDK14>

      <E1EDK14 SEGMENT="">

         <QUALF>Z06</QUALF>

         <ORGID>AB-1223-ER</ORGID>

      </E1EDK14>

and my mapping is done in this way :

                        ORGID-------->

                                            then

QUALF---->equalsS  ------> if              ---->substring (3..8)----->OrderNumber

                                            else

Constant----->

(Z06)

                          Constant---->

                           (00000000)

and when I test I am getting the value in OrderNumber as "0000"

But when I change the value of QUALF to "Z06" for the first node, it gives the correct result as "12345".

Could you please verify my mapping and suggest something,such that it takes the value of ORGID wherever it finds QUALF = Z06 ,but not only for first node?

Thanks in advance !

Regards,

Sambaran

Accepted Solutions (1)

Accepted Solutions (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

if you dont wanna pasy any else value if condition not satified then try below mapping logic.

If you wanna send default value if condition not satified then try below mapping logic.

Former Member
0 Kudos

Hi Raja, Thanks for ur input.For order number occurance is 1 and the problem is that it's taking the value only for the first not and not going to the second node.. any solution? Regards, Sambaran

rajasekhar_reddy14
Active Contributor
0 Kudos

have you tried my mapping logic, it works for all cases.

anupam_ghosh2
Active Contributor
0 Kudos

Hi Sambaran,

                             What is the minimum and maximum occurrence of order number in target side?

Regards

Anupam

Former Member
0 Kudos

Thanks a lot Raja ! problem is solved :)))

Answers (2)

Answers (2)

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi Sambarn,

What is the occurance of Order Number at target side,as per mapping logic what you have written for the data what you have tested you will have two values for order number 0000,1223-ER.

First occurance order number value will have 0000,second occurance order number will have 1223-ER.

if you have set ordernumber occurance to 1 then you will see output value 0000.

what is your requirement?

Regards,

Raj

Former Member
0 Kudos

Hi Sambaran,

According to your requirement, if any <QUALF> is Z06 you need to pass the corresponding <OrgID>.

Use a UDF for the the above. Remove context for both <QUALF> and <ORGID> and give it as input to the UDF.

<ORGID> -->

                    UDF_ORGID_FROM_Z06--->substring(3..8) ---> OrderNumber

<QUALF>--->

Small piece of code that you will require:

int sum=0000;

          for (int i=0;i<a.length;i++)

          {

                    if(QUALF[i].equals("Z06")

                         sum = ORGID[i];

                            

            }

return sum;