/scripts/ahub.form.attachments.js
0

SAPUI5 Odata Batch: Uncaught TypeError: Cannot read property '__batchResponses' of undefined

Dec 30, 2016 at 08:40 PM

224

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers

Skip to Content