on 10-22-2015 6:58 PM
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.
post table binding
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I want to take all the values row by row for sending my batch operation. Thats why I have loop and this loop is working when I write like second example.
But on that example the values are written on the code. But I need table values for this.
In my opinion "MATERIAL : oTable2.content[2].getValue(), " This is not correct for take on the table from MATERIAL column value. I need this help.
Thank you,
Ogulcan G.
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
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.