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
585

Hi all

what is a lock object and

how to create a lock object

please tell me in detail

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
552

Hi,

Lock object is used to avoid the same data modifications at a time different users. Locking can be done record level or table level

Creating lock object

-


1)Go to SE11--> select lockobject --> give name starts eith EZ<name>.

2)Choose table --> for e.g. MARA

3)Add fields (Default all key fields).

4)Save & Activate

Regards

Bhupal Reddy

5 REPLIES 5
Read only

Former Member
0 Likes
552

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.

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.

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

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

http://www.sap-img.com/abap/type-and-uses-of-lock-objects-in-sap.htm

Read only

Former Member
0 Likes
552

Hi,

If your application will change value in a DB table then you must lock the table (or at least the modified entry) against concurrent changes. If you do not lock and two user concurrently change the same table entry then the table entry will contain only the changes of the user that saved the data last.

If, for example, you change a debitor (XD02) and call a second screen and want to change the same debitor again the system will tell you that this debitor is already locked.

Therefore, locking is a crucial part of any application that changes DB table entries.

Regards,

Pankaj Singh.

,

Read only

Former Member
0 Likes
553

Hi,

Lock object is used to avoid the same data modifications at a time different users. Locking can be done record level or table level

Creating lock object

-


1)Go to SE11--> select lockobject --> give name starts eith EZ<name>.

2)Choose table --> for e.g. MARA

3)Add fields (Default all key fields).

4)Save & Activate

Regards

Bhupal Reddy

Read only

Former Member
0 Likes
552

Hi,

types of locks:

Read lock (shared lock)

protects read access to an object. The read lock allows other transactions read access but not write access to the locked area of the table.

Write lock (exclusive lock)

protects write access to an object. The write lock allows other transactions neither read nor write access to the locked area of the table.

Enhanced write lock (exclusive lock without cumulation)

works like a write lock except that the enhanced write lock also protects from further accesses from the same transaction.

Links:

http://help.sap.com/saphelp_47x200/helpdata/en/37/a2e3ae344411d3acb00000e83539c3/frameset.htm

regards,

pankaj singh

Read only

Former Member
0 Likes
552

HI

Lock objects are used to synchronize access to the same data by more than one program.

There are three types of locks:

Exclusive lock: The locked data can only be displayed or edited by a single user. A request for another exclusive lock or for a shared lock is rejected.

Shared lock: More than one user can access the locked data at the same time in display mode. A request for another shared lock is accepted, even if it comes from another user. An exclusive lock is rejected.

Exclusive but not cumulative: Exclusive locks can be requested several times from the same transaction and are processed successively. In contrast, exclusive but not cumulative locks can be called only once from the same transaction. All other lock requests are rejected.

Creating lock object

1)Go to SE11

2) select lockobject

3)give name starts eith EZ followed by the name of lock object.

2)Choose table

3)Add fields .

4)Save & Activate

Just see these links:

<a href="http://help.sap.com/saphelp_nw04/helpdata/en/a2/3547360f2ea61fe10000009b38f839/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/a2/3547360f2ea61fe10000009b38f839/frameset.htm</a>

<a href="http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eeb2446011d189700000e8322d00/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eeb2446011d189700000e8322d00/frameset.htm</a>

<a href="http://help.sap.com/saphelp_nw04/helpdata/en/af/22ab01dd0b11d1952000a0c929b3c3/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/af/22ab01dd0b11d1952000a0c929b3c3/frameset.htm</a>

<a href="http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eea5446011d189700000e8322d00/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eea5446011d189700000e8322d00/frameset.htm</a>

<a href="http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eee6446011d189700000e8322d00/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eee6446011d189700000e8322d00/frameset.htm</a>

Regards,

Gunasree.