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.
ABAP TECHNICAL

SAP Introduction

sap abap faq

sap Tables

SAP Transaction codes

Internal tables

data dictionary

performance tuning

transports & Requests

Sap scripts

Smartforms

lsmw

reports

sap Workflow

module pool/ dialog
programming

table control

user exits

sap memory

abap memory

alv reports

ABAP ADVANCED

IDOC

ALE

BAPI

BADI

RFC


FUNCTIONAL SIDE

Materials Management

FICO

Human Resources

BIW / BW / SEM


Free Documentation
Abap Material

Ale Material

BAPI Material

BC Material

IDOC Material

R/3 Database Management

SAP material

RFC

Transport

Sales & Distribution Material

Basic Data and Function
Material

Basis (BC) Material

Billing Material

CA Material

CATT : Computer Aided Test
Tool

Capacity Evaluation and
leveling Material

Capacity Planning Material

Cross Application Material

Countries

Customer Service Material

Enterpise  Material

Financial / Controlling (FICO)

Internet Time Sheet

Inspection Material

HR Material

Material Management
Material

Payments Material

Payroll Material

Pension Fund

Production Planning and
Control

Plant Maintenance

Quality Management Material

Real Estate Material

SAP material

Wage Types