Skip to Content
Jan 17, 2018 at 06:58 AM

$Batch request from UI5 application returns "Property 'xyz' is invalid" error from SAP GW

1686 Views Last edit Jan 17, 2018 at 08:14 AM 2 rev


I have a SAP UI5 table from which I am getting all the rows and creating a JSON which I then pass to the back-end SAP system using oModel.submitChanges in my controller.

I am using oDataModel v2 to accomplish this.

batchSave: function(){
  var items = [];// intializing an array
  var oTable = sap.ui.getCore().byId("JobsDetails");
  var oTableData = oTable.getModel().getData();// getting table data
  var sServiceUrl = ""; // ODATA URL
  var oModel = new sap.ui.model.odata.v2.ODataModel(sServiceUrl, true);
  var aDeferredGroup = oModel.getDeferredGroups().push("myBatch");
  var mParameters = {groupId:"myBatch"};           
  for (i = 0; i < oTableData.length; i++) {
       "Jobname": oTableData[i].Job,
       "Jobtext": oTableData[i].JobName,
   //oEntry is the main object to send data using batch operation.
  var oEntry = {
    //converting data into json format
    "JobsData": JSON.parse(JSON.stringify(items)),
  oModel.create("/MyJobsSet", oEntry, mParameters);

The issue is when this method is called, it returns the error: "Property 'JobsData' is invalid" in the browser. JobsData here is the JSON string that we are pushing into oEntry and passing to the oModel. This error appears for oModel.submitChanges(mParameters);

Do I need to have any such property at the Gateway Client side (in SEGW)? or anywhere else? What is wrong in this approach?

Please find the browser response for the error below-

2018-01-17 10:10:40.841722 The following problem occurred: HTTP request failed400,Bad Request,{"error":{"code":"/IWCOR/CX_DS_EP_PROPERTY_ERROR/005056A509B11ED1BF822D2D09171A04","message":{"lang":"en","value":"Property 'JobsData' is invalid"},"innererror":{"application":{"component_id":"CA","service_namespace":"/SAP/","service_id":"ZXX_SRV","service_version":"0001"},"transactionid":"5A5948625F30D406E10000000A5F0E19","timestamp":"20180117044040.5668060","Error_Resolution":{"SAP_Transaction":"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 ("},"errordetails":[]}}} -