Skip to Content
0

SAP PI How to rearrange the nodes in output

Feb 10, 2017 at 07:55 AM

48

avatar image

Hi PI Gurus,

I have a somewhat weird requirement that I was surprised that PI cannot handle in the mapping. I have to move a segment to the last part of the message. It has to depend on a value from a field. Please see sample output below:

Original structure/schema:

<Header>

<Field>20170201</Field>

</Header>

<Header>

<Field>20170203</Field>

</Header>

<Line>

<Field>20170202</Field>

</Line>

Desired output:

<Header>

<Field>20170201</Field>

</Header>

<Line>

<Field>20170202</Field>

</Line>

<Header>

<Field>20170203</Field>

</Header>

In the sample above, we based the order on the date of the message. It had to be chronological. But with PI mapping, it will process similar segment names first, then the other segments will follow. I need to move the 2nd Header after the Line segment.

Is this possible in PI mapping?

Or a simpler logic would be to move the last instance of Header after the Line segment. Do I need xslt for this?

10 |10000 characters needed characters left characters exceeded

Or a simpler logic is just to move the last instance of Header after Line. There's no need to worry about the date value.

0
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Gagandeep Batra Feb 10, 2017 at 10:12 AM
0

Can you share the structure of source and target you want.

Regards

GB

Share
10 |10000 characters needed characters left characters exceeded