Skip to Content

Issue in inserting multiple record in hana using batch call in sapui5

Hi Experts,

i am facing issue in xsodata post operation when doing batch create.

Below is the service and UI code.

service {

"TableName" as "InsertTable"

create using "procedure";

}

Procedure :

insert into "table"( col1,col2) (select col1,col2 from :input_data);

and below UI code for batch operation.

var oModel = new sap.ui.model.odata.ODataModel(this.sServiceUrl);

for(var i=0;i<aCreateEntry.length;i++){

var sPath = "/InsertTable";

aCreateOperations.push(oModel.createBatchOperation(sPath,"POST",aCreateEntry[i],null));

}

oModel.addBatchChangeOperations(aCreateOperations);

oModel.submitBatch(function(oData, oResponse, aErrorResponses){aCreateOperations

if(aErrorResponses.length>0){

sap.m.MessageBox.alert("Error in Creating. Please try again...");

console.log(aErrorResponses);

}else{

sap.m.MessageBox.alert("Batch Successfull", {});

}

});

after doing that it is giving me below error "Default changeset implementation allows only one operation"

Could you please help in here

Thanks,

Jay

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

0 Answers