cancel
Showing results for 
Search instead for 
Did you mean: 

REST Adapter Form data with multiple Attachments Handling in SAP PO.

0 Kudos
842

Hello All,

In our project, there is a requirement from the business where we have to send two payloads using form-data via REST adapter(sender) to SAP PO(final receiver is SAP S4).

In form-data we are getting two payloads in a single message(below screenshot provided)

  1. Attachment (example: any pdf file)
  2. JSON message

We are expected to perform the below steps by sending the payloads separately via REST sender API from the postman to SAP PO, below are the details:

* For JSON payload:

  • We need to convert JSON to XML and pass it to SAP S4 via proxy.
  • We tried this by sending a JSON-only payload and this is working fine with a small mapping.

* For PDF payload:

  • For this, we created a pass-thru scenario to just check if we can pass the PDF payload only, as is to AL11 without renaming, and it is also working fine.
  • But we need to rename the PDF based on the data sent in the JSON body and place that PDF in AL11 folder in SAP S4, so we can’t separate JSON and PDF payloads.

The real problem is when we send both the payloads at the same time, with a JSON to XML mapping in ESR, the first payload(JSON), gets converted successfully, but the second payload(PDF), for which SAP PO generates a separate message-id, also tries to get executed through the same JSON to XML mapping and it fails.

Please find the below screenshots for reference:

The first payload is JSON and the second is PDF.

The above screenshot shows JSON to XML mapping executed successfully.

The above grab shows the SAP PO server generates a new message-id for PDF payload and fails during mapping steps as maybe its structure is not as expected in JSON to XML mapping.

Kindly suggest,

  • How to achieve the above requirement by executing JSON to XML mapping for the first payload, but skipping this mapping for the second payload.
  • Also, how to pull data form JSON payload and rename the PDF(using dynamic configuration) before placing it in the AL11 folder(considering there would be a single operation mapping for both the payloads).

Thanks & regards,

Rajesh Shinde

Accepted Solutions (0)

Answers (1)

Answers (1)

urvi_katira
Discoverer
0 Kudos

Hi, Did you find solution to this? As I have similar requirement as well.