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_Query

Former Member
0 Likes
884

Hi

I want to know that do we need to create a Lock Object for any SAP Object or we can directly write ENQUE_* for the object?

I mean when I try to create a Lock Object I am asked an Access Key.

Why is it so?

Thank You

7 REPLIES 7
Read only

Former Member
0 Likes
816

Hi,

When you create a Lock Object in SE11 , automatically the ENQU* and DEQU* FM's gets created .

As for the Access key restriction contact your basis person for the same.

Read only

Former Member
Read only

Former Member
0 Likes
816

Hi,

if you want to use the Lock concept, the Lock object should be there, you can create the lock object starting with Z or Y. and the ENQUEUE and DEQUEUE function modules will be genareted.

or else, you can use the below way..

i_varkey TYPE rstable-varkey,
i_tabname TYPE rstable-tabname VALUE 'ZGLACC'.
CONCATENATE sy-mandt i_final-vbeln 
INTO i_varkey.

 CALL FUNCTION 'ENQUEUE_E_TABLEE'
      EXPORTING
           tabname = i_tabname
           varkey  = i_varkey.

Regards

Sudheer

Read only

0 Likes
816

Hi Sudheer

Can you please tell the difference between the two methods specified by you.

1. Create Lock Object for the table from SE11 and use the Enqueue and Dequeue function modules of that lock object.

2. Do NOT create a Lock Object for the table and use the function modules ENQUEUE_E_TABLEE and DEQUEUE_E_TABLEE, passing the table name to them.

I opened the table in Edit Mode in SM30 and then tried using both these methods above.

The first method allowed me to update the table, even though the table was open in edit mode in SM30.

The second method did NOT allow me to update the table. It gave an error that the table is already locked.

Please shed some light on this.

Regards

Anshuman

Read only

Former Member
0 Likes
816

Hi,

if you are trying to create lock object for SAP

tables you need access key.

when lockobject is created using se11

by default enqueue_<lock objectname>

dequeue_<lock objectname> are created

by SAP.

you can create at table level or row level lock.

check out whether ant standard lock objects are

already defined for your table in se11 and use

the same for your requirement.

Regards,

amole

Read only

Former Member
0 Likes
816

Hi subhash,

1. I mean when I try to create a Lock Object I am asked an Access Key.

Thats bcos u are directly creating the

lock object with the name starting from

Z or Y.

<b>(INSTEAD use EZabc or EYabc

ie. E should be the first letter

Z/Y should be the second letter

then anything..)</b>

2.

want to know that do we need to create a Lock Object for any SAP Object or we can directly write ENQUE_* for the object?

Yes, we need to create.

Create a lock object,

will automatically create TWO FMs

for Dequeue/enqueue,

which we have to use in our abap code.

regards,

amit m.

Read only

Former Member
0 Likes
816

hi,

first u have to create lock object using<b> SE11</b> tcode.

then it automatically create its <b>ENQUE</b> And <b>DEQUE</b> Function Module for this object and then u can use that in your Program.