cancel
Showing results for 
Search instead for 
Did you mean: 

SAP PI - Graphical Mapping - node function 'SortByKey' not working in IDoc

thomas_rabe
Explorer
0 Kudos
1,049

Hello experts,

using the graphical mapping in PI - ESR I am trying to sort an IDoc (SAP to SAP, IDOC Type HRMDA_09) using the node function 'SortByKey'. I need the IDOC to be sorted by OTYPE at node E1PLOGI. Default sorting from sending system is ascending, but we need ascending in the receiving system to overcome issues while creating realtoosn infotype 1001 (message there is 'Object xyz is missing' because of wrong order during import. Object is crated later through same IDoc) .

Sorting is necessary on E1PLOGI Level -> example of a message partially collapsed. Message in screenshot is sorted by E1PLOGI 1F (multiple objects), 1G(multiple objects), O (multiple objects), CP, P

I have seen this blog entry as a possible solution and created a node function in level E1PLOGI:

Overview:

Detail with Qeuedata

This has no effect; not in testing or in real life. This is the test result:

I have tried this kind of sorting in a different software (Altova MapForce) using the same xml-Data and same node-sort-logic. There it works.

Does anybody have an idea what is wrong in my ESR SortByKey mappping rule?

Kind regards

Thomas

Accepted Solutions (1)

Accepted Solutions (1)

Hi Thomas,

You'll have to apply the SortByKey to every field in the E1PLOGI segment.

Another way to do is using an XSLT mapping. Using XSLT mapping, you can sort the segments based on OTYPE key.

thomas_rabe
Explorer
0 Kudos

Hi Sneba,

thank you for your answer. I will try that (mapping field by field) and post my results here (it will take a few days, because of workload).

Kind regards,

Thomas

Answers (0)