on 2017 Jul 02 8:31 AM - last edited on 2024 Feb 03 9:22 PM by postmig_api_4
Hi Experts,
I am trying to make a batch call against the offline store using content-id referencing (for linking order header with items). When I make the call for only the headers (without content-id) the request and flush execute correctly.
It is only when using content-id I am facing this issue.
Below is the payload that is being used :
function: batchCreateAndUpdate() {
var oHeaders = {};
var params = {
__batchRequests:
[{
__changeRequests:
[{
requestUri: getEndPointURL() + "/OrderSet", method: "POST",
headers: { "Content-ID": "1" },
data: {
"Vbeln": "23456",
"Vkorg": "IN09",
"Vtweg": "80", "Spart": "00",
"Vdatu": "2017-06-30",
"Netwr": "18369.500",
"Waerk": "INR",
"Kunag": "9067906",
"Kunwe": "9067906",
"Kunrg": "9067906",
"Ernam": "ENEVS"
}
},
{
requestUri: "$1/toOrderItems", //toOrderItems
method: "POST",
data: {
"Vbeln": "23456",
"Posnr": "000010",
"Posex": "", "Matnr": "79723407",
"Kwmeng": "1.000",
"Vrkme": "CTN",
"Netpr": "18369.500",
"Waerk": "INR", "Vdatu": "2017-06-30",
"Status": "new",
"Netwr": "18369.500",
"Meins": "CAR"
}
}]
}]
};
oHeaders['Authorization'] = authStr;
var request = {
headers: oHeaders,
requestUri: getEndPointURL() + "/$batch",
method: "POST",
data: params
};
OData.request(request, batchCallbackSuccess, errorCallback, OData.batchHandler);
}
Both the header and items entities are in the defining requests. toOrderItems is the navigation name used as requesturi of the 2nd record for referencing the header.
The error that pops up on making this request is : Unhandled payload type.
Please suggest where I must be going wrong ?
Issue solved by upgrading to latest SMP SDK 3.0 SP 13 PL04 ! Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
73 | |
10 | |
8 | |
8 | |
7 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.