Hi all,
I have a scenario where, my java pgm gets the BAPI info using the JCO Class. Here is my Code,
JCO.Client mConnection = JCO.createClient("001","User","password","EN","server","sysno");
try {
mConnection.connect();
JCO.Repository mRepository = new JCO.Repository("MYREPOSITORY", mConnection);
IFunctionTemplate functionTemplate = mRepository.getFunctionTemplate("ZTEST_CURRENT_USER");
JCO.Function function = functionTemplate.getFunction();
String myImportValue = "I_USERNAME";
function.getImportParameterList().setValue(myImportValue,"TESTUSER");
mConnection.execute(function);
System.out.println(function.getExportParameterList().getField("E_EMP_NO"));
}
catch (Exception ex) {
ex.printStackTrace();
System.exit(0);
}
finally {
mConnection.disconnect();
}
When the statement
mConnection.connect();
gets executed, I end up in the following error..
com.sap.mw.jco.JCO$Exception: (103) RFC_ERROR_LOGON_FAILURE: Name or password is incorrect (repeat logon)
at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeConnect(Native Method)
at com.sap.mw.jco.rfc.MiddlewareRFC$Client.connect(MiddlewareRFC.java:752)
at com.sap.mw.jco.JCO$Client.connect(JCO.java:2555)
at com.sap.EmployeeDetail.main(EmployeeDetail.java:45)
The user information (Name and password ) is provided correctly.
I have provided the message server information with the port information in the services file and the Gateway Service info in the hosts file of the folder system32/drivers/etc/
I have done this way before and the same code was working fine. Please suggest what could be the problem.
Regards,
Mathan