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 objects

Former Member
0 Likes
662

i am trying to lock mara table for that i created lock object.I am unableto use the created lock object in se38 if i am pressing f4 values this created object is not found in it.What might be the reason for it ?plz explain me .

6 REPLIES 6
Read only

Former Member
0 Likes
621

Hi!

Have you tried to use ENQUEUE_MARA lock object?

Regards

Tamá

Read only

Former Member
0 Likes
621

Hi,

When you create a lock object System automatically creat two function module.

1. ENQUEUE_<Lockobject name>. to insert the object in a queue.

2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above FM.

You have to use these function module in your program.

http://help.sap.com/saphelp_nw04s/helpdata/en/af/22ab01dd0b11d1952000a0c929b3c3/content.htm

Regards

Sudheer

Read only

Former Member
Read only

Former Member
0 Likes
621

Hi,

Lock object can create in SE11. For more information check the following link:

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

Regards,

Bhaskar

Read only

Former Member
0 Likes
621

hi pinky,

I think u must have not taken enqueue n dequeue....ie; locking the objects n unlocking the objects.

just check it out.

with regards,

madhuri.

Read only

Former Member
0 Likes
621

hi Pinky,

go through this info.

Lock Objects are used to synchronize access to the same data by

more than one user. Function modules that can be used in

application programs are generated from the definition of a lock

object in the ABAP Dictionary.

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.

Structure of a Lock Object

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.

Lock Arguments

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.

Data Dictionary/ Lock Objects

The simplest case of a lock object consists of exactly one

table and the lock argument of the table is the primary key of

this table. Several tables can also be included in a lock

object. A lock request therefore can lock an entire logical

object, and not only a record of a table. Such a logical object

can be for example a document comprising an entry in a

header table and N entries in a positiontable.

Lock Mode

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.

Access by more than one user can be synchronized in the

following ways:

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.

1> Select object type Lock object in the initial screen of the ABAP

Dictionary, enter an object name and choose Create.

The name of a lock object should begin with an E (Enqueue).

The maintenance screen for lock objects is displayed.

2> Enter an explanatory short text in the field Short text.

You can then use the short text to find the lock object at a later

time, for example with the R/3 Repository Information System.

3> Enter the name of the primary table of the lock object.

All other tables in the lock object must be linked with the

primary table using foreign keys.

4> Select the lock mode of the primary table in the field below

it.

The lock mode is used as the default value for the

corresponding parameters of the function modules generated

from the lock object.

5> Choose Add if you want to lock records in more than one

table with the lock object.

A list of all the tables linked with the primary table using valid

foreign keys is displayed. Select the appropriate table. The lock

mode of the primary table is copied as lock mode. You can

change this setting as required, for example you can assign the

lock mode separately for each table.

Similarly, you can add a table linked with the secondary table

just added with foreign keys. To do this, place the cursor on

the name of the secondary table and choose Add.

If no lock mode is assigned to a table, no lock is set for the

entries in this table when the generated function modules are

called. You should not assign a lock mode if a secondary table

was only used to define a path between the primary table and

another secondary table with foreign keys.

6> Save your entries.

A dialog box appears in which you have to assign the lock

object a development class.

7> You can define whether the function modules generated from

the lock object should be RFC-enabled on the Attributes tab

page. If you set the Allow RFC flag, the generated function

modules can be called from within another system with Remote

Function Call. If you permit Remote Function Calls for an

existing lock object, you must ensure that the generated

function modules are called from within an ABAP program with

parameters appropriate for the type. You should therefore check

all programs that use the associated function modules before

activating the lock object with the new option.

8> Choose Activate.

When you create a lock object System automatically creat two function module.

1. ENQUEUE_<Lockobject name>. to insert the object in a queue.

2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above FM.

You have to use these function module in your program.

http://help.sap.com/saphelp_nw04s/helpdata/en/af/22ab01dd0b11d1952000a0c929b3c3/content.htm

**********Rewards some points.

Rgds,

P.Naganjana Reddy