cancel
Showing results for 
Search instead for 
Did you mean: 

Close the SAP R/3 connection after BAPI call

Former Member
0 Kudos

Dear All,

In our scenario, we use the JCO in WebDynpro to make connection with SAP R/3 to access the BAPIs.

For every BAPI call in the Portal, a new connection is established with SAP R/3.

The number of connections established through the portal can be viewed using the SAP transaction SM04 in SAP R/3.

The connections get closed only if the user log off from the portal.

If the user closes the portal without logging off, then the connections are not closed.

Is there any method/procedure to close the SAP R/3 connection explicitly in the WebDynpro source code after executing each BAPI call?

best regards,

Thangesh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Maran,

Add

jcoclientobject(of type JCO.Client).disconnect() in ur code

Thanks

Fahad Hamsa

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Try this.

wdContext.current<BAPI INPUT>Element().modelObject().modelInstance().disconnectIfAlive();

This might helps you.

thanks,

Lohi.