2011 Oct 07 10:15 AM
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.
2011 Oct 07 12:03 PM
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
2011 Oct 07 12:10 PM
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
2011 Oct 10 7:04 AM
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
2015 Jun 11 4:06 AM
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
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |