Skip to Content
avatar image
Former Member

Query

What is lock object and how and why do we create it.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Aug 20, 2007 at 10:16 AM

    Lock objects are use in SAP to avoid the inconsistancy at the time of data is being insert/change into database.

    SAP Provide three type of Lock objects.

    - Read Lock(Shared Locked)

    protects read access to an object. The read lock allows other transactions read access but not write access to

    the locked area of the table

    - Write Lock(exclusive lock)

    protects write access to an object. The write lock allows other transactions neither read nor write access to

    the locked area of the table.

    - Enhanced write lock (exclusive lock without cumulating)

    works like a write lock except that the enhanced write lock also protects from further accesses from the

    same transaction.

    You can create a lock on a object of SAP thorugh transaction SE11 and enter any meaningful name start with EZ Example EZTEST_LOCK.

    Use: you can see in almost all transaction when you are open an object in Change mode SAP could not allow to any other user to open the same object in change mode.

    Example: in HR when we are enter a personal number in master data maintainance screen SAP can't allow to any other user to use same personal number for changes.

    Technicaly:

    When you create a lock object System automatically creat two function module.

    1. ENQUEUE_<Lockobject name>. to insert the object in a queue.

    2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above FM.

    You have to use these function module in your program.

    Hope this will give a basic idea.

    Reward if Useful,

    Imran.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      The reply to ur query was on this forum itself.. you have to do a bit of searching before you post a new thread. you would find majority of the answers to your queries already there on the forum.

      All the best !

      Regards,

      Suruchi

  • avatar image
    Former Member
    Aug 20, 2007 at 10:27 AM

    Before posting a question first do a search in forum...........

    and close this thread

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 20, 2007 at 10:15 AM

    Hi Nidhi,

    Welcome to SDN.

    <b>purpose of lock objects</b>: If multiple user try to access a database object, inconsistency may occer. To avoid that inconsistency and to let multiple user give the accessibility of the database objects the locking mechanism is used.

    Steps: first we create a loc object in se11 . Suppose for a table mara. It will create two functional module.:

    1. enque_lockobject

    1. deque_lockobject

    before updating any table first we lock the table by calling enque_lockobject fm and then after updating we release the lock by deque_lockobject.

    Lock objects are use in SAP to avoid the inconsistancy at the time of data is being insert/change into database.

    SAP Provide three type of Lock objects.

    - Read Lock(Shared Locked)

    protects read access to an object. The read lock allows other transactions read access but not write access to

    the locked area of the table

    - Write Lock(exclusive lock)

    protects write access to an object. The write lock allows other transactions neither read nor write access to

    the locked area of the table.

    - Enhanced write lock (exclusive lock without cumulating)

    works like a write lock except that the enhanced write lock also protects from further accesses from the

    same transaction.

    You can create a lock on a object of SAP thorugh transaction SE11 and enter any meaningful name start with EZ Example EZTEST_LOCK.

    <b>Use:</b> you can see in almost all transaction when you are open an object in Change mode SAP could not allow to any other user to open the same object in change mode.

    <b>Example:</b> in HR when we are enter a personal number in master data maintainance screen SAP can't allow to any other user to use same personal number for changes.

    Technicaly:

    When you create a lock object System automatically creat two function module.

    1. ENQUEUE_<Lockobject name>. to insert the object in a queue.

    2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above FM.

    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm

    GO TO SE11

    Select the radio button "Lock object"..

    Give the name starts with EZ or EY..

    Example: EYTEST

    Press Create button..

    Give the short description..

    Example: Lock object for table ZTABLE..

    In the tables tab..Give the table name..

    Example: ZTABLE

    Save and generate..

    Your lock object is now created..You can see the LOCK MODULES..

    In the menu ..GOTO -> LOCK MODULES..There you can see the ENQUEUE and DEQUEUE function

    Lock objects:

    http://www.sap-img.com/abap/type-and-uses-of-lock-objects-in-sap.htm

    http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm

    See this link:

    http://www.sap-img.com/abap/type-and-uses-of-lock-objects-in-sap.htm

    Check these links -

    lock-objects

    lock-objects

    lock-objects

    Regards,

    Suruchi

    Add comment
    10|10000 characters needed characters exceeded