cancel
Showing results for 
Search instead for 
Did you mean: 

JCO Table as import prameter

Former Member
0 Kudos

Im just trying to insert some data to the JCO.table ,

// Get table parameters

JCO.ParameterList parameters = function.getTableParameterList();

// Post Event Header info to SAP

JCO.Table docTable = parameters.getTable("DOCTABLE");

int k = getMultipleDocsForm.getDocs().size();

System.out.println("k Size -


>" + k);

// TODO Refractor hard codings.

for(int i=1;i<=k;i++){

//docTable.appendRow()

//docTable.setRow( docTable.getRow() + 1);

//docTable.insertRow(i);

docTable.setValue("","MANDT");

docTable.setValue("1231232","DOKAR");

docTable.setValue("A","DOKNR");

docTable.setValue("0","DOKVR");

docTable.setValue("000","DOKTL");

docTable.insertRow(i);

}

// Call the remote system

System.out.println("Before Executing the SAP");

client.execute(function);

System.out.println("After Executing the SAP");

But it is not getting inserted .

Im new to JCO , can any one help me in this ?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Function func = getDefaultJCoConnection().getJCoFunction(FUNCTION MODULE NAME);

func.getImportParameterList().getField(IMPORTPARAMETER).setValue(VALUE);

Table table = func.getTableParameterList().getTable(TABLENAME);

productTable.appendRow();

productTable.setValue(VALUE1,FIELDNAME1);

productTable.setValue(VALUE2,FIELDNAME2);

getDefaultJCoConnection().execute(func);

Follow this code and send parameters through table to an RFC

Regards,

Sateesh Chandra