Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

$Batch read using Function Imports - Odata

Dear Experts,

I can able to perform multi read using $Batch.

For Ex :  SurveyEmpSet - Entity Set Name

GET SurveyEmpSet(EmpId='12345',EmpName='Test Emp1') HTTP/1.1


GET SurveyEmpSet(EmpId='45678',EmpName='Test Emp2') HTTP/1.1

But now I need the same for the function import to get output. What's the change I need to do in the above.

For Ex:  ContList is the Function Import Name.

/sap/opu/odata/sap/ZTEST_SRV/ContList?Lang='E'

/sap/opu/odata/sap/ZTEST_SRV/ContList?Lang='A'

Regards,

Srinivasan K

Former Member
Former Member replied

Hello Srini,

It should trigger.

You will get 2 separate calls.

Check the format of the payload.

Below is just a sample for your reference ->

Model ->

Implement Execute Action Method in DPC_EXT class.

URL ->

/sap/opu/odata/sap/<Service_Name>/$batch

Header ->

Method : POST

Content-Type : multipart/mixed; boundary=batch

Payload ->

--batch

Content-Type: application/http

Content-Transfer-Encoding: binary

GET Test?A='XYZ' HTTP/1.1

--batch

Content-Type: application/http

Content-Transfer-Encoding: binary

GET Test?A='ABC' HTTP/1.1

--batch--

Run-time ->

Regards,

Ashwin

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question