2006 Sep 25 8:43 AM
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
2006 Sep 25 8:46 AM
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.
2006 Sep 25 8:56 AM
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
2006 Sep 25 9:02 AM
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
2006 Sep 25 9:03 AM
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