cancel
Showing results for 
Search instead for 
Did you mean: 

Message Mapping Sort IDOC Segment Values

Former Member
0 Kudos

HI,

I have an IDOC with multiple E1EDK12 segments.

Each segment has a field MATNR. I have to create only one target node with E1EDK12 which has highest value for MATNR.

Please help how could i achieve this in PI

(source)E1EDK12 (1 to many) ----> Details (Target) occurrence:  1  (E1EDK12 with highest MATNR)

Lets say i have 4 E1EDK12 segments. each segment has one MATNR

1. E1EDK12->MATNR = 2376

2. E1EDK12->MATNR = 2271

3. E1EDK12->MATNR = 3376  (highest)

4. E1EDK12->MATNR = 1176

I have to create only one target node with all values in E1EDK12 which has MATNR = 3376

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member440061
Participant
0 Kudos

Hi,

You can also try using the "Max" function available in the list of Arithmatic standard functions. this returns the maximum of the two input values.

refer http://wiki.scn.sap.com/wiki/display/XI/Standard+Functions+in+PI+7.0

Regards

Former Member
0 Kudos

Hello,

Try this:

Matnr** -> sort (in descending order) -> copyValue(0) -> E1EDK12

Matnr** -> sort (in descending order) -> copyValue(0) -> Matnr

For rest of the fields:

Matnr** ->

              --------> SortByKey (descending) --copyValue(0) ---FiledA (Target)

FieldA**->

** -> Change field's context and set it to Idoc level

Thanks

Amit Srivastava