cancel
Showing results for 
Search instead for 
Did you mean: 

JCO - ImportParameter

Former Member
0 Kudos

problem with import-parameter,

I try to send an import parameter to sap : import-parameter I_MATNR Value 0000554125

it should give me the attribute of the part but there is the error message: Table O_ZMATINFO empty ;

My JCo.Class:

try {

IFunctionTemplate ftemplate = eRepository.getFunctionTemplate("Z_GET_MATINFO");

if (ftemplate == null) {

System.out.println("Z_GET_MATINFO" +

" not found in SAP.");

System.exit(1);

}

JCO.Function function = new JCO.Function(ftemplate);

JCO.ParameterList mimport= function.getImportParameterList();

mimport.setValue("00000000554125","I_MATNR");

JCO.ParameterList exp= function.getExportParameterList();

System.out.println("Answer " + exp.getValue("O_SUBRC"));

client.execute(function);

JCO.Table table1 = function.getTableParameterList().getTable("O_ZMATINFO_GET");

if(table1.isEmpty())

System.out.println("Tabelle ist LEER!");

for (int i = 0; i < table1.getNumRows(); i++, table1.nextRow()){

System.out.println(table1.getString("MATNR") + '\t' +

table1.getString("ERSDA") + '\t' + table1.getNumRows());

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Please try:

JCO.Table table1 = function.getExportParameterList().getTable("O_ZMATINFO_GET");

instead of this:

JCO.Table table1 = function.getTableParameterList().getTable("O_ZMATINFO_GET");