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: 

Regarding lock objects

Former Member
0 Kudos

Hi,

Could anyone please tell me how to use lock objects in coding.

Thanx in advance

4 REPLIES 4

Former Member
0 Kudos

Hi,

To lock objects use function module ENQUEUE_*

To unlock objects use function module DEQUEUE_*

Cheers.

...Reward if useful

0 Kudos

could you please give me one scenario.

0 Kudos

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.

Clemenss
Active Contributor
0 Kudos

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