Skip to Content
author's profile photo Former Member
Former Member

Regarding lock objects

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 02: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 02: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 03: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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 21, 2007 at 03: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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.