File Content Conversion In Sap Pi At Receiver

How to expose a CSV file as a Service with SAP PI/PRO. Published 2016-11-01. Imagine you need to read a file content from a remote application and you do not want to set up a replication? Create Service Interfaces (Sender and Receiver side) For the receiver side you can also use the synchronous Inbound Service Interface. XI - File Content Conversion. By Punit J, YASH PI Competency Team, Yash Technologies. Description: File Content Conversion is used to convert non-XML file (flat file) to XML file and vice-versa. In this blog, we will see how to convert flat file to XML file when file structure is bit complex. From PI 7.30 onwards File/FTP adapter natively supports transferring large size files by splitting them in to smaller chunks based on the configured size. Each chunk will be processed as an individual XI Message in sender adapter and all the chunks are combined based on the sequence in receiver adapter.

Scenario:

This scenario describes the steps involved in configuration of the receiver file adapter with file content conversion.


Fig1. File Content Conversion Scenario

Input Message:

This is the input message to the receiver file adapter sent from XI.
Fig2. Input XML message

Output Message:


Fig3. Output CSV Message

Steps:

XI sends a XML message as input to the receiver adapter.Now this XML needs to be converted to a File in CSV format, i.e. it may be a comma separated, tab separated etc. To generate the required output, the data type at the receiver’s side plays a crucial rule. The data type should abide to the rules of well formed XML.

Module

Sap Pi Jobs

Receiver

Sap Pi Training

The Receiver File Adapter is configured, using the following settings:

  • Choose File Content Conversion as the Message Protocol.
  • You may or may not give the ‘addHeaderLine’ parameter.
  • For the ‘fieldSeparator’ parameter you need to give field separator for both list and substructure (referring to the data type above). For eg: it may be a ‘,’ (comma) for substructure in a comma separated file.
  • The ‘endSeparator’ parameter needs to given for substructure only. For eg: it may be a ‘nl’ (new line)

  • Fig4. Conversion Parameters in Adapter

  • · Give the file name, the directory and the Construction mode. Activate all the settings. Receiver File Adapter with F.C.C. is configured.

Sap Pi Module

Result:

File Content Conversion In Sap Pi At Receiver Free

The file with desired output generated.
Recommended Reading:
http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm