Register Login

Locks Entries SM12

Updated May 18, 2018

In a system when ever a user performs any update on any table for that period of time a lock on that particular field of that table is created so that no other user can update that table as user one is doing update on that table.

And Suppose during the update user session get terminated due to some error then this lock entry remains on that field. From this Screen we can check those type of locks.

1. Run T-Code SM12  “Select Lock Entry” window will come
2. Change the User name to “*” from ”Sukhmani” because we have to report for all users and lick on list button from top or press F8.

 

Locks Entries SM12

 

“Lock Entry List” window will come.
From this window we only have to report those lock entry which are older then one day.
For Ex. “400 BOXBERGER    03/10/2006 S      MCH1       4000000000000150529060U00131019”.

 

 


Comments

  • 03 Aug 2010 10:15 am Guest
    k it easy to understand
  • 15 Dec 2011 11:38 am rekha
    Use transaction SM12 Lock entries to see lock entries

    Naming: The lock object name must start with EZ

    Create the lock object for the required table using SE11. When you create the locl object, two function
    modules will be created automatically. These two function modules named
    ENQUEUE_ and DEQUEUE_ can be called to lock or dislock
    the table.

    Example:

    Create a lock object for table MSEG called EZTESTLOCK.
    When you has created the lock object, the two function modules

    ENQUEUE_EZTESTLOCK
    DEQUEUE_EZTESTLOCK

    Will automatically be created

    REPORT lockentries.


    PARAMETERS:
    p_mbelnr LIKE mseg-mblnr DEFAULT '4900008001',
    p_mjahr LIKE mseg-mjahr DEFAULT '2001',

    p_zeile LIKE mseg-zeile DEFAULT 1,
    p_lock RADIOBUTTON GROUP lock,
    p_unlock RADIOBUTTON GROUP lock.


    START-OF-SELECTION.

    IF p_lock = 'X'.
    * Lock item
    CALL FUNCTION 'ENQUEUE_EZTESTLOCK'
    EXPORTING
    * MODE_MSEG = 'E'
    * MANDT = SY-MANDT
    mblnr = p_mbelnr
    mjahr = p_mjahr
    zeile = p_zeile
    * X_MBLNR = ' '
    * X_MJAHR = ' '
    * X_ZEILE = ' '
    * _SCOPE = '2'
    * _WAIT = ' '

    * _COLLECT = ' '
    EXCEPTIONS
    foreign_lock = 1
    system_failure = 2
    OTHERS = 3
    .
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

    ELSEIF p_unlock = 'X'.
    * Unlock item
    CALL FUNCTION 'DEQUEUE_EZTESTLOCK'
    EXPORTING
    * MODE_MSEG = 'E'
    * MANDT = SY-MANDT
    mblnr = p_mbelnr
    mjahr = p_mjahr
    zeile = p_zeile

    * X_MBLNR = ' '
    * X_MJAHR = ' '
    * X_ZEILE = ' '
    * _SCOPE = '3'
    * _SYNCHRON = ' '
    * _COLLECT = ' '
    .
    ENDIF.

×