‎2007 Dec 22 9:25 AM
Is there a way in ABAP to detect from within a program that another process is running the same program? Meaning if PROG1 is running, could PROG1 check to see if another process is running program PROG1?
‎2007 Dec 22 11:55 AM
there are several methods for this purpose, but you must code it
my favorite is using the FM ENQUEUE_ARRAY because of reliability, it works also fine in most cases of program aborts due to the equeue-process
other methods i.e. using a user table with entry for program run or using memory id's.
‎2007 Dec 22 9:58 AM
Use the locking concept. You can either create your own, or a popular one to use is ESINDX, passing parameters: relid 'ZZ', SRTFD program name, and SRTF2 = 0.
The logic is:
Attempt to get lock (FM ENQUEUE_ESINDX, perhaps).
If lock got -> run program
If lock not got -> quit.
You have to put this logic at the start of your program.
matt
‎2007 Dec 22 11:55 AM
there are several methods for this purpose, but you must code it
my favorite is using the FM ENQUEUE_ARRAY because of reliability, it works also fine in most cases of program aborts due to the equeue-process
other methods i.e. using a user table with entry for program run or using memory id's.