Application Development 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: 

Regarding lock objects

Former Member
0 Kudos

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.

4 REPLIES 4

Former Member
0 Kudos

Once the lock objects are created you need to apply them in the code using ENQUEUE and DEQUEUE function modules generated for them.

- Cheers

Former Member
0 Kudos

Hi Pandey,

Check this link it might help you.

https://forums.sdn.sap.com/click.jspa?searchID=6846347&messageID=4083806

Thanks,

Reward If Helpful.

Former Member
0 Kudos

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

christian_wohlfahrt
Active Contributor
0 Kudos

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.