cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_TRIP_CREATE_FROM_DATA

Former Member
0 Kudos

Hi,

I need to insert data into SAP. I am using Java connector.

mConnection = JCO.createClient("", "", "", "", "", "");

JCO.Function function = mRepository.getFunctionTemplate("BAPI_TRIP_CREATE_FROM_DATA").getFunction();

JCO.ParameterList input = function.getImportParameterList();

input.setValue("00000002","EMPLOYEENUMBER");

JCO.Structure framedata = input.getStructure("FRAMEDATA");

framedata.setValue("2006-11-08","DEP_DATE");

framedata.setValue("2006-11-09","ARR_DATE");

...

mConnection.execute(function);

JCO.releaseClient(mConnection);

This code works fine but I need to insert information about the trip which are stored in table TEXT. I insert the data into this table using this code:

JCO.Table table = function.getTableParameterList().getTable("TEXT");

table.insertRow(0);

table.setValue("first row text", "TEXTLINE");

table.setValue("0", "TEXTID");

table.insertRow(1);

table.setValue("second row text", "TEXTLINE");

table.setValue("1", "TEXTID");

But this code doesnt work. There is no error message but the Information field in SAP is empty.

Can anyone help

Thanks for your help

Ivo

Accepted Solutions (1)

Accepted Solutions (1)

lajitha_menon
Contributor
0 Kudos

Hi Ivo,

Try using table.appendRow() instead of insertRow(0)..pls let me know if it works,

cheers,

Lm

Former Member
0 Kudos

I have solved the problem. I have changed the TEXTID parameter to "TEXT".

table.setValue("TEXT", "TEXTID");

Now it works.

Anyway thanks for your effort.

Answers (0)