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.
  • The same structure was given in help.sap.com for file adapter content conversion receiver side. Please see that help, sure you will get an idea. The Strcutres are different, Help.sap.

Converting XML in the Receiver File/FTP Adapter to Text Format Use. You can convert a table in XML format to pure text format. Prerequisites In the receiver file/FTP adapter, you have selected File Content Conversion as the Message Protocol. Design your Repository objects, then in your Configuration for specific receiver file adapter we will be going to use suitable Modules in the module tab of communication channel. Though it has the same functionality like File Content Conversion in the message protocol option, this document just shows you an alternative approach to that. SAP PI; SAP ABAP. XI/PI: File Content Conversion for Simple Structure. By Riyaz / 10 years ago. File Receiver Adapter with Content Conversion. Dear SAP Community Member, In order to fully benefit from what. Basic File Adapter Content Conversion. This is a very simple way of importing flat files into PI.

XI - File Content Conversion

Developments on Integration Directory.

1.Configuration of Sender File Adapter

Here specify Message Protocol as ‘File Content Conversion’.

Document Name and Namespace correspond to the message type from the Integration Repository.

Recordset Name defines the root node under which rest of the XML will be created.

File content conversion in sap pi at receiver 2

Recordset Structure defines the name and occurrence of each sub-node in Recordset Structure. In this example we have only one occurrence of sub-node Emp_Header and Emp_Summary and unbounded occurrences of sub-node Emp_Weekly_Det.

Key Field Name and Key Field Type helps in differentiating different substructures. In this case Key =1 implies Emp_Header node, Key = 2 implies Emp_Weekly_Det node and Key = 3 implies Emp_Summary node.

Additional Parameters are given below.

  • <node>.fieldFixedLengths – comma-separated ordered list of field lengths in the particular node
  • <node>.endSeparator – identifies end of record
  • <node>.fieldNames – comma-separated ordered list of field names in the particular node
  • <node>.keyFieldValue – Value of the key field
  • <node>.keyFieldInStructure – ‘ignore’ (without quotes) indicates that the Key field should not be generated in the resulting XML whereas ‘add’ (without quotes) indicates that it should be added.

2.Configure Receiving File Adapter

3.Configure Receiver Agreement

4. Configure Sender Agreement.

5.Configure Interface Determination.

6.Configure Receiver Determination.

File Content Conversion In Sap Pi At Receiver For Sale

On Executing the Scenario we will get the output file in XML Format.

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:

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

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

Points to note:

  • 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

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

File Content Conversion In Sap Pi At Receiver Position

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