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

checking for running programs using a abap program

Former Member
0 Likes
1,184

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?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
779

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.

2 REPLIES 2
Read only

matt
Active Contributor
0 Likes
779

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

Read only

Former Member
0 Likes
780

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.