11-21-2007 1:14 PM
I've a TCode to modify a report. That TCode picks a doc no. from a table & opens up an editable ALV based on that doc. no .That doc. no. is the only primary key.
I want that if someone is already opened that report, & if someoen else is trying to open that report, it shouldn't open & should show that its locked. I've made a lock object for that table. Please advise what to do next.
11-21-2007 2:45 PM
Once the lock objects are created you need to apply them in the code using ENQUEUE and DEQUEUE function modules generated for them.
- Cheers
11-21-2007 2:51 PM
Hi Pandey,
Check this link it might help you.
https://forums.sdn.sap.com/click.jspa?searchID=6846347&messageID=4083806
Thanks,
Reward If Helpful.
11-21-2007 3:19 PM
Hello,
Before displaying the report in change mode use the function module 'ENQUE_READ' to check if there are any lock entries created already. If there are, show the report in display mode. Otherwise, lock using FM 'ENQUEUE_' and show the report in change mode. Don't forget to remove the lock entry using FM 'DQUEUE_' when the user exits the report.
Thanks
Sameej
11-21-2007 3:44 PM
Then you should have two function modules for setting and removing a lock. Just call the ENQUEUE_xxx function module with the key value before editing (and don't allow, if sy-subrc <> 0). With saving, call the DEQUEUE_xxx, to release the lock again. The names can be found in SE11 of your enqueue object.