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: 

How to lock a transaction programatically

Former Member
0 Kudos

My problem is when i'm doing bdc if transaction is locked by other persons after the session it is shoing error message no records updated.

The program should check before the population it self and should give message that transaction is locked.

Thanks in advance,

prssastry.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Look for the lock object associated with that transaction and check to see if its locked before proceeding with the BDC.

Further help on lock entries:

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

Hope this helps.

Sudha

9 REPLIES 9

Former Member
0 Kudos

Look for the lock object associated with that transaction and check to see if its locked before proceeding with the BDC.

Further help on lock entries:

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

Hope this helps.

Sudha

0 Kudos

Hi sudha ,

where to find out the lock object associated with the transaction.

0 Kudos

Easiest way would be to go into the transaction in the change mode, and in another session, open SM12. It should reflect the lock entry there. Click on the name and select 'Details' (or double click on the line). The resulting popup will have the name of the Lock object.

You can then use the ENQUEUE fm to check if the object is already locked.

Hope this helps.

Sudha

Former Member
0 Kudos

hi

use endque

deque function modules

praveen

Former Member
0 Kudos

If ur BDC changing any Documents then u can lock , otherwise u cannt lock ?

byusuing

ENQUEUE*

Regards

Prabhu

Former Member
0 Kudos

hi prssastry,

when u create a lock object u will see two fm's automatically created. One is enqueue another one is dequeue.

Enqueue ---> used to set the lock.

Dequeue-----> Release the lock.

Regards....

Arun.

Reward points if useful.

Former Member
0 Kudos

Hi Sastry,

As per my knowledge we can lock tables using Enqueue and Unlock them using DEQUEUE.

But We cannot lock Transactions within the program, So better try locking the individual tables used in the particular transaction.

Otherwise, you cam lock the Transaction outside the program using SM01.

Hope this resolves your query.

Reward all the helpful answers.

Regards

Former Member
0 Kudos

Hi

To lock the complete program u can use function module

ENQUEUE_ESFUNCTION

Vijay
Active Contributor
0 Kudos

hi