cancel
Showing results for 
Search instead for 
Did you mean: 

Issue in $batch processing

GowthamRaja
Participant

Hi Experts,

I have a table in backend with 2 primary key 'BP_KEY' & 'REG_KEY' as shown below.

Now i have to update/insert the records for multiple entries in the table using $batch operations.

I have redefined my methods changeset_begin & changeset_end.

Now when i try to update the records, the status changes to 202 accepted but gives the information

" Empty response body: Check your batch request

body. See also SAP note 1869434."

i have given the URI /sap/opu/odata/sap/YBUSI_PROCESS_SRV/$batch

the request body content as,

--batch

  Content-Type: multipart/mixed; boundary=changeset

  --changeset

  Content-Type: application/http

  Content-Transfer-Encoding: binary

  PUT SPRegtnSet(BP_KEY='3004',REG_KEY='6001') HTTP/1.1

  Content-Type: application/json

  Content-Length: 1000

{

         "BP_KEY" : "3004",

         "REG_KEY" : "6005",

         "REG_NAME" : "FISMA - NIST",

         "VERSION" : "1"

}

  --changeset

  Content-Type: application/http

  Content-Transfer-Encoding: binary

  PUT SPRegtnSet(BP_KEY='3005',REG_KEY='6002') HTTP/1.1

  Content-Type: application/json

  Content-Length: 1000

{

         "BP_KEY" : "3004",

         "REG_KEY" : "6005",

         "REG_NAME" : "FISMA - SANS",

         "VERSION" : "1"

}

  --changeset--

  --batch—

The backend table is not being updated. Please help me to resolve this. I dont know where the problem is.

Thanks in advance,

Gowtham

Accepted Solutions (1)

Accepted Solutions (1)

AshwinDutt
Active Contributor
0 Kudos

Hello Raja,

This because incorrect spacing between the operations inside the payload.

Please use the below and check.

--batch

Content-Type: multipart/mixed; boundary=changeset

--changeset

Content-Type: application/http

Content-Transfer-Encoding: binary

PUT SPRegtnSet(BP_KEY='3004',REG_KEY='6001') HTTP/1.1

Content-Type: application/json

Content-Length: 1000

{

"BP_KEY" : "3004",

"REG_KEY" : "6005",

"REG_NAME" : "FISMA - NIST",

"VERSION" : "1"

}

--changeset

Content-Type: application/http

Content-Transfer-Encoding: binary

PUT SPRegtnSet(BP_KEY='3005',REG_KEY='6002') HTTP/1.1

Content-Type: application/json

Content-Length: 1000

{

"BP_KEY" : "3004",

"REG_KEY" : "6005",

"REG_NAME" : "FISMA - SANS",

"VERSION" : "1"

}

--changeset--

--batch--

Regards,

Ashwin

GowthamRaja
Participant
0 Kudos

Hi Ashwin,

Thanks for your update, its working fine now

Regards,

Gowtham

Answers (2)

Answers (2)

0 Kudos

I too provided the correct spaces but still have no response with status code = 202.

deshrajk
Discoverer
0 Kudos

Hello Gowtham Raja M ,

I am also facing the same issue of "Empty Response Body:...* . I tried all approache and SAP Notes too not sure what did you do to correct the issue.

I am calling the service from FIORI(which generates the payload automatically for $batch) also to make sure space issues not happened. Can you tell me what is the resolution you had for this issue in detail please.

Regards Raj