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

lock objects

Former Member
0 Likes
615

how to lock a specific table entries in a perticular table

5 REPLIES 5
Read only

Former Member
0 Likes
573

Hi,

Use the lock object.

Create a lock object in SE11

It will generate two function modules..One to lock it and another one to unlock the record.

Check this link for how to create a lock object

http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eef3446011d189700000e8322d00/content.htm

Thanks,

Naren

Read only

0 Likes
573

Hello Sunil,

Go to se11 transaction.

Click on lock object radio button and give a lock object name starting with 'E'.For example 'ESAMPLE'.Click CREATE.

In the TABLE tab, you can give the table name for which you require a lock.In the LOCK PARAMETERS tab,you can give the table fields based on which the table should be locked.

Call a function module in your program ENQUEUE_lockobjectname to obtain a lock on the required table.In our example the FM will be ENQUEUE_ESAMPLE.

To release the lock on the table,call the function module DEQUEUE_lockobjectname.In our example the FM will be DEQUEUE_ESAMPLE.

Regards,

Beejal

**Reward if answer helps.

Read only

Former Member
0 Likes
573

Hi,

Check the Enqueue* and Dequeue* Func.Modules in SE37. You will get a couple of standard table entries locks for different table.

If you want to create your own Lock objects, then go to SE11, create and object starting with EZxxxxx, this will create two FM's one for ENQUEUE and one for DEQUEUE.

Hope this helps.

Regards

Subramanian

Read only

Former Member
0 Likes
573

In addition to the above, while you create the Lock Object, the system asks you on which fields you want to Lock the complete entry in a table.

While executing the program, you have to lock the required entry in a Loop statment.. Just call the ENQUEUE_ZXXXX and pass the field and lock that entry.

Sim process has to be followed for Unlock.

Ketan

Read only

Former Member
0 Likes
573