cancel
Showing results for 
Search instead for 
Did you mean: 

Batch input in sapui5 odata fiori

Former Member
0 Kudos

Hello guys!

I have a problem with batch input. I use SAP Gateway with Odata services, and this I would like send to ERP one request to record rows. I sent batch input. And operation created execute several time. IWBEP/IF_MGW_CORE_SRV_RUNTIME~CHANGESET_BEGIN execute several time. It is bad. I would like sent to table and create one request for create.

Please, give me advice how I can do one request.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

sap.ui.model.odata.ODataModel is obsolete. You should use sap.ui.model.odata.v2.ODataModel more info here.

An example:

this.getModel().create("/EntitySet", entity, {
success: function(oData) {
//Success handler
},
error: function(oError) {
//Error handler
}
});

If you call it in a loop then it will send it all in one batch request and should trigger CHANGESET_BEGIN only once.

Former Member
0 Kudos

Are you using v2 oData model? Is the batch mode set to true?

Former Member
0 Kudos

I use,

var oModelCreate = new sap.ui.model.odata.ODataModel(sServiceUrl, true);

batchChanges.push(oModelCreate.createBatchOperation("ItemsWriteSet", "POST", newItem));

oModelCreate.addBatchChangeOperations(batchChanges);

Could you give me your code?