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

Code for Logout

Former Member
0 Likes
4,315

Hi, Experts,

How can I logout by executing a program. means What will be code to write in program so that system make logout when the same program execute.

Ex. When we write /NEX in command window , It's logout from SAP.

With Warm REGARDS

Rajiv Singh.

1 ACCEPTED SOLUTION
Read only

former_member189059
Active Contributor
0 Likes
2,634

Hello Rajiv,

Try this

call 'SYST_LOGOFF'.

6 REPLIES 6
Read only

Former Member
0 Likes
2,634

u can try this

fm

TH_DELETE_USER

pass sy-uname and sy-mandt to this but it may cause problem if multiple ppl are using same user id.

Read only

former_member404244
Active Contributor
0 Likes
2,634

Hi,

I don't understand why this requirement has come up, i suggest instead of logging out , after u execute the program u can come to SAP EASY ACCESS screen, so that u can use for other purposes, instead of completely logging out.

Regards,

Nagaraj

Read only

Former Member
0 Likes
2,634

hi ,

You can do it with a BDC . Check out the following code.


include bdcrecx1.

start-of-selection.

perform open_group.

perform bdc_dynpro      using 'SAPLWBABAP' '0100'.
perform bdc_field       using 'BDC_CURSOR'
                              'RS38M-FUNC_EDIT'.
perform bdc_field       using 'BDC_OKCODE'
                              '/NEX'.

perform bdc_transaction using 'SE38'.

perform close_group.

Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 4:02 PM

Read only

former_member189059
Active Contributor
0 Likes
2,635

Hello Rajiv,

Try this

call 'SYST_LOGOFF'.

Read only

Former Member
0 Likes
2,634

check this ...

Read only

Former Member
0 Likes
2,634

Hi,

try this FM: CALL FUNCTION 'TH_DELETE_MODE'.

Regards, Dieter