In this blog post I’m going to brief about, How can we achieve CSV format data in the Synchronous Response structure using REST adapter in SAP PO 7.5. Before we start, It is good to have prior knowledge on what is Message Transform Bean in SAP PI/PO which would help to understand the objective of this blog post.
The requirement that we had is, 3rd party cloud system will be making a real time call to SAP ECC by consuming the RESTful web service and in return it expects/accepts the Response data back from ECC in CSV format.
The synchronous response is been received in SAP PO from ECC through the RFC adapter in Xml format.
The synchronous REST adapter in SAP PI/PO has limitation of sending/receiving data in standard Xml/JSON.
So in order to meet the requirement of sending CSV format data, we had to leverage the Message Transform Bean functionality by applying the required module parameters/values in the REST Channel’s Module Processor. Below are the steps we applied,
Step 1: REST Sender Channel Configuration :
Here the data format is set to JSON and Character Set Name as “UTF- 8” typically to generate CSV data in JSON format.
Step 2: Module Parameter Configuration in REST Sender Channel :
Here we apply the Message Transform Bean parameters as given below,
Step 3 :
Below is how the sample Synchronous Response in CSV format looks like after MTB,
,40S2001,,0.0,F0002,CT,20200722,4124,998.75,1000.00,,0.00,,,, ,40S2002,,0.0,F0002,CT,20200722,4124,998.75,1000.00,,0.00,,,, ,40S2003,,0.0,F0002,CT,20200722,4124,998.75,1000.00,,0.00,,,, ,40S2004,,0.0,F0002,CT,20200722,4124,998.75,1000.00,,0.00,,,,
Hope this helps, Happy Learning!
SAP CPI/PO/PI Consultant