cancel
Showing results for 
Search instead for 
Did you mean: 

Grouping and sum values in XI

Former Member
0 Kudos

Hello,

I 'm working with invoice and I have this source structure as XI input:

Invoice

-- |....

-- |....

-- |Item1

-


|taxcode=01

-


|Amount=12

--|Item2

-


|taxcode=08

-


|Amount=10

--|Item3

-


|taxcode=01

-


|Amount=24

Now my scope is to map these fields to the IDOC segment E1EDP04 grouping by taxcode (MWSKZ taxcode)and putting the sum of the group amount (MWSBT amount).

IDOC:

--|...

--|...

--|E1EDP01

-


|...

-


|...

-


|EIEDP04

-


|MWSKZ=01

-


|MWSBT=36

-


|...

--|E1EDP01

-


|...

-


|...

-


|EIEDP04

-


|MWSKZ=08

-


|MWSBT=10

-


|...

How can I group by a field in XI?

Thank you

Corrado

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Corrado,

If You want to do it in graphical mapping then I will do it this way:

1. sort by taxcode

(taxcode) --> split by value (valuechanged) --> formatByExample (Amount, and splitted value) --> sum(amount) --> MWSBT

I can send u a screenshot of something similar if u need.

best regards

Dawid

moorthy
Active Contributor
0 Kudos

Hi,

Write User Defined functions for the Group By functionality. It will be little complex, because you need to handle context also.

But I feel it is better to go with Java Mapping so that you can easily group it and sum it.

Hope this helps..

Regards,

Moorthy