on 07-15-2008 6:30 PM
Hi,
While I was searching for stuff on Lookup API, I came across the two good blogs talking about different ways to do Lookups.
RFC lookup with communication channel -
But I couldnt find an answer for the below questions.Would appreciate if anyone can let me know,
1) Which method has a good performance - Lookup using JCo or Lookup using RFC adapter(using communication channel)
2) Is there any guideline to decide between JCo and RFC adapter method.
2) If I am using the JCo method to do the lookup, how can I provide the connection details(host,username,password) at runtime.
Thanks in advance!
1) Which method has a good performance - Lookup using JCo or Lookup using RFC adapter(using communication channel)
~~~~~~~~~~
SAP came up with the lookup API to eliminate the JCo calls. So the lookup API sure sud have a better performance.
2) If I am using the JCo method to do the lookup, how can I provide the connection details(host,username,password) at runtime.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think he is asking as to how we can pass the values dynamically using JCO.
Try creating a .properties file and store it in each instance of XI in a specific folder and code the JCO as follows.
try {
properties = new Properties();
properties.load(new FileInputStream(("/usr/sap/properties/xiprop.properties")));
client = properties.getProperty("jco.client.client");
user = properties.getProperty("jco.client.user");
passwd = properties.getProperty("jco.client.passwd");
ashost = properties.getProperty("jco.client.ashost");
sysnr = properties.getProperty("jco.client.sysnr");
// Change the logon information to your own system/user
mConnection = JCO.createClient(client, user, passwd, "EN", ashost, sysnr );
// connect to SAP
mConnection.connect();
// create repository
mRepository = new JCO.Repository( "SAPLookup", mConnection );
// Create function
JCO.Function function = null;
//write your code here
IFunctionTemplate ft = mRepository.getFunctionTemplate("FunctionModuleName");
function = ft.getFunction();
// Obtain parameter list for function
JCO.ParameterList input = function.getImportParameterList();
// Pass function parameters
input.setValue( a , "importValuetoFM" );
mConnection.execute( function );
ret = function.getExportParameterList().getString( "exportValueofFM" );
} catch (Exception e) {
e.printStackTrace();
//Disconnect the connection
} finally {
if (mConnection != null) {
try {
mConnection.disconnect();
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
return ret;
BR
Hi,
Prior to SP-13 in XI, the lookup was database dependent. but from SP-13 SAP introduce Lookup API's that are totally database independent.
Using RFC call for lookup is simple and recommended. If I am not wrong in Jco call your username and password is visible too..anyhow..RFC lookup is best instead of Jco call.
Thanks
Farooq
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
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.