Application Development and Automation 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: 
Read only

How to Close SAP Session Programatically

Former Member
0 Likes
4,152

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
Read only

Former Member
0 Likes
2,418

Use transaction ex with call transaction syntax (ABAP)

Read only

0 Likes
2,418

i didnt get it

Read only

0 Likes
2,418

Hello

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

Regards

Ranganath

Read only

0 Likes
2,418

Hi ,

In your ABAP Program use this statement.

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

Regards,

Lakshman.

Read only

0 Likes
2,418

Gettingdump for CALL TRANSACTION 'EX'.

Read only

0 Likes
2,418

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.

Read only

0 Likes
2,418

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.

Read only

0 Likes
2,418

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.

Read only

Former Member
0 Likes
2,418

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

Read only

0 Likes
2,418

Havent found any sutaible solution.

Read only

0 Likes
2,418

Any suitable solution