File Content Conversion In Sap Pi At Receiver

Hi Karthik, In Receiver file adapter. message protocol select the option file content conversion from teh drop down menu. After that at the end you can see the Content Conversion Parameters in that give your root name in the place of Recordset Structure. SAP NetWeaver Exchange Infrastructure. Configuring the Receiver File/FTP Adapter. If the last field only is shorter than defined or is missing completely, the conversion is executed. The contents of the last field are then applied to the XML element as found. Consequently, the value can be incomplete or empty.

Recently went through a question on content conversion for receiver file adapter, where the xml contains multiple header and detail lines. The question is posted here –

Worked on this problem via XSLT which saves the pain for content conversion. Using XSLT, we can convert any xml into csv / other text formats without worrying for XML hierarchy

Structure for this example is as mentioned below –

Output from the interface should be as mentioned below

Source XML data:

File content conversion in sap pi at receiver position

one option is obviously trying via content conversion or message transformation bean which might need some tricks but knowing XSLT gives an edge here.

File content conversion in sap pi at receiver free

This requirement can be achieved via a simple XSLT mapping. The idea behind that is that just print the segments we need in the output and pass to the receiver file adapter as it is. In other words, no need to use the content conversion

File Content Conversion In Sap Pi At ReceiverWhat is sap pi 7.0

Here is the XSLT, which would provide us the desired output.

Sap Pi 7.1

Points to note:

File content conversion in sap pi at receiver free

File Content Conversion In Sap Pi At Receiver Configuration

  • I have used semicolon (;) as the field separator here. Any other separator can be used.
  • If field length is to be shortened, XPath function substring can be used to shorten the fields.
  • Similarly spaces can be added using the XPath functions by adding spaces to the fields (Field fixed length type)
  • XSLT can also be adjusted in the receiver file adapter but unit testing is as straight forward in that case as in case of XSLT mapping.

Conclusion

File Content Conversion In Sap Pi At Receiver 2

Receiver File content conversion has got an escape route and that is XSLT.

File Content Conversion In Sap Pi At Receiver Free

Simple or complex, it is a matter of few lines of code in XSLT, rather than a brainstorming in FCC :).

Comments are closed.