cancel
Showing results for 
Search instead for 
Did you mean: 

JCO Table Parameter whith 2 lines...

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Hello Harald.

OK ....it`s work fine now !

The first row was set to ItemDocCont.setRow(0);

Thanks for your help.

10 Points add to you.

Best Regards.

Answers (0)