on 05-09-2009 2:39 PM
I have created a Portal Component and creating a connection for backend access to the R/3 system.
I am able to pass the User Context - user to logon to backend system.
But now I need to pass a different user & password other than the User Context from portal in Abstract Portal component project.
I have below code which is not working. Please help me if you find any problem or suggestions requested.
IConnection mm_con = null;
//connection factory of the SAP connector to retrieve the connection from
IConnectionFactory connectionFactory=null;
Context initctx = null;
//obtain the initial JNDI context
Hashtable env = null;
initctx = new com.sapportals.portal.prt.jndisupport.InitialContext(env);
// perform JNDI lookup to obtain connection factory
connectionFactory = (IConnectionFactory) initctx.lookup("deployedAdapters/SAPFactory/shareable/SAPFactory");
// retrieve the ConnectionSpec and set the values
IConnectionSpec spec = connectionFactory.getConnectionSpec();
spec.setPropertyValue("client", "500");
spec.setPropertyValue("user", "username");
spec.setPropertyValue("passwd", "password");
spec.setPropertyValue("lang", "EN");
spec.setPropertyValue("ashost", "development_r/3_server_url:port");
spec.setPropertyValue("sysnr", "00");
// Retrieve the connection handle
mm_con = connectionFactory.getConnectionEx(spec);
mm_con.close();
I got the answer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.