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

LOCK OBJECT?

Former Member
0 Likes
976

Hi.

What is a Lock Object?

And what is its usage in SAP?

Thanks

8 REPLIES 8
Read only

Former Member
0 Likes
947

Hi,

Go thro' the link , this might help to understand the basics of Lock objects,

http://help.sap.com/saphelp_47x200/helpdata/en/a2/3547360f2ea61fe10000009b38f839/frameset.htm

Rgds,

Read only

0 Likes
947

http://help.sap.com/saphelp_di471/helpdata/EN/cf/21ea0b446011d189700000e8322d00/frameset.htm

how to lock and unlock object...

fm used...ENQUEUE_E_TABLE

ex...

*----


lock Table

CALL FUNCTION 'ENQUEUE_E_TABLE'

EXPORTING

tabname = table_name

EXCEPTIONS

foreign_lock = 1

system_failure = 2

OTHERS = 3.

*----


Unlock Table

CALL FUNCTION 'DEQUEUE_E_TABLE'

EXPORTING

tabname = table_name

refer for more....

Read only

Former Member
Read only

Former Member
0 Likes
947

Hi,

Lock object is used to prevent the locking of same DB at the same time by multiple users.

Please go through the below for more details:

http://help.sap.com/saphelp_nw04/helpdata/en/7b/f9813712f7434be10000009b38f8cf/content.htm

Rgds,

HR

Read only

Former Member
Read only

Laxmana_Appana_
Active Contributor
0 Likes
947

Hi,

Lock objects are used to lock the database table while making the modifications on the database table.

you can create your own lock objects using SE11.

if you create lock objects on any table system will create two function modules.

1.ENQUEUE....

2.DEQUEUE.....

first one is used to lock the table

second one used to removing lock on the table.

check this link :

http://help.sap.com/saphelp_40b/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm

Regards

Appana

Read only

Former Member
0 Likes
947

Hello,

This lock object facilitates synchronous process. That is suppose if you are changing the table entries, and simultaneously there might be several programs running in the background or by anything else which also does changes to the same table. In this case you can lock the table so that other program will not able to update/insert/ do any other operation unless or until your program executes successfully.

You can create lock objects for this purpose in transaction SE11. SAP by default create 2 function modules. One for locking ( Enqueue) and other for unlocking ( Dequeue ). You can call these function module in appropriate places in your program.

I hope this help. For more information you can check in help.sap.com.

Regs,

Venkat Ramanan N

Read only

Former Member
0 Likes
947

Hi,

<b>What is Lock Object?</b>

The R/3 System synchronizes simultaneous access of several users to the same data records with a lock mechanism . When interactive transactions are programmed, locks are set and released by calling function modules . These function modules are automatically generated from the definition of lock objects in the ABAP Dictionary.

<b>Structure of Lock object :</b>

The tables in which data records should be locked with a lock request are defined in a lock object together with their key fields. When tables are selected, one table (the primary table) is first selected. Further tables (secondary tables) can also be added using foreign key relationships.

<b>Lock Arguments:</b>

The lock argument of a table in the lock object consists of the key fields of the table. The lock argument fields of a lock object are used as input parameters in the function modules for setting and removing locks generated from the lock object definition. When these function

modules are called, the table rows to be locked or unlocked are specified by defining certain values in these fields. These values can also be generic. The lock argument fields therefore define which subset of the table rows should be locked.

<b>Lock Modes:</b>

The lock mode controls whether several users can access data records at the same time. The lock mode can be assigned separately for each table in the lock object. When the lock is set, the corresponding lock entry is stored in the lock table of the system for each table.

1) Exclusive lock

2) Shared Lock

3) Exclusive but not cumalative

Regards,

Sailaja.