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

help with FM TH_DELETE_USER

Former Member
0 Likes
979

Hello Experts,

As per my requirement I have developed a program that logs off the user without necessary credentials using FM TH_DELETE_USER.

the program works correctly in foreground.

however it does not work when executed background i.e. it does give the spool that users have been logged off but doesn't actually log them off.

i.e. the FM TH_DELETE_USER doesn't actually logs users off in background.

can you please tell me why is this happening and what is the work around?

I need to execute this program as a job.

thank you.

regards,

Omkar.

Hello Experts,

As per my requirement I have developed a program that logs off the user without necessary credentials using FM TH_DELETE_USER.

the program works correctly in foreground.

however it does not work when executed background i.e. it does give the spool that users have been logged off but doesn't actually log them off.

i.e. the FM TH_DELETE_USER doesn't actually logs users off in background.

can you please tell me why is this happening and what is the work around?

I need to execute this program as a job.

thank you.

regards,

Omkar.

4 REPLIES 4
Read only

Former Member
0 Likes
807

how you are passing value to the parameter USER? Are you passing Sy-uname?

when you are running the program using Batch job, system takes background user which is assigned in your sytem for batch job running.

So instead of sy-uname, get the user from sy-uname into a variable and pass that variable to the FM.

Regards

Mohamed

Read only

0 Likes
807

Hi Mohamed,

Thanks for you reply

I need to delete a list of users who do not have required credentials.

first I am obtaining that list calling FM 'BAPI_USER_GET_DETAIL'.

then I am looping on it and validating them then passing that user-name to the FM 'TH_DELETE_USER'

Regards,

Omkar

Read only

0 Likes
807

The reason that FM TH_DELETE_USER was not running in background (in test environment) was that there are 2 servers in test.

so the job runs on one server (say server A) and the users are logged on another server (say server B).

So the job running on A-server (FM TH_DELETE_USER) will not find any users and so will delete none though the spools will show that user have been deleted as per logic of the code.

The solution is that when we create the job we should mention the target execution server. (i.e. server B in this case)

Thanks,

Omkar

Read only

0 Likes
807

Hi Omkar,

I am also facing the same issue, Can you please confirm so if there are n number of servers than we should have n number of jobs for each server respectively to catch all the users?

Here are the issue details which we are facing.

When we re-run the job at second time then program is able to logoff the users, whereas in case of first run it shows the logs but users are not out of the system.

Please share your thoughts.

Thanks!

Anil Sahni