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 check lock on table or transaction

Former Member
0 Kudos

Hi All,

I am performing BDC recording for transaction CJR2. Before doing the call transaction i want to check if the transaction is already open.

I am using the fm 'enqueue_e_Table' and passing the tables CCSS and COSS (which are updated by thr transaction) .

But, even when the transaction is open in change mode, the function module does not give me foreign lock., it returns sy-subrc 0.

My requirement is i should not perform the BDC if the transaction is already open.Kindly help me in this.

Regards,

S.Subasree

4 REPLIES 4

vinod_vemuru2
Active Contributor
0 Kudos

Hi,

Try with below FM,

ENQUEUE_EKCCSSS

Before you call the BDC you need to dequeue with FM DEQUEUE_EKCCSSS.

You can keep a break point in this FM and see what values are being passed.

But BDC will do this validation for you. Messages are collected into messages table. So i don't think you need seperate validation for this.

Thanks,

Vinod.

0 Kudos

Hi,

There is a System fields SY-TCODE. Use this for your requirement.

Regards,

Surendar Reddy.

SuhaSaha
Advisor
Advisor
0 Kudos

Hello Subasree,

I am using the fm 'enqueue_e_Table' and passing the tables CCSS and COSS (which are updated by thr transaction)

The check you are performing here does not validate that the transaction is open. You are trying to check the DB locks but ideally the Db locks will be maintained when the SAP DB is actually updated & not when the trxn is opened.

Open CJR2, go to SM12 & check if lock entries are maintained against the user. I am sure you will find none.

You should undersatnd the difference between SAP Lock & DB lock. Check this SAP documentation on [SAP Lock Concept|http://help.sap.com/saphelp_nw04/Helpdata/EN/c2/2d7037ecc92a7ee10000009b38f8cf/frameset.htm].

BR,

Suhas

Edited by: Suhas Saha on Feb 15, 2010 11:03 AM

rvinod1982
Contributor
0 Kudos

Hi,

If the transaction code CJR2 is already open in change mode for a particular data, the BDC will not allow to update the same data in CJR2. I think there is no need to use separate fm to check whether the tocde is open in change mode.

Regards,

Vinod