cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Logic in XI for Idoc to File

Former Member
0 Kudos

Hi All,

I have the scenario like this Idoc to File

I have Quantity field inside E1EDL24(Line Item)--E1EDL43Quantity, i have to Sum up the Quantity field.

I have used the ligic like this and works perfectly.

Quantity--Sum-Total and the context od Quantity is set to IDOC level.

Now the problem is, Inside the Line item(E1EDL24) Segment, we have E1EDL43 Segment and this E1EDL43 can repeats twice

then, i have to consider only first Segment quantity value coming from E1EDL43 . I should not take the second E1EDL43 segment .

But here in my case what is happening is while doing the SUM function it is considering the second segment quantity also. and giving the total.

For Example...

***************************************

-E1EDl24

--E1EDL43

---Quantity -


20

--E1EDL43

---Quantity -


30

And second line item

-E1EDl24

--E1EDL43

---Quantity -


10

--E1EDL43

---Quantity -


50

In this case i shld get 20 + 10 = 30

But iam getting 203010+50 = 110 which is not correct.

Please help me on this

Regards

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

keep the context of Quantity to E1EDl24 and do mapping as


Quantity------->collapseContext----------->SUM------>Total

Thanks and Regards

Kubra Fatima.

Former Member
0 Kudos

Fatima,

If i apply this logic means it is always giving me the first Line items first quantity only . what abt the remaining line items quantity

Regards

Former Member
0 Kudos

Heyy Fatima,

This solved my Issue. thanks a lot

Regards

Answers (3)

Answers (3)

Former Member
0 Kudos

Have you tried setting the context to E1EDl24 using the logic with standard function as I have given in my previous reply?

Former Member
0 Kudos

set the context to Idoc level

use the UDF


int sum=0;
for(int i=0;i<a.length;i++)
{
sum =sum + Integer.parseInt(a<i>);
i++;
}
String res = sum;
return res;

Do the mapping as



Quantity----->UDF---->Total

this logic works if E1EDL43 should repeats twice

former_member200962
Active Contributor
0 Kudos
Quantity----Sum---Total and the context od Quantity is set to IDOC level.

Do not raise the Context....because of this all the available values are considered....try keeping the Context to the original level...then only the first segment value will be considered...hope that it does not consider only for the first E1EDL43 and all other occurences are ignored

Regards,

Abhishek.

Former Member
0 Kudos

Hi Abhishek,

If i dont set the context to idoc and keep it to original means it is not considering the second Line item and third line item.....etc

it is giving me the very first line item only, how to calculate the remaining line items quantity also and do sum

Regards