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

locking methods

Former Member
0 Likes
973

hi

what are the locking tech available in SAP

explain each one

5 REPLIES 5
Read only

Former Member
0 Likes
833

Hi

Lock objects are use in SAP to avoid the inconsistancy at the time of data is being insert/change into database.

SAP Provide three type of Lock objects.

- <b>Read Lock(Shared Locked)</b>

protects read access to an object. The read lock allows other transactions read access but not write access to

the locked area of the table

- <b>Write Lock(exclusive lock)</b>

protects write access to an object. The write lock allows other transactions neither read nor write access to

the locked area of the table.

- <b>Enhanced write lock (exclusive lock without cumulating)</b>

works like a write lock except that the enhanced write lock also protects from further accesses from the

same transaction.

You can create a lock on a object of SAP thorugh transaction SE11 and enter any meaningful name start with EZ Example EZTEST_LOCK.

<b>Use:</b> you can see in almost all transaction when you are open an object in Change mode SAP could not allow to any other user to open the same object in change mode.

<b>Example:</b> in HR when we are enter a personal number in master data maintainance screen SAP can't allow to any other user to use same personal number for changes.

<b>Technicaly:</b>

When you create a lock object System automatically creat two function module.

1. ENQUEUE_<Lockobject name>. to insert the object in a queue.

2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above FM.

You have to use these function module in your program.

Hope this will give a basic idea.

Kindly go through this <b>SAP help</b> link:

http://help.sap.com/saphelp_47x200/helpdata/en/a2/3547360f2ea61fe10000009b38f839/frameset.htm

Also, you can find more info in the following links:

best regards,

Thangesh

Read only

Former Member
0 Likes
833

Hi,

Here is the perfect link for the SAP Locking Concept

http://help.sap.com/saphelp_nw04s/helpdata/en/c2/2d7037ecc92a7ee10000009b38f8cf/frameset.htm

Regards

Sudheer

Read only

Former Member
0 Likes
833

Hi

<b>Lock Objects</b>

Lock object concept

Lock modes

Creating a lock object (example)

Lock object sample code

SAP data dictionary provides you with a locking mechanism to synchronize simultaneous data access by different users.

Lock objects are created in SE11.

Customer lock objects must begin with EY or EZ .

Three possible lock modes exist for lock objects.

<b>lock mode</b>

Lock mode E: This sets a lock for changing data for single user. This lock can be accumulated.

Lock mode X: This mode is used like mode E for changing data. The only technical difference from mode E is that the respective lock does not allow accumulation.

Lock mode S: This mode ensures that data displayed in your program cannot be changed by other users during the entire display time. Here you do not want to change the data yourself (allows read only access for data).

<b>Creating Lock object</b>

Enter lock object name beginning with EY or EZ

and hit create.

Enter table names containing data records that should be locked and the lock mode.

The primary keys of the specified tables are automatically selected as lock parameters.

To set a lock in the application program

call a function module ENQUEUE_<LOCK_OBJECT>.

For our example, it would be ENQUEUE_EZMARA.

To release the lock in the application program

call a function module DEQUEUE_<LOCK_OBJECT>.

For our example, it would be DEQUEUE_EZMARA.

Refer the code executed by user (say abap1) for

matnr = ’000000000000000012’.

If another user (say abap2) tries to access the same data i.e. matnr = ‘000000000000000012’,via a program or a transaction it would deny him read or write access.

reward if usefull

Read only

Former Member
0 Likes
833

please go through this link ... you will learn how to implement the Lock Obects for an Table .

<a href="http://help.sap.com/saphelp_nw04s/helpdata/en/af/22ab01dd0b11d1952000a0c929b3c3/content.htm">http://help.sap.com/saphelp_nw04s/helpdata/en/af/22ab01dd0b11d1952000a0c929b3c3/content.htm</a>

the below link is for locking methods of the User

<a href="http://www.sap-img.com/basis/different-methods-to-lock-or-unlock-sap-users.htm">http://www.sap-img.com/basis/different-methods-to-lock-or-unlock-sap-users.htm</a>

Reward Points if it is usefull .....

Girish