Skip to Content
Aug 26, 2015 at 01:18 PM

Create entity using Batch Request in sapui5


Hello Experts,

I need one help regarding batch processing.

I have to create two entries using the button Create in one call which i am trying with the help of Batch OData calls.

I have implemented by create method of the DPC_EXT Class. Now once the call happens from the frontend, how the backend will get called means which method and what kind of code we have to write to handle the batch call.

Please find out the call which i am doing from the UI :

var oButton = new sap.ui.commons.Button({

id : 'B-Create',

text : 'Batch Call',

width : '10em',

press : function(){

userEntry1 = {

Bname : 'Ned',

Address : 'Flanders',

City : 'Raipur',

State: 'Chatisgarh',


userEntry2 = {

Bname : 'Chief',

Address : 'Wiggum',

City : 'Delhi',

State: 'Delhi',


//create an array of batch changes and save

var batchChanges = [];

batchChanges.push(oModel.createBatchOperation("userdetails", "POST", contactEntry1) );

batchChanges.push(oModel.createBatchOperation("userdetails", "POST", contactEntry2) );


//submit changes and refresh the table and display message

oModel.submitBatch(function(data) {

function(err) {

alert("Success ");


}, function(err) {

alert("Error occurred ");



Note : userdetails is my entity set name , and the create method of DPC_EXT Class has already being redefined and working perfectly.

Kindly help me the steps and the codes which i have to write.

Best Regards,