Search this blog for other interesting articles

Thursday 9 June 2011

How to delete an SAP lock ?

This article answers following queries :

  • What is a SAP lock ?
  • Different types of SAP locks ?
  • Difference between Write lock(E) and Enhanced write lock(X) ?
  • How to monitor SAP locks ?
  • How to delete SAP locks ?

****************************************************************

SAP lock is set by the executing workprocess when a user/job wants a change access to data.

Whenever a lock to be set the respective workprocess checks in the locktable whether a respective lock conflicts the existing entries in the locktable. If so, a lock is refused. If there is no conflict, then a lock is set.

There are different types of locks :

Write locks (E) : This is also known as exclusive lock mode as the lock data can be edited by only one user. Any other requests from workprocesses to set another write lock or read lock are rejected. A cumulate lock can be applied on the lock data by the same lock owner again.

Read locks (S) : This is also known as shared lock mode as several users can have read access to the locked data at the same time. Additional read lock requests are entertained even if they are from different users. However a write lock is rejected.

Enhanced write locks (X) : This is also known as exclusive non-cumulative lock mode. An enhanced write lock can be requested only once even if it is by the same transaction.

Difference between write locks(E) and Enhanced write lock(X) is write locks can be set and released by the same transaction several times but X type locks can also be set once even by the same transaction.

Optimistic locks (O) : These locks are set up when the users displays the data in change mode. Several optimistic locks can be setup on the same data. Optimistic locks are read locks(S) at first and converted to write lock (E) when the users wants to save the data. If an optimistic locks on a data is changed to write lock(E), all other optimistic locks on that data will be deleted.

Locks that are set by an application program are released by the program itself or they are released by the update program once the database has been changed.

Transaction code SM12 can be used to monitor SAP locks.




Here you have option of selecting locks based on following parameters
  • tablename
  • lock argument
  • client
  • username


















In case, as part of monitoring, if you encounter some old sap locks and after thorough analysis, you would like to delete these, it can be done in the following ways :
  • Select the locks and delete the lock from SM12
  • Identify the user who has set the respective lock and end the user session using SM04 transaction code







10 comments:

Anonymous said...

thanks

Anonymous said...

thanks

Ramesh said...

thanks

Anonymous said...

Dear Durga,

I am a IT graduate and have experience in MM module as a end user from Accenture Noida. After leaving Accenture i have taken BASIS training from one of the institute from Delhi... Is it possible that i can get a job in SAP as a basis consultant with 3.5 experience. Moreover, i got to know from people that being a girl there are very less jobs for girls in Basis.

Thanks & Regards

Unknown said...

if we terminate user seesion nothng will happen and deleting the lock can w do directly

Anonymous said...

Hi Durga, thank you very much for a nice and descriptive blog.
Also,I would like to know the difference between SAP Lock (SM12) and Oracle Lock Monitor (DB01)?

Unknown said...

Yes u can delete the lock directly by using SM12, but before that you have check that is there any updataion is going or not using SM13 with that id.

Anonymous said...

Hi Dear,

There are very less chances for a girl to get into SAP basis. But it's not Impossible.
It just needs luck and good knowledge on the Subject.
Me myself being a a girl, i have struggled for 1 year and have joined as SAP Basis Consultant as Fresher.
My advice to you will be join as Fresher in SAP basis. So, that you can have real time experience. And after an year you can join any big firm and work there confidently.
Dont quit TRYING.. GOOD LUCK.

Anonymous said...

Hi dear, what package did you get joining as a fresher into basis?

Anonymous said...

it's not your concern!

Search this blog for other interesting articles

Please subscribe & activate link received to your email id to receive latest articles

Enter your email address:

Delivered by FeedBurner