Skip to Content
avatar image
Former Member

Table values should come to batch operation

Hello expert,

According to my project I have a table which have values entered by user. And also I want to send these values to my batch for my abap project. But these values can not get from table to batch. Can you help me for this?

Here is my code:

              var batchChanges = [];
              var oEntry = [];

              var zCount = moModel.oData.clients.length;
              for (i = 0; i < zCount; i++) {        
//     
                oEntry.push({  
               MATERIAL : oTable2.content[2].getValue(),
               BATCH : oTable2.content[4].getValue(),
             ENTRY_QNT : oTable2.content[6].getValue(),
                 ENTRY_UOM : oTable2.content[8].getValue(),
                 COSTCENTER : oTable2.content[10].getValue(),
                 MOVE_REAS : oTable2.content[12].getValue(),
             MOVE_TYPE : oTable2.content[14].getValue(),
          });


//          var oModel = sap.ui.getCore().getModel(); // ensure that you did not overwrite your
          // model locally!! with some JSON model for example
  //create an array of batch changes and save
            batchChanges.push(oModel.createBatchOperation("MATERIAL_POSTSet", "POST", oEntry[i]));
        };
            oModel.addBatchChangeOperations(batchChanges);
            //submit changes and refresh the table and display message
              oModel.submitBatch(function(data){
              oModel.refresh();
              sap.ui.commons.MessageBox.show(data.__batchResponses[0].__changeResponses.length
                + " contacts created", sap.ui.commons.MessageBox.Icon.SUCCESS,
              "Batch Save", sap.ui.commons.MessageBox.Action.OK);

And one more thing if i write following description these values are coming to my abap repository:

  oEntry.push({  
               MATERIAL : "20002541"
               BATCH : "NEW"
             ENTRY_QNT : "1"
                 ENTRY_UOM : "000"
                 COSTCENTER : "1000"
                 MOVE_REAS : "desc"
             MOVE_TYPE : "10586"
          });

I just need table values instead of these values.

Thanks,

Ogulcan G.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Oct 22, 2015 at 06:15 PM

    post table binding

    Add comment
    10|10000 characters needed characters exceeded

    • Please mark this Discussion with a Correct Answer (closes, but does not lock the Discussion) and Helpful Answer where appropriate. See http://scn.sap.com/community/support/blog/2013/04/03/how-to-close-a-discussion-and-why   Even if you discovered the solution without any outside contributions, it helps others to understand what the solution turned out to be. 

      Do not use Assumed Answered as it confuses anyone looking for the specific answer.  If you dig into the Getting Started link (top right of each SCN page), you are only instructed to mark Helpful or Correct Answers to Discussion responses. 

      Thanks, Mike (Moderator)

      SAP Technology RIG