Request clarification before answering.
Hi,
you can use $batch option as recommended by ivan and it had to be supported from UI5 and oData service side.
Check the below blog on implementing batch
Service side oData Batch
UI5 implementation Gateway
Thanks,
Mahesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello thanks for answer.
I trying batch operation;
var serviceUrl = "/sap/opu/odata/sap/ZBZ_QM_KALITE_SONUC_SRV/$batch";<br>var oModel = new sap.ui.model.odata.v2.ODataModel(serviceUrl);<br>var contactEntry2 = {}; <br>contactEntry2.Insplot = sInsplot;
contactEntry2.Inspchar = sInspchar;<br>oModel.setUseBatch(true); <br>var batchChanges = [];<br>batchChanges.push(oModel.createBatchOperation(sPath, "PUT", contactEntry2));
oModel.addBatchChangeOperations(batchChanges);
but i getting error ;
oModel.createBatchOperation is not a function..
Need to open a property for batch?

var oDataModel = this.getView().getModel();
var batchChanges = [];
batchChanges.push(oDataModel.createBatchOperation("FirstDataSet", "POST", contactEntry1)); batchChanges.push(oDataModel.createBatchOperation("Second Dset", "POST", contactEntry2));
oDataModel.addBatchChangeOperations(batchChanges);
oDataModel.submitBatch(function(success) { var bresponse = success.__batchResponses[0]; if (bresponse.__changeResponses) { var scres = bresponse.__changeResponses[0].data; console.log("1"); } else if (bresponse.response) { var responseBody = success.__batchResponses[0].response.body; var successObj = JSON.parse(responseBody); var message = successObj.error.message.value; console.log("2"); sap.m.MessageBox.show(message, { title: "Success", icon: sap.m.MessageBox.Icon.SUCCESS, actions: [sap.m.MessageBox.Action.OK] }); } }, function(error) { var resBody = error.response.body; var errObj = JSON.parse(resBody); var message = errObj.error.message.value; console.log("3"); sap.m.MessageBox.show(message, { title: "ERROR", icon: sap.m.MessageBox.Icon.ERROR, actions: [sap.m.MessageBox.Action.OK], details: message }); }, false);
Try as above, looks you are using spath in create bath.
see this Open SAP tutorial for more info on batch operations:
https://open.sap.com/courses/hana2/items/42yDjpxcjSPSzz4JFCvA3H
| User | Count |
|---|---|
| 10 | |
| 5 | |
| 5 | |
| 5 | |
| 5 | |
| 2 | |
| 2 | |
| 2 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.