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: 

Lock records in customized table for deletion

colin_cheong
Contributor
0 Kudos

Hi SAP Guru,

I need to lock a customized tables with sets of records to delete with similiar primary keys.

Is there a standard SAP function that allow me to feed in the table key and keys and it would does the locking?

what about the unlocking function too?

Thanks

1 ACCEPTED SOLUTION
2 REPLIES 2

varma_narayana
Active Contributor
0 Kudos

Hi Colin..

To Lock the Entries in any Table you have to Use Lock Objects:

Steps:

Tcode SE11 - Creating Lock Object on the Custom Table.

Lock Object Name: EZabc.

Primary Table : <Your Custom table>.

Activate the Lock Object.

Now the System Generates 2 Function Modules.

ENQUEUE_<LOCK OBJ>. "To lock the records

DEQUEUE_<LOCK OBJ>. "To unlock the Records

like ....

ENQUEUE_EZABC.

DEQUEUE_EZABC.

In your Program You have to Call these two FMs.

<b>Reward if Helpful</b>