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

SAP Table Lock object

Former Member
0 Likes
641

Hi,

I am doing a Mass Material group change project where the existing Material groups have to be changed to a new one in all the related tables.

And i would be doing a direct update programs.

So before doing this, in my program i would like to know if the table is Locked if not do a DB lock and then carry on with the table updates.

I see that i can find the SAP Lock objects for the table from DD025L table and then use it in my program i.e FM: ENQUEUE_"Lockobject".

But not all tables have LOck objects.

Is there any other way to find if any of the table is locked and use the Lock mechanism. (maybe a common way for all tables)

Regards,

Mid.

3 REPLIES 3
Read only

Former Member
0 Likes
559

Hi Midhun,

Check the tcode SM12 which gives the list of all tables and the records(argument) which are locked........

this tcode uses the FM ENQUEUE_READ and v can also use it if v need to find the locked tables in our z-prog.......

Cheers,

Jose.

Read only

0 Likes
559

Thanks Jose,

Using ENQUEUE_READ we can read Lock entries, is there any common FM to Lock the table at Client level?

or should we use only the respective Lock object FM for the corresponsing table

Mid.

Read only

0 Likes
559

Hi,

I think there is no such generic std FM......n is better to use lock objects fms...........

lock across clients/lock for a client is determined by the table's mandt field of the table locked i.e if its a cross client table it is locked across the clients else only on dat client..

Cheers,

Jose.