2007 Feb 20 12:00 AM
Hi Friends
How do you implement lock concept in a dialog Prgram when updating a custom table?
Any Help would be appericiated.
Thanks,
Rinky
2007 Feb 20 12:13 AM
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
2007 Feb 20 12:07 AM
Hi,
Please check this links perhaps they may help.
http://help.sap.com/saphelp_nw04s/helpdata/en/41/7af4c5a79e11d1950f0000e82de14a/content.htm
http://help.sap.com/saphelp_nw04s/helpdata/en/41/7af4c8a79e11d1950f0000e82de14a/content.htm
Regards,
Ferry Lianto
2007 Feb 20 12:13 AM
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
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |