cancel
Showing results for 
Search instead for 
Did you mean: 

Run Time JCo Creation

Former Member
0 Kudos

Hi All,

I have to create JCO at runtime. Based on the SAP client ID, user id,password and system number i have to create JCO. Predefined JCO configuration for a client number thru Portal, is not useful, because i don't know how many users will logon at a time? So, i wish to create JCO based on the user inputs at run time.

I used the following code to create JCO at runtime.

try {

mConnection = JCO.createClient("sapclient",

"userid","password",lanuage,"appserver name", "system number");

mConnection.connect();

}catch (Exception ex) { ex.printStackTrace();

System.exit(1); }

After creating, i got all information like(username,appserver name,system number, etc.)

At this stage i got JCo connection name like 'mConnection'. My question is how to move to next step using mConnection?.

The JcoConnection contains some methods like mConnection.execute(parameter).

1. Is it possible to execute BAPI using JcoConnection created at runtime?

2. How to execute BAPI using JcoConnection created at runtime?

3. Is it necessary to create a model through the wizard in NWDS?

4. If i use execute() method, what are the parameters to be given?

Please help me.

Kind Regards,

S.Saravanan.

Message was edited by: Saravanan S

Message was edited by: Saravanan S

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Saravanan,

Refer

1.<a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/6a/14e13d8ee4535ee10000000a114084/frameset.htm">Table Manipulation</a>

2.<a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/6a/14e13d8ee4535ee10000000a114084/frameset.htm">Example Program</a>.

These two links should answer all your queries.

Good Luck,

Bala

Former Member
0 Kudos

Hi Bala,

Thanks for your immediate reply. I will get back after testing.

Kind Regards,

S.Saravanan.

Former Member
0 Kudos

Hi Bala,

The JCO is configured in the portal using SAP Logon Ticket, where we use only the client number to establish connection. Can we get other parameters needed to establish a JCO connection through coding to create a connection at runtime?

Kind Regards,

S.Saravanan.

Former Member
0 Kudos

Saravanan,

If you configure your JCo destinations for SSO, you don't have to do anything through your code.

Refer <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/44/45a04028f40160e10000000a1550b0/frameset.htm">Setting up a Web Dynpro Application for a Logon Ticket</a>.

Bala