Skip to Content
0
Jul 26, 2019 at 06:21 AM

How to perform batch update operations on custom business object in s4hc from sap ui5

202 Views

My requirement is, i want to perform multiple batch update operations on custom business object. while sending the request i'm getting the error like "Malformed URI", but while doing multiple batch create operations, it's executing well.

please help me how to do batch update operation?

Below is the code:

var oModel = this.getOwnerComponent().getModel("Parent_Data");

oModel.setUseBatch(true);

oModel.attachRequestSent(function () { sap.ui.core.BusyIndicator.show(); }); //hide busy oModel.attachRequestCompleted(function () { sap.ui.core.BusyIndicator.hide(); }); //hide busy if request is failed oModel.attachRequestFailed(function () { sap.ui.core.BusyIndicator.hide(); }); // oModel.setUseBatch(true);

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

var odataParent = oData[i]; // var payLoad = {}; // payLoad

.YProduct = oData[i].YProduct;

var sUpdatePath = "/YY1_PRODUCT_PARENTDATA(guid'" + odataParent.SAP_UUID + "')";

var sUpdatePath = "/YY1_PRODUCT_PARENTDATA(guid'" + odataParent.SAP_UUID + "')"; oModel.update(sUpdatePath, odataParent, {

method: "PUT",

success: function (oDataSuccess, oResponse) {

sap.m.MessageToast.show("Product Updated Successfully"); },

error: function (oResponse) {

} }); }

oModel.submitChanges();

i'm getting the below error:

2019-07-26 11:48:03.199955 The following problem occurred: HTTP request failed400,Bad Request,{"error":{"code":"005056A509B11EE1B9A8DBD9EA7BB778","message":{"lang":"en","value":"Malformed URI literal syntax"},"innererror":{"transactionid":"9208AF0FC1440250E005D335962E9C89","timestamp":"20190726061542.8023290","Error_Resolution":{"SAP_Transaction":"For backend administrators: use ADT feed reader \"SAP Gateway Error Log\" or run transaction /IWFND/ERROR_LOG on SAP Gateway hub system and search for entries with the timestamp above for more details","SAP_Note":"See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)"}}}} -