Skip to Content
0
Former Member
Sep 18, 2008 at 11:05 PM

Problems with summing segments

117 Views

Hi experts,

I have an idoc as source, and I would like to sum the value of a specific segment under a condition:

my idoc is as following:

IDOC

>E1EDP01 0..unbounded

>>E1EDP04 0..unbounded

>>>MSWK

>>>MSWB

for each segment of E1EDP04, if the value of MSWK is the same, then I have to map the sum of all MSWB for the same value of MSWK.

Do you know how to do that? do I have to do an UDF? if yes, how should I start since i'm new at xi and java?

for example, i can have:

IDOC

>E1EDP01

>>E1EDP04

>>>MSWK = code1

>>>MSWB = 5

>E1EDP01

>>E1EDP04

>>>MSWK = code1

>>>MSWB = 7.5

>E1EDP01

>>E1EDP04

>>>MSWK = code1

>>>MSWB = 5

>E1EDP01

>>E1EDP04

>>>MSWK = code2

>>>MSWB = 4

>E1EDP01

>>E1EDP04

>>>MSWK = code2

>>>MSWB = 4.5

then I have to map the sum of MSWB to 2 segments:

>tax

>>type = code1

>> value = 17.5

>tax

>>type = code2

>> value = 8.5

Thanks a lot,

best regards,

jamal