on 10-01-2009 1:30 AM
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
keep the context of Quantity to E1EDl24 and do mapping as
Quantity------->collapseContext----------->SUM------>Total
Thanks and Regards
Kubra Fatima.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you tried setting the context to E1EDl24 using the logic with standard function as I have given in my previous reply?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.