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 the LOCK OBJECT

Former Member
0 Likes
964

Hi,

please explain me how to create the Lock object for one table and how to call that function modules in program,

Thanks,

Hari.

Hi,

please explain me how to create the Lock object for one table and how to call that function modules in program,

Thanks,

Hari.

6 REPLIES 6
Read only

Former Member
0 Likes
916

Hi Hari,

Lock Objects should start with EZ.

Eg : EZTEST

click create button and give the primary table name and give the lock mode and if needed give the secondary table names.

Awars points if this is helpful.

Regards,

Ravi G

Read only

varma_narayana
Active Contributor
0 Likes
916

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

<b>Reward if Helpful</b>

Read only

0 Likes
916

HI Verma,

thanks for the useful information. i am able to create lock onject for my table.

one thing i want to know is: can you briefly share the details about lock modes.

and when to use it...

regards,

Praveen

Read only

Former Member
0 Likes
916

Hi Peeleti,

Go to Tcode SE11 select the Lock object button and enter the lock object name...

e.i ey... followed by table name. and press on the create button.

Later specify the table name and other properties to complete the creatation.

Then we can use the FM Enqueue_lock object and Dequeue_lock object in the program to lock the particular table.

Regards,

Satya

Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
916

Hi,

Goto SE11 -->select lock object --> specify any name starting with E and specify the tables and fields which you want to lock and also lock mode.

It will create TWO FM ; one for enque and other to remove the lock : deque.

Call FM : ENQUEUEname and write the logic and once done call FM : DEQUEUEname

..

*reward if useful

Read only

Former Member
0 Likes
916

HI,

For creating lock objects

Go to SE11 and create the lock object starting with E and give that table name.

In the program call the FM

as below.

CALL FUNCTION 'ENQUEUE_EZ_ZFA_HEADER' ( EZ_ZFA_HEADER' lock obje)

EXPORTING

mode_/gmc/zfa_header = 'E'

mandt = sy-mandt

  • FATYPE =

  • FANUM =

  • X_FATYPE = ' '

  • X_FANUM = ' '

  • _SCOPE = '2'

  • _WAIT = ' '

  • _COLLECT = ' '

EXCEPTIONS

foreign_lock = 1

system_failure = 2

OTHERS = 3

Add the code for modify the database tables.

CALL FUNCTION 'DEQUEUE_EZ_ZFA_HEADER'

EXPORTING

mode_/gmc/zfa_header = 'E'

mandt = sy-mandt

  • FATYPE =

  • FANUM =

  • X_FATYPE = ' '

  • X_FANUM = ' '

  • _SCOPE = '3'

  • _SYNCHRON = ' '

  • _COLLECT = ' '

At here EZ_ZFA_HEADER is the lockobject.

Lock objects are multi usable.

if already exist with that table name we can use that also no need to create new one.