Hi Amol,
submitBatch is a method of your model like below:
oModel.submitBatch() this you need to write in your view's controller.
Go through below link
JsDoc Report - SAP UI development Toolkit for HTML5 - API Reference - sap.ui.model.odata.ODataModel
You need to write this code of making
For making data to send to Service you need to create object you can do this as below :
this aa,bb,cc are the values which you have taken from frontend in View as below:
// Reading values from frontend form as below
var aaVal = sap.ui.getCore().byId("FNM").getValue();
var bbVal = sap.ui.getCore().byId("LNM").getValue();
info1={FNM:aaVal ,LNM:bbVal}
info2={FNM:'aaVal1',LNM:'bbVal2'}
var FULLDATA= [];
// now pushing your data to object to send to Server
FULLDATA.push( oModel.createBatchOperation("USERINFO", "PUT", info1) );
FULLDATA.push( oModel.createBatchOperation("USERINFO", "PUT", info2) );
// Above you can use PUT or POST
<HTTP METHOD> we need to use eighter PUT or POST method.
now your data is available in FULLDATA array we just need to send it to Gateway Service.
now we will submit these changes:
oModel.addBatchChangeOperations(FULLDATA);
oModel.submitBatch(function() {
sap.ui.commons.MessageBox.alert("Record Updated Successfully!", '', "Success");
}, function() {
sap.ui.commons.MessageBox.alert("Record Update Error!", '', "Error");
});
oModel.refresh();
now in DPC_EXT method inside UPDATE_ENTITYSET you need to read this data and just call ABAP Modify statement. I can not recall exact table parameter but every EntitySet method is having Table parameter which contains all these values which you send to gateway from Frontend.
Thanks-
Abhishek