2009 Mar 24 11:18 AM
Hi ABAP Experts,
I want to restrict a user from executing more than 1 instance of a particular transaction (attached to a program) at the same time.
i.e. i need to check if the same user already has an instance of this program running then i need to restrict him/her from executing another instance untill 1st instance get completed.
Can i tbe done ? If yes please let me know the way to do it.
Waiting for helpful suggestions.
Thanks in advance,
Akah
Hi ABAP Experts,
I want to restrict a user from executing more than 1 instance of a particular transaction (attached to a program) at the same time.
i.e. i need to check if the same user already has an instance of this program running then i need to restrict him/her from executing another instance untill 1st instance get completed.
Can i tbe done ? If yes please let me know the way to do it.
Waiting for helpful suggestions.
Thanks in advance,
Akah
2009 Mar 24 11:21 AM
2009 Mar 24 11:25 AM
Dear Jansi,
Can you please explain how we can achieve this using "ENQUEUE" FM?
BR,
Suhas
2009 Mar 24 11:23 AM
Hi,
you can use IMPORT/EXPORT parameter id.
When your program start make an "import parameter from memory id". If it has a value, stop the program with a message, otherwise make an "export parameter to memory id" (so the memory will be set with a value and the next import instruction will return a value that will stop the program run. At the end of the program, make a "free parameter id" to clear memory area.
For more techical information about use import/export instructions, please referr to abap help.
If import/export instruction doesen't work very well, you could use a lock file. Create it when the application start and delete when it ends. At the very beginning of your program check if the file exists. If it exists, exit the program otherwise create it. Don't forget to delete it where the program ends.
Regards
Andrea
2009 Mar 24 11:27 AM
Please look at transaction code (SM04) program name : RSM04000_ALV ..
In the perform build_list U get users and tcodes currently logged on in the system into internal table
usr_tabl .
Make use of this code in your program and check if the user is executing a partcular transaction more
than once ... If so write an Error message (Write this coding in Initialization)