Skip to Content

SAP PI How to rearrange the nodes in output

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?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Feb 10, 2017 at 10:12 AM

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

    Regards

    GB

    Add comment
    10|10000 characters needed characters exceeded