title: SAPUI5 - Batch Operations - how to do it right?
body: <p>I got multiple EntititySets which I want to update in my SAP Backend, therefore I fetch my data (payload) as JSON and put it in a request (its successfully in the node "data"):</p>
  
  <p>Code:</p>
  
  <pre><code>var oTreeJSON = oTreeTable.getModel().getProperty("/root");
  var oModel = sap.ui.getCore().getModel();
  var batchChanges = [];  
  
  for (var i = 0; i &lt; oTreeAll.length; i++) {
      batchChanges.push(oModel.createBatchOperation("/sap/opu/odata/sap/MY_SERVICE/?$batch", "POST", oTreeAll[i]));
  }
  
  oModel.submitBatch();
  </code></pre>
  
  <p>My Request looks like this:</p>
  
  <p><img src="https://i.stack.imgur.com/e8KGC.png" alt="enter image description here"></p>
  
  <p>Where should it arrive in SAP (which method)? What am I doing wrong, there is no error anywhere, but no call arrived in my backend... Glad about every hint! Thanks.</p>
  
  <p><strong>Working example with reduced complexity:</strong></p>
  
  <pre><code>var oEntry = {};
  oEntry.MyId = "00000001";
  oEntry.Value = "300";
  
  batchChanges.push(oModel.createBatchOperation("MyEntitySet", "POST", oEntry, null));
  oModel.addBatchChangeOperations(batchChanges); 
  oModel.setUseBatch(true);
  oModel.submitBatch();
  </code></pre>
  
  <p>For the record, method calls:</p>
  
  <ul>
  <li>1) /IWBEP/IF_MGW_CORE_SRV_RUNTIME~CHANGESET_BEGIN: SAP Proposal EXIT.</li>
  <li>2) /iwbep/if_mgw_appl_srv_runtime~create_entity. (n-times) // do your
  stuff with the entity</li>
  <li>3) /iwbep/if_mgw_core_srv_runtime~changeset_end: SAP Proposal COMMIT
  WORK.</li>
  </ul>