‎2009 Jan 09 11:09 AM
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
‎2009 Jan 09 11:19 AM
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
‎2009 Jan 09 11:39 AM
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
‎2009 Jan 09 11:20 AM
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?.
‎2009 Jan 09 11:35 AM
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..
‎2009 Jan 09 11:38 AM
Oh..Alright..
I am not sure about that..
Lets wait and see what others will say..
‎2009 Jan 09 12:24 PM
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
‎2009 Jan 15 10:29 AM
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