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

Lock/Restrict re-execution of a program

Former Member
0 Likes
2,387

Hi all

how can i lock/restrict a program which is already running from further execution of it by some other user ?

the program might run for several days and access several tables..I know lock-objects can be used to lock tables but can they also be used to lock or restrict an instance of a program itself ? please help

7 REPLIES 7
Read only

andrea_galluccio2
Contributor
0 Likes
1,556

Hi,

this could be a suggestion.

In the START-OF-SELECTIOn, put a logic like this.

Import a value from memory (with IMPORT FROM MEMORY ID instruction).

If this value = 'X' (means that program is running).

exit from the program (LEAVE PROGRAM).

else.

export 'X' to memory id (with EXPORT TO MEMORY ID instruction).

endif.

Hope it helps

Bye

Andrea

Read only

0 Likes
1,556

hello Andrea

Could you please tell me whether my problem can be handled using abap-dictionary lock objects..thats exactly what i am interested to know right now

Read only

Former Member
0 Likes
1,556

If the program is under your login,

Goto--Attributes.

There will a check box Editor Lock..

Check that..

By doing this,other user cannot edit your program..

Is this what you are looking for?.

Read only

0 Likes
1,556

thanks harini

but what i want to know is how to make a (any) program 'exclusive' meaning that once the program is executed

no other user should be able to instantiate (execute) another instance of it, till the end of it. Its like locking tables to prevent simultaneous access using lock-object. Also i want to know whether a lock-object can itself be used to lock a program in similar manner, so that its instance is exclusive at any given time..

Read only

Former Member
0 Likes
1,556

Oh..Alright..

I am not sure about that..

Lets wait and see what others will say..

Read only

uwe_schieferstein
Active Contributor
0 Likes
1,556

Hello Graison

You could give fm ENQUEUE_ES_PROG a try. Use this fm to create a lock on DB view TRDIR for your report.

At event INITIALIZATION you can implement the following logic:

  • Check if report is already locked => Yes, then LEAVE PROGRAM.

  • Set lock for report => Unsuccessful, then LEAVE PROGRAM.

  • Execute report

  • ...

  • Unlock the report after execution (should occur automatically)

Regards

Uwe

Read only

Former Member
0 Likes
1,556

Hi all

thanks for helping me..

i finally got the solution which is to create a dummy table and lock it using lock-object, at the very beginning of the program itself.

this makes the program exclusive for me(or any user who does the above)

the lock-object for the dummy table must be finally released before exiting which indirectly unlocks the program itself.

thanks and regards