Convert the Input xml to String in PI 7.1 using Standard Graphical Mapping


SAP PI Interview Questions and SAP PI Tutorials

SAP PI Interview Questions and SAP PI Tutorials

Convert the Input xml to String in PI 7.1 using Standard Graphical Mapping

I have written this blog to address the FAQ in SDN as discussed here and in many other threads.

Where there is a need to map complete input xml payload to a field of the target xml. Can this be done using the standard Graphical Mapping? The answer is YES in PI 7.1.

Earlier we used to do this using Java Mapping or Using XSLT Mapping . But now we can achieve this using CopyXML, a new feature of PI 7.1.So we don’t need to create a Java Mapping with a lengthy code and thereby reduces the time spent in designing the mapping.

I am taking the same example which is explained in this Java Mapping wiki to make it simple to understand.

Source Structure:

srcdata

Target Structure

tardata

Assign The Mapping:

Right-click on “Source Message Type” and select “Return as XML” in the dropdown menu. This will return XML.

To convert that to a string, here simply I am using trim function present in the Text function Category (you can use any text function , so that it treats input xml as string )

map

Source xml payload:

srcpayload

Target xml payload:

SAP PI Interview Questions and SAP PI Tutorials

SAP PI Interview Questions and SAP PI Tutorials

tarpayload

SAP PI Interview Questions and SAP PI Tutorials

SAP PI Interview Questions and SAP PI Tutorials

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter
PDF24    Send article as PDF   
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *