I have written this blog to address the FAQ in SDN as discussed Conversion of source XML structure to single string using PI 7.1 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 The specified item was not found. . But now we can achieve this using SAP PI 7.1 Mapping Enhancements Series: Copy XML Subtree, 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.
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 )
Source xml payload:
Target xml payload:
http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/2620.But [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]