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

Former Member
0 Likes
2,017

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

Former Member
0 Likes
1,566

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

Former Member
0 Likes
1,566

use this fm

ENQUEUE_E_TABLE

кu03B1ятu03B9к

Read only

0 Likes
1,566

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

Read only

Former Member
0 Likes
1,567

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

Read only

Former Member
0 Likes
1,566

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

Read only

Former Member
0 Likes
1,566

have a look

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

Regards

Shashi

Read only

Former Member
Read only

shadow
Participant
0 Likes
1,566
Read only

Peranandam
Contributor
0 Likes
1,566

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

Read only

alejandro_bindi
Active Contributor
0 Likes
1,566

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...

Read only

Former Member
0 Likes
1,566