If you want to prevent a specific ABAP program from being executed in multiple sessions simultaneously, you can implement this simple workaround:
- Create a Z-Table with the fields MANDT, REPID (like sy-repid)
- Create a lock object based upon this table
- When your program is executed, try to ENQUEUE the lock. If you can’t, this means that the lock has been set in another session (the program is running already). In that case, display a polite warning message and “leave list-processing” =)
- Don’t forget to DEQUEUE as well
Leave a Reply