on 05-26-2004 3:39 PM
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
Hi Jakeer,
on the first glance, the timestamp might be the reason. java.sql.Timestamp (i guess, you are using this, it's difficult to say without import statements) returns the ISO format "yyyy-MM-dd" on toString(). R/3 "timestamps" are expected in the format yyyyMMdd without the '-' normally. Remove the '-'s and see what happens.
Hope that helps.
Regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stefan,
I tried to set the date as u mentioned but still i dont get any price .Could you pls tell me how to set the <b>material number for eg :KM-J-34992</b> (18 characters in SAP).
Here's the way i set the material number and date :
//input is import parameter for the function
input.setValue("KM-J-34992","I_MATNR");//Material Number
input.setValue("20040527","I_DATAM");
I wanted to know whats the standard way of setting the date in SAP from java programme.
Thanks,Jakeer
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.