Application Development 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: 

Locking a transaction??

Former Member
0 Kudos

Hi Experts

I have a question regarding lock objects.

Suppose I have one program in which I am using a transaction to do some specific work and while this program is running , I don't want anyone to access that transaction. Can i block the transaction using lock object?? If yes,then how to do it?? If not then how can i do it?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

check the following link:

http://sap-img.com/abap/how-to-lock-and-unlock-users.htm

Hope this helps.

Reward if helpful.

Regards,

Sipra

5 REPLIES 5

Former Member
0 Kudos

Hi Smith,

Lock objects are used to synchronize access to the same data by more than one program.

There are three types of locks:

Exclusive lock: The locked data can only be displayed or edited by a single user. A request for another exclusive lock or for a shared lock is rejected.

Shared lock: More than one user can access the locked data at the same time in display mode. A request for another shared lock is accepted, even if it comes from another user. An exclusive lock is rejected.

Exclusive but not cumulative: Exclusive locks can be requested several times from the same transaction and are processed successively. In contrast, exclusive but not cumulative locks can be called only once from the same transaction. All other lock requests are rejected.

Creating lock object

1)Go to SE11

2) select lockobject

3)give name starts eith EZ followed by the name of lock object.

2)Choose table

3)Add fields .

4)Save & Activate

Just see these links:

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

http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eeb2446011d189700000e8322d00/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/af/22ab01dd0b11d1952000a0c929b3c3/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eea5446011d189700000e8322d00/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eee6446011d189700000e8322d00/frameset.htm

Thanks,

Reward If helpful.

sreeramkumar_madisetty
Active Contributor
0 Kudos

Hi

Using Authorizations you can achive this.

<b>

Check SU03 Tcode.</b>

Regards,

Sreeram

Former Member
0 Kudos

Hi,

Yes u can do it.you can use ENQUEUE and DEQUEUE Function Modules in the program to lock and unlock the respective transaction.

Example: Function Module 'DEQUEUE_ALL' for unlocking.

Regards,

Padmam.

Former Member
0 Kudos

Hi,

check the following link:

http://sap-img.com/abap/how-to-lock-and-unlock-users.htm

Hope this helps.

Reward if helpful.

Regards,

Sipra

Former Member
0 Kudos

Hi Smith,

use the lock object FM

'ENQUEUE_ESRDIRE' and pass the program name of the tcode.

select program name from TSTC table by passing the tcode.

This way you can lock.

Thanks

eswar