Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
balaji_j
Participant
6,331
Introduction:

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.

Solution:

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,


Conclusion:

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!

 

Best Regards,

Balamurugan

Integration Consultant.
8 Comments
former_member601407
Participant
Hi bala,

That was a nice blog. In my case, we have a requirement where we have to transmit CSV file from AL11 to microsoft azure storage. Can you guide me on that, how to achieve this using REST receiver adapter.

I think we have to send the file as an attachment which SAP provided as a new feature in 7.5. let me know your thoughts.
balaji_j
Participant
0 Kudos

Hi Subin,

Thank you!

  1. I believe you are using FTP (NFS) as Sender adapter which is gonna pick file from AL11 and sends it to azure.
  2. In your case I presume its asynchronous( correct me if itsn’t), so using REST adapter you can stillpost the file to azure but it should be received to REST in .xml format and not in .csv
  3. So you can still use the MTB’s given in the blog to achieve .csv and process to azure.

Hope this helps!

BR,

Bala

LinkedIn

rasjoshi
Active Contributor
0 Kudos
Hi balaji_j ,

 

Thanks for the blog, is it possible to receive data in CSV format by sender REST adapter transform it to XML and then post it to target system for e.g. ECC.

 

Regards,

Rashmi
balaji_j
Participant
0 Kudos
Hi rashmij ,

The answer is NO & the reason is CSV isn't data format its a file format. REST adapter can pick either JSON or XML data as an input. Also, we use module beans mostly for the conversion required for the target system & not for the source.

Best Regards,

Balamurugan

SAP CPI & PO/PI Consultant
0 Kudos
 

Hi balaji_j ,

 

Thanks for the detailed blog!!

We have the below requirement:

Synchronous flow: Json request-->Rest sender adapter--> SAP PO--> ECC proxy.

We need to send the proxy response from ECC to the sender system as an attachment through Rest sender adapter(Json Payload).

 

Kindly guide us in sending the response as attachment to the source system.

 

Regards,

Sindhuja.
0 Kudos
You have two options on the ABAP proxy response. Either send data as base64 and udf mapping to create attachment and swap payload. Or send as binary attachment as part of soap message and swap payload. Best to handle only one attachment per call for easier management of the file name.
minal_vaidya2
Explorer
0 Kudos
Hi Balamurugan

Thanks for the blog.

Can you share how the module sequence was configured for Synchronous REST sender channel? Since this requirement was for response message, was this module 'MessageTransformationBean' added after 'CallSapAdapter' in the module chain?

We have similar requirement to use PGP in synchronous scenario.

 

Thanks

Minal
balaji_j
Participant
0 Kudos
Hi minal.bakore1 ,

Yes, the 'CallSapAdapter' module will come first followed by MTB.

Best Regards,

Balamurugan

Integration Consultant.
Labels in this area