on 11-12-2009 9:01 PM
Hello all.
How to send 2 lines parameters in the same table to call a BAPI.
This is my code ...but not work !
JCO.Table ItemDocCont = function.getTableParameterList().getTable("T_DOCITE");
ItemDocCont.setRow(1);
ItemDocCont.appendRow();
//item 1
ItemDocCont.setValue("XXX", "BUKRS");
ItemDocCont.setValue("1", "BELNR");
ItemDocCont.setValue("2009", "GJAHR");
ItemDocCont.setValue("001", "BUZEI");
ItemDocCont.setValue("TESTE SGTXT ITEM 001", "SGTXT");
ItemDocCont.setValue("100,00", "WRBTR");
ItemDocCont.setValue("6154110199", "HKONT");
ItemDocCont.setValue("0000000000", "AUFPL");
ItemDocCont.appendRow();
//item 2
ItemDocCont.setValue("XXX", "BUKRS");
ItemDocCont.setValue("1", "BELNR");
ItemDocCont.setValue("2009", "GJAHR");
ItemDocCont.setValue("002", "BUZEI");
ItemDocCont.setValue("TESTE SGTXT ITEM 002", "SGTXT");
ItemDocCont.setValue("100,00-", "WRBTR");
ItemDocCont.setValue("2113110001", "HKONT");
ItemDocCont.setValue("0000000000", "AUFPL");
mConnection.execute(function);
thanks in Advance.
Regards.
Taylor
Hey Taylor,
Two small issues: Before changing the data you must set the right row. You did this for the first row, but this is incorrect, because row numbers start with 0. I'd do the following:
ItemDocCont.appendRows(2);
//item 1
ItemDocCont.setRow(0);
ItemDocCont.setValue("XXX", "BUKRS");
//...
ItemDocCont.setRow(1);
//item 2
ItemDocCont.setValue("XXX", "BUKRS");
//...
mConnection.execute(function);
In general it's better to create all the new rows at the same time. In your case with two rows that won't make any difference, but in general the one time allocation provides better performance.
cheers, harald
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
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.