File Content Conversion In Sap Pi At Receiver

Jan 27, 2020 If the target message (file) created by Message Mapping needs to be converted by the Receiver Adapter Communication Channel select the option ‘File Content Conversion‘. Usually, if the receiver file format is anything other than XML, you can use this feature to convert the file to an appropriate format such as CSV, Text, etc. SAP PI/PO provides out-of-the-box functionality to handle file content conversion from Flat file to XML and vice versa in File Adapter. This function can only be used if the file isn’t encrypted. For handling File content conversion along with PGP, we need adapter modules and advanced user detail function.

Imagine you need to read a file content from a remote application and you do not want to set up a replication?
This scenario explains how to expose a CSV file (here a product list) as a WebService using the standard SOAP Adapter and the WHINT FileReader Adapter.

ConversionFile content conversion in sap pi receiver

What Is Sap Pi 7.0

CSV File:

Design (ESR):

  • Create Service Interfaces (Sender and Receiver side)
  • For the receiver side you can also use the synchronous Inbound Service Interface FileReaderQueryResponse_In which is shipped with the Adapter
  • Optional: Create a Mapping if you do not want to expose the result of the CSV-to-XML conversion of the MessageTransformBean

Configuration (Eclipse/NWDS):

iFlow:

Receiver Channel (FileReader):

SFTP Connectivity (of course you can read the file from NFS or FTP as well):

Module Configuration (MessageTransformBean: CSV->XML):

File Content Conversion In Sap Pi At ReceiverFile Content Conversion In Sap Pi At Receiver

File Content Conversion In Sap Pi At Receiver Configuration

Upload File to SFTP Server:

Sap Pi 7.1

Test from SOAP UI:

File Content Conversion In Sap Pi At Receiver System

Update: I think it is obvious that the Files can be also queried with other sender channels, not only from SOAP (like e.g. REST providing the response in JSON format):