on 03-23-2016 12:21 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I too provided the correct spaces but still have no response with status code = 202.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.