Skip to Content
0
Former Member
May 26, 2004 at 02:39 PM

Getting Price of material

38 Views

Hello,

I am using SAPJCO to get the price of a material and i set the import parameters as follows and i get the output as Table parameter.<b>The problem is i dont get a result when i execute the function and when i write to html it says <i>no fo records found 0</i> but when i execute with same values over sapgui tool its fetches the record with price</b>.Any ideas appreciated.

JCO.Function jcofunction = aConnector.createFunction ("ZZ1IF_FG001_002");

JCO.ParameterList input= jcofunction.getImportParameterList();

JCO.ParameterList tables=jcofunction.getTableParameterList();

JCO.ParameterList output=jcofunction.getExportParameterList();

input.setValue("000000000010045512","I_MATNR");//Material Number

Timestamp astamp=new Timestamp(Calendar.getInstance().getTimeInMillis());

System.out.println("DATE"+astamp.toString().substring(0,10).trim());

input.setValue(astamp.toString().substring(0,10).trim(),"I_DATAM");

SAPConnector.getGlobalClient().execute(jcofunction);

System.out.println("OUT " +output.toString());

JCO.Table aTable=tables.getTable("T_KONP");

System.out.println("PRICE "+ aTable.getDouble("KBETR"));

aTable.writeHTML("c:/prices.html");

System.out.println("result :" + aTable.toString());

Thanks,Jakeer