Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to create a lock object

Former Member
0 Likes
527

Hi all,

I want to create a lock object but how?

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
493

Hi,

Goto SE11

Entern Lock Object Name : EZTAB1. (Should start with EZ or EY).

Select Create Button..

Enter the Primary Table (your ztable).

Save and Activate .

It will generate two FMs

1. ENQUEUE_EZTAB1 (To lock the record)

2. DEQUEUE_EZTAB1. (To release the Lock)

Using Pattern call these FMs in your program

Regards,

omkar.

4 REPLIES 4
Read only

Clemenss
Active Contributor
0 Likes
493

Hi Deniz,

in SE11, enter name for lock object like EZ....

Follow the steps.

Regards,

Clemens

Read only

former_member404244
Active Contributor
Read only

Former Member
0 Likes
494

Hi,

Goto SE11

Entern Lock Object Name : EZTAB1. (Should start with EZ or EY).

Select Create Button..

Enter the Primary Table (your ztable).

Save and Activate .

It will generate two FMs

1. ENQUEUE_EZTAB1 (To lock the record)

2. DEQUEUE_EZTAB1. (To release the Lock)

Using Pattern call these FMs in your program

Regards,

omkar.

Read only

Former Member
0 Likes
493

Hi,

You open SE11 tcode and choose Lock Object Radio button and enter lockobject name but first 2 chars should be "EZ" ( suppose if you are creating lock object for ZMAIN table for field1 means name can be EZ_MAIN_FIELD1 ) press create button.

Enter text for lock object.Like Lock object for MAIN_field1.

This is just description.

Then Goto tables option and provide your table name means to which table you are locking.

Like we give ZMAIN and press enter.

you give type of locklock mode whether it can be shared /Exclusive lock (cant be shared)..etc.

In Lock Parameter option you choose field1 if it is available ( It will be available if it primary key in database table ) and then save & activate.

Now for you 2 fms are created by system automatically.

names started with ENQUEUE_EZ_MAIN_FIELD1

& DEQUEUE EZ_MAIN_FIELD1.

So ENQUEUE_EZ_MAIN_FIELD1 ,you can use for locking the table from updation .

DEQUEUE_EZ_MAIN_FIELD1 is used to release the lock .

so any one can do updation when the lock is released.

you call these fms in your program and pass parameter to this fm in place of field1 = itab-field1.

here iam giving sample code.Please look into one once.

CALL FUNCTION 'ENQUEUE_EZMDEMAIN'

EXPORTING

mode_zmdemain = 'E'

mandt = sy-mandt

serial_no = p_value

x_serial_no = ' '

_scope = '2'

_wait = ' '

_collect = ' '

EXCEPTIONS

foreign_lock = 1

system_failure = 2

OTHERS = 3.

For releasing lock ::::::::::::::::::::::::::::::::::::::

call function 'DEQUEUE_EZMDEMAIN'

exporting

mode_zmdemain = 'E'

mandt = sy-mandt

serial_no = zmdemain-serial_no

x_serial_no = ' '

_scope = _dscope

_synchron = ' '

_collect = ' '.

Thanks

Sivaparvathi

Please reward with points if helpful........