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

Record Level Locking

Former Member
0 Likes
639

Hi friends

1) I have locked a record in Exclusive mode(X) now it works when some buddy try to edit that record but not in case of display that record why.

2) While user create a new record how to block that record based on Primary key so that other user simultaniouly can not make new record with the same Primary Key condition.

Regards

Pulkit Agrawal

4 REPLIES 4
Read only

Former Member
0 Likes
592

you can create a shared lock.

Shared locks (or read locks) allow you to prevent data from being changed while you are reading it. They prevent other programs from setting an exclusive lock (write lock) to change the object. It does not, however, prevent other programs from setting further read locks.

Read only

0 Likes
592

Hi

1) i want while i am editing it no buddy is allowed to see it? I have provided the exclusive lock.

2) While user create a new record how to block that record based on Primary key so that other user simultaniouly can not make new record with the same Primary Key condition.

Ex : - MM01 transaction material number.

regards Pulkit Agrawal

Read only

Former Member
0 Likes
592

Hi,

While inserting a new record, no need to lock the table. But if there is a scenario where User 1 or User 2 would create a record with same primary key, then lock the entire table.

Since the record is not yet created, no point in trying to lock the table at record level. It should be locked at table level.

Best regards,

Prashant

Read only

Former Member
0 Likes
592

Hi,

See the below link, this will show how to create the LOCK object and write the code to lock the table entries

http://www.sapdevelopment.co.uk/dictionary/lock_enqueue.htm

Regards

Sudheer