on 12-30-2016 8:40 PM
Hi,
We are doing a batch call from a SAPUI5 application to an ABAP ODataModel.
What we want is to send several PO Numbers to read some text information.
The problem is when we do the call, the error happens: "Uncaught TypeError: Cannot read property '__batchResponses' of undefined"
This problem only happens if we call from the SAPUI5 application. If we use the Gateway Client for test, is works fine.
Code used in SAPUI5 for batch call:
var oBapiModel = this.getView().getModel("potrackingBapiModel");
oBapiModel.setUseBatch(true);
oBapiModel.setHeaders({ "content-type": "multipart/mixed; boundary=batch; application/http" });
oBapiModel.setDeferredGroups(["ID"]);
oBapiModel.read("/PoTextDataSet" , { groupId: "ID" });
oBapiModel.attachBatchRequestCompleted(this, function(oEvent){ console.log("BatchRequestCompleted!"); });
oBapiModel.submitChanges({ groupId: "ID",
success: function(oData) {console.log("SUCCESS ODATA"); },
error: function(oData) { console.log("ERROR ODATA");
} });
Appreciate any help.
Regards,
Oscar
Hi,
We don't have to pass the setHeaders method setHeaders method is used to set the custom headers. for more info refer the below link.
https://sapui5.hana.ondemand.com/#/api/sap.ui.model.odata.v2.ODataModel%23methods/setHeaders
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
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.