Application Development 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: 

How to use lock object? what we lock either total ztable or only record?

Former Member
0 Kudos

Hi

How to use lock object? what we lock either total ztable or only particular record?

Don't tell create lock object on se11 with E letter & acll it in program with eENQUEUE & DEQUEUE.

just tell me we will lock only particular record or total ztable?

specify with example.

Thanks.

1 ACCEPTED SOLUTION

Sm1tje
Active Contributor
0 Kudos

This kinda depends on your requirement, but normally you only lock the record which you want to process at that time. Locking entire tables doesn't make sense. I can't think of a situation in which you would want to do that.

4 REPLIES 4

Sm1tje
Active Contributor
0 Kudos

This kinda depends on your requirement, but normally you only lock the record which you want to process at that time. Locking entire tables doesn't make sense. I can't think of a situation in which you would want to do that.

0 Kudos

Hello Pravin

If your application deals with changing or modifying just one record of your Z-table then you should set the lock for this single record.

However, if you have an application which allows to modify all entries of your Z-table (e.g. editable ALV list) then is makes obviously sense to lock the entire Z-table.

Regards

Uwe

Former Member
0 Kudos

Hi Pravin,

Generally the lock objects is only the data record in the table. This is done to avoid two transactions from changing the same data on the database simultaneously

Please check this link

http://help.sap.com/saphelp_nw70/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm

Best regards,

raam

Former Member
0 Kudos

Hi

Go to SE11, in the option 'Lock object' enter the name of your lock,

begin with 'E', suppose 'EXXXX' And create. In tab 'Tables' fill the

table name where the record you want to lock exist and select the

lock mode. Lock mode can be shared and exclusive. If 'shared',

when you lock the record, other can also read data, but can not

modify. If 'exclusive', when you lock the record, other can neither

read nor modify the record. After save and activate, you will get two

function module.'ENQUEUE_EXXXX' to lock record,

'DEQUEUE_EXXXX' to release lock on one record.

When use this function module it only lock one record at a time. It

does not lock the table.