Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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.

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question