Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to Close SAP Session Programatically

Former Member
0 Kudos

Can anyone tell me how to close sap session by runtime (Abap Code).

If there any FM?

My Requirement is : suppose transaction t1 is already opened in one session and i want to open that tcode (t1) again...then already opened session where that tcode is opened should get killed...

Sachin

11 REPLIES 11

Former Member
0 Kudos

Use transaction ex with call transaction syntax (ABAP)

0 Kudos

i didnt get it

0 Kudos

Hello

Try debugging the transaction SM04, this is used to kill a session.

Regards

Ranganath

0 Kudos

Hi ,

In your ABAP Program use this statement.

CALL TRANSACTION 'EX'. EX stands for EXIT .It ends the SAP session.

Regards,

Lakshman.

0 Kudos

Gettingdump for CALL TRANSACTION 'EX'.

0 Kudos

Hi,

Try using this FM TH_DELETE_USER.

I didn't check for the previous call transaction statement.Its actually going to dump.EX is present in TSTC table.

Hence call transaction wont work.

Regards,

Lakshman.

0 Kudos

I think TH_DELETE_USER will kill that users all session..

my requirement is i need to close only that session where my tcode is already opened.

0 Kudos

You can create a program with option Tcode and use FM TH_USER_LIST

to get all users and sessions open.

Check if your transaction is already open then delete it.

Former Member
0 Kudos

hi write single line of code,

call transaction 'SYST_LOGOFF'. and try to execute it, if reqd create a t-code for this program.

thanks and Regards,

Thiru

0 Kudos

Havent found any sutaible solution.

0 Kudos

Any suitable solution