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 create a lock object dynamically ?

Former Member
0 Kudos

Hi all,

I have a report with a selection screen having one parameter in which the user can put a table name(Custom table) and some other paremeters.Based on these parameters I need to delete records from table put on the selection screen.Before deeting I need to lock the table. As beforehand I dont know the table name how can I create lock object dynamically lock my table ?

Please suggest some idea...

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Firstly, put your table name into table DD25L-ROOTTAB. You'll get DD25L-VIEWNAME as a lock object.

Secondly, put VIEWNAME to table DD27S-VIEWNAME to extract all lock parameter.

This solution will applicable for table which has already created lock object.

In case you want to create lock object dynamically without manually create also, generate BDC for this matter is one idea.

Cheers,

Thanagit

10 REPLIES 10

Former Member
0 Kudos

use this fm

ENQUEUE_E_TABLE

кu03B1ятu03B9к

0 Kudos

But how to create the lock object dynamically? It is not possible to create lock object in SE11....

Former Member
0 Kudos

Firstly, put your table name into table DD25L-ROOTTAB. You'll get DD25L-VIEWNAME as a lock object.

Secondly, put VIEWNAME to table DD27S-VIEWNAME to extract all lock parameter.

This solution will applicable for table which has already created lock object.

In case you want to create lock object dynamically without manually create also, generate BDC for this matter is one idea.

Cheers,

Thanagit

Former Member
0 Kudos

Hi,

while u enter the table name on the selection screen run a bdc in the background creating Lock Object in SE11, Provide the table name to the BDC and create a lock object for that table..

now, pass the lock object created to the FM ENQUEUE_E_TABLE ...

the table is locked dynamically..

try this out

thanks

ravi

Edited by: Ravi Aswani on Mar 9, 2009 2:19 PM

Former Member
0 Kudos

have a look

[table|http://help.sap.com/saphelp_nwpi71/helpdata/en/af/22ab01dd0b11d1952000a0c929b3c3/content.htm]

Regards

Shashi

Former Member

shadow
Participant
0 Kudos

Peranandam
Contributor
0 Kudos

HI,

you dont need to create lock object for locking table entries. you can also lock table dynamically by using this FM VIEW_ENQUEUE.

Edited by: peranandam chinnathambi on Apr 10, 2009 3:07 PM

alejandro_bindi
Active Contributor
0 Kudos

The solution Thanagit proposes, retrieving the already existing lock object from DD tables is the only one which has sense.

There's no point in generating the lock object dynamically and then using it, since no other program (which could be using the same records to be deleted) will lock the table anyway...

Former Member