06-15-2008 9:34 AM
Hi,
Could anyone please tell me how to use lock objects in coding.
Thanx in advance
06-15-2008 9:38 AM
Hi,
To lock objects use function module ENQUEUE_*
To unlock objects use function module DEQUEUE_*
Cheers.
...Reward if useful
06-15-2008 9:40 AM
06-15-2008 2:30 PM
Hi Vijay,
Locking concept is used to avoid data inconsistency. Let me explain with one simple example.
Suppose the bank balances of the customer is stored in some table say zbal. If the customer is withdrawing money from ATM and at the same time if the bank manager is viewing this customer balance details there may be data inconsistency because of time lag of data base update after cash withdrawel.
For this what we will do is we will use locking concept. So as soon as customer logs in to ATM machine we will lock this table zbal for this customer. So till he logs out no updates will happend to this table for this customer(i.e Row belongs to this customer). For this we have to create lock object for this table.
In SAP we can do it in SE11. When we create lock object 2 FMs will be created. ENQUEUE_tabname, DEQUEUE_tabname.
When customer logs in some program will be called. In this program first call FM ENQUEUE FM and at the end of the program call DEQUEUE FM.
Hope it is clear now.
Thanks,
Vinod.
06-15-2008 11:47 AM
Hi vijay,
this document may help you to get some understanding about lock concept in SAP:
[The SAP Lock Concept (BC-CST-EQ)|http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCSTEQ/BCCSTEQ_PT.pdf]
Regards,
Clemens