sitemap
SapMaterial.com
Lock entries
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_<lock object name> and DEQUEUE_<lock object name> 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.
All of the product names here are trademarks of their respective companies. The site
www.allsaplinks.com no way affiliated with SAP AG. We have made every effort for the content
integrity. Information used on this site is at your own risk.