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 do you implemtn Lock concept in Dialog Programing

Former Member
0 Likes
448

Hi Friends

How do you implement lock concept in a dialog Prgram when updating a custom table?

Any Help would be appericiated.

Thanks,

Rinky

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
425

Hi,

Steps.

1) Create a lock object for the custom table in SE11.

Go to SE11...Give the lock object name..Ex...EZ_TABLE_1..

Press create..Then give the table name..Then save and activate..

Then it will generate two function modules..ENQUEUE & DEQUEUE..

You can know FMs..By choosing..GOTO -> LOCK MODULES.

ENQUEUE is used to lock the record.

DEQUEUE is used to unlock the record.

2)

Before updating the custom table..

Call the ENQUEUE function module with the key values to lock the record ..

IF the return code (SY-SUBRC <> 0) is not equal to zero.. Then the record is already locked by another user.

If the return code is zero..Then the record is locked successfully...

Update the custom table for that record..

Unlock the record by calling the DEQUEUE FM.

Hope this helps..

THanks,

Naren

Hi Friends

How do you implement lock concept in a dialog Prgram when updating a custom table?

Any Help would be appericiated.

Thanks,

Rinky

2 REPLIES 2
Read only

Former Member
0 Likes
426

Hi,

Steps.

1) Create a lock object for the custom table in SE11.

Go to SE11...Give the lock object name..Ex...EZ_TABLE_1..

Press create..Then give the table name..Then save and activate..

Then it will generate two function modules..ENQUEUE & DEQUEUE..

You can know FMs..By choosing..GOTO -> LOCK MODULES.

ENQUEUE is used to lock the record.

DEQUEUE is used to unlock the record.

2)

Before updating the custom table..

Call the ENQUEUE function module with the key values to lock the record ..

IF the return code (SY-SUBRC <> 0) is not equal to zero.. Then the record is already locked by another user.

If the return code is zero..Then the record is locked successfully...

Update the custom table for that record..

Unlock the record by calling the DEQUEUE FM.

Hope this helps..

THanks,

Naren