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 concept

Former Member
0 Likes
504

Hi ,

We want protect/lock a field so that only selected people can change the value while others can only read. How to set the authorizations?

Thanks ,

Praveen.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
482

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.

Check this link..u have detailed information.

http://www.abapprogramming.blogspot.com/2007/08/lesson-47-sap-lock-concept.html

http://abapcode.blogspot.com/2007/09/r3-lock-concept.html

3 REPLIES 3
Read only

Former Member
0 Likes
483

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.

Check this link..u have detailed information.

http://www.abapprogramming.blogspot.com/2007/08/lesson-47-sap-lock-concept.html

http://abapcode.blogspot.com/2007/09/r3-lock-concept.html

Read only

Former Member
0 Likes
482

Hi,

You may use the ENQUEUE/DEQUEUE mechanisms for this.

Regards,

Renjith Michael.

Read only

Former Member
0 Likes
482

Hi,

Create an authorization object for change mode. Loop at screen in the user exit and set input to 0. Check the user based on sy-uname and the authorization. Decide whether input should be 0 or 1.

Reward points if found helpfull...

Cheers,

Chandra Sekhar.