cancel
Showing results for 
Search instead for 
Did you mean: 

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

0 Kudos
503

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)"}}}} -

0 Kudos

Please help

Accepted Solutions (0)

Answers (1)

Answers (1)

Enda
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Srinivasa

Doe the issue only occur in the custom business object or when using a Standard API ?

From the description you seem to be using Products , can you tried using the api API_PRODUCT_SRV - A_Product or the APIs available in the API https://api.sap.com/ ?

If these options arent suitable then i would suggest creating an incident for the issue .

please see the KBA https://launchpad.support.sap.com/#/notes/1296527 how to do this

We would need to check the input file / debugging the issue / check backend logs so see why the error "Malformed URI" is raised.

Best Regards

Enda

0 Kudos

Hi Enda,

Thanks for your answer, here my requirement is to mass update of the records from the spreadsheet into a custom business object, i didn't tested Standard API, can u please help me how to perform batch update operations and i can able perform batch create operations

Thanks in advance.

Regards,

B V Srinivasa Reddy