cancel
Showing results for 
Search instead for 
Did you mean: 

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

0 Kudos

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

Accepted Solutions (0)

Answers (0)