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

lock objects.

Former Member
0 Likes
675

1. i want to create lock object to a custom table, that is my requirement. but system does not allows me

even i named my object name with starting E letter.?

can any one give to me where the problem comes.

5 REPLIES 5
Read only

Sm1tje
Active Contributor
0 Likes
654

What is the exact error message? Normally it should start with EZZ...

Read only

Former Member
0 Likes
654

hi,

The lock object name starts with EZ* or EY*,

1. Go to SE11

2. Give the lock object name EZJKAK(lock object name start with EZ) and click 'Create' Button.

3. Enter the short description,Table namejkak, lock mode and key fields which is used to lock the entry.

4. Save and activate, it will generate 2 FM.

Ex:

DEQUEUE_EZJKAK Release lock on object EZJKAK

ENQUEUE_EZJKAK Request lock for object EZJKAK

In your program,

1. First loop the table.

2. call the FM 'ENQUEUE_EZJKAK' to lock.

3. Update the dB.

4. Release the lock using DEQUEUE_EZJKAK.

endloop.

DEQUEUE_ALL this FM will release all the lock.

please check the link,

http://help.sap.com/saphelp_nw04/helpdata/EN/c2/2d7037ecc92a7ee10000009b38f8cf/content.htm

http://www.sap-img.com/abap/type-and-uses-of-lock-objects-in-sap.htm

http://help.sap.com/saphelp_nw70/helpdata/en/cf/21eef3446011d189700000e8322d00/content.htm

Yogesh N

Read only

Former Member
0 Likes
654

Hi Friend ,

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.

- Read Lock(Shared Locked)

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

- Write Lock(exclusive lock)

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

the locked area of the table.

- Enhanced write lock (exclusive lock without cumulating)

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.

Use: 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.

Example: 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.

Technicaly:

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.

Girish

Read only

matt
Active Contributor
Read only

Former Member
0 Likes
654

Hi karthik,

could you tell us what error are you exactly getting?

Luck,

Bhumika