on 07-27-2010 10:10 AM
String ABAP_AS = "ABAP_AS_WITHOUT_POOL";
Properties connectProperties = new Properties();
connectProperties.setProperty(DestinationDataProvider.JCO_ASHOST, "localhost");
connectProperties.setProperty(DestinationDataProvider.JCO_SYSNR, "00");
connectProperties.setProperty(DestinationDataProvider.JCO_CLIENT, "001");
connectProperties.setProperty(DestinationDataProvider.JCO_USER, "username");
connectProperties.setProperty(DestinationDataProvider.JCO_PASSWD, "password");
connectProperties.setProperty(DestinationDataProvider.JCO_LANG, "en");
connectProperties.setProperty(DestinationDataProvider.JCO_CPIC_TRACE, "2");
createDataFile(ABAP_AS, "jcoDestination", connectProperties);
JCoDestination destination = JCoDestinationManager.getDestination(ABAP_AS);
JCoRepository rep=destination.getRepository();
System.out.println(destination.getR3Name());
System.out.println(destination.getRepositoryUser());
System.out.println(rep.getName());
JCoFunction function =destination.getRepository().getFunction("/ACTIP/GET_URLS");
//char y[]={'I','N','V','O','I','C','E'};
function.getImportParameterList().setValue("DOCTYPE","Invoice");
function.getImportParameterList().setValue("COUNT", "00001");
//char x[]={'0','1'};
function.getImportParameterList().setValue("ARCHIVE_ID", "A5");
function.getImportParameterList().setValue("SYSTEM", "");
System.out.println(function);
function.execute(destination);
System.out.println(function.getExportParameterList());
JCoParameterList list=function.getExportParameterList();
for (Iterator iterator = list.iterator(); iterator.hasNext();) {
System.out.println(iterator.next());
}
System.out.println(function.getExportParameterList());
System.out.println(function.getExportParameterList()
.getString("URL_LIST"));
System.out.println(function.getExportParameterList()
.getString("/ACTIP/URL_LIST"));
if i executes the above code i am getting the following exception from command promt
com.sap.conn.jco.JCoException: (108) JCO_ERROR_INTERNAL: java.lang.NullPointerException
at com.sap.conn.jco.rt.ClientConnection.execute(ClientConnection.java:1087)
at com.sap.conn.jco.rt.ClientConnection.execute(ClientConnection.java:879)
at com.sap.conn.jco.rt.RfcDestination.execute(RfcDestination.java:1189)
at com.sap.conn.jco.rt.RfcDestination.execute(RfcDestination.java:1163)
at com.sap.conn.jco.rt.AbapFunction.execute(AbapFunction.java:302)
at SAPClient.executeFunction(SAPClient.java:32)
at SAPClient.main(SAPClient.java:130)
Caused by: java.lang.NullPointerException
at com.sap.conn.rfc.engine.RfcGet.rfcget_run(RfcGet.java:273)
at com.sap.conn.rfc.engine.RfcGet.ab_rfcget(RfcGet.java:23)
at com.sap.conn.rfc.engine.RfcRcv.ab_rfcreceive(RfcRcv.java:34)
at com.sap.conn.rfc.engine.RfcIoOpenCntl.RfcGetData(RfcIoOpenCntl.java:2360)
at com.sap.conn.rfc.sysfunc.RfcSystemInfo.execute(RfcSystemInfo.java:42)
at com.sap.conn.rfc.engine.RfcGetName.ab_RfcDispatchLoc(RfcGetName.java:82)
at com.sap.conn.rfc.engine.RfcIoOpenCntl.RfcReceive(RfcIoOpenCntl.java:1925)
at com.sap.conn.jco.rt.MiddlewareJavaRfc$JavaRfcClient.execute(MiddlewareJavaRfc.java:1691)
at com.sap.conn.jco.rt.ClientConnection.execute(ClientConnection.java:1046)
... 6 more
Hi,
You better debug your program by switching on the debug mode of the server, then you'll find your error in the program.
Best Regards,
Sen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Actually this is problem with function in SAP System.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.