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

How to lock a transaction programatically

Former Member
0 Likes
1,261

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
Read only

Former Member
0 Likes
1,226

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
Read only

Former Member
0 Likes
1,227

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

Read only

0 Likes
1,226

Hi sudha ,

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

Read only

0 Likes
1,226

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

Read only

Former Member
0 Likes
1,226

hi

use endque

deque function modules

praveen

Read only

Former Member
0 Likes
1,226

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

byusuing

ENQUEUE*

Regards

Prabhu

Read only

Former Member
0 Likes
1,226

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.

Read only

Former Member
0 Likes
1,226

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

Read only

Former Member
0 Likes
1,226

Hi

To lock the complete program u can use function module

ENQUEUE_ESFUNCTION

Read only

Vijay
Active Contributor
0 Likes
1,226

hi