Delete table entry locks

3.9k views Asked by At

I have tried using the FM ENQUE_DELETE but I keep on not getting the expected result to delete the lock for some table entries.

I noticed that there are different kind of locks and the program that locked those table entries is using lock type 'E'.

Could I set the lock type to 'S' (Shared) so that it is possible for the first program to "lock" the table entries but once the second program is run, it can delete the table lock?

4

There are 4 answers

0
XcodeJunkie On

It should never be needed to explicitely delete specific table lock entries manually. Always only use the generated FM enqueue_... and dequeue_... to lock/unlock db records!

  1. Call ENQUEUE_EZyour_table
  2. Make your changes to your_table
  3. Call DEQUEUE_EZyour_table

This will delete the previously created lock entries.

0
eunique0216 On

Ok. I should have pushed through my investigation.

I found a way for this. Through debugging on FMs ENQUE_REPORT/READ/DELETE, I found a way to fetch the foreign locks and have them deleted, making the program assume that the current user is the user who locked the foreign locks. =]

0
icbytes On

The program which first locks the table has usually the type set up. If it is not Your program, You surely are not able and allowed to modify the standard locktype, which was set up, at runtime. As far as I know.

If it is Your program, then You can self define, which lock type You can use.

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

will tell You about the types and a code sample in the link should provide all information, which You might need.

0
Ashok Kumar Reddy S On

What tables you are using, check for lock objects in SE11 ex: ENQUEUE_ and DEQUEUE_, if available call them before and after OPEN SQL statement if not create a lock object .

Reference : http://www.sapnuts.com/courses/core-abap/open-sql/using-lock-objects.html