‎2005 Nov 07 6:31 AM
Hi,
How can we block another user from executing report with the same value of parameter/select-option field entered on screen by user?
for example:
Report ZZZ, parameter field sales org = A, run by user 1.
Another user, say B, attempts to run the report by entering the same sales org = A. In these second execution of the report, I need to display error message saying that user A is running the report then report cant be run by user B.
Do i need to put lock object for these?
thanks alots
Alia
‎2005 Nov 07 6:38 AM
Hi Alia,
Try creating a lock object with the parameters you want to check. This can be from different database tables. Then in the start of selection call the lock object with the parameters given. If another user run the program with the same parameters, the locking will fail and you can give an error message and exit from the program.
Cheers
Vinod
‎2005 Nov 07 6:36 AM
No, there is no mechanism to restrict in that way.
but you can create a Z-table with one column (vkorg)
now make a little change in the report..
1.check if any entry of vkorg is there in that z-table.
if not proceed, else error msg.
2.craete an entry of that vkog in that z-table.
3.Normal processing of this report.
4.at end delete that entry of vkorg from z-table.
thus you can achieve mutual exclusion.
cheers.
Message was edited by: Anid
‎2005 Nov 07 6:38 AM
Hi Alia,
Try creating a lock object with the parameters you want to check. This can be from different database tables. Then in the start of selection call the lock object with the parameters given. If another user run the program with the same parameters, the locking will fail and you can give an error message and exit from the program.
Cheers
Vinod
‎2005 Nov 07 6:59 AM
Hi all,
thanks alots for the given solution. I use lock object and can work perfectly.
again, huge thanks
Alia
‎2005 Nov 07 7:07 AM
Hi ,
otr try that (without lock object):
sptab-TABNAME = 'TVKO'.
concatenate sy-mandt 'A' into sptab-VARKEY .
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
TABNAME = sptab-TABNAME
VARKEY = sptab-VARKEY
EXCEPTIONS
FOREIGN_LOCK = 1
SYSTEM_FAILURE = 2
OTHERS = 3.Andreas
‎2005 Nov 07 8:11 AM
Hi Andreas.
Thanks alots. I have tried your solution, can work. I no need to create own lock object.
Thanks!!
Alia