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
1,009

when we create the lock object two FM are created enqueue and dequeue.

there is one parameter _SCOPE , it passes the lock object to update program.

what is mean by update program ? how it works?

regards

martin

1 ACCEPTED SOLUTION
Read only

former_member404244
Active Contributor
0 Likes
901

Hi,

i didn't ahve the code,but we can call directly in our program,by using pattern button as we do for FM.

call function 'Enqueue_<lockobjectname>

call function 'DEQUEUE_<lockobjectname>.

For dequeue FM u neednot pass any parameter,but for enqueue u need to pass.

regards,

nagaraj

8 REPLIES 8
Read only

Former Member
0 Likes
901

update program is used to update the data to sap tables

Read only

jayanthi_jayaraman
Active Contributor
Read only

former_member404244
Active Contributor
0 Likes
901

Hi,

reagrding _scope parameter.

_SCOPE = 1: The lock is not sent to the update program. The lock is removed when the transaction is ended.

_SCOPE = 2: The lock is sent to the update program. The update program is responsible for removing the lock. The dialog program which requested the lock no longer has an influence on the lock behavior. This is the standard setting for the ENQUEUE function module.

_SCOPE = 3: The lock is also sent to the update program. The lock must be removed in both the dialog program and by the update program. This is the standard setting for the ENQUEUE function module.

Regards,

NAGARAJ

Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
901

Hi Martin,

The below link gives a detailed overview of SCOPE :

http://help.sap.com/saphelp_nw04/helpdata/en/23/edae617ba64e85bd4997f25c77eb1f/frameset.htm

Hope this helps

sandeep

Read only

Former Member
0 Likes
901

Hi Martin,

Lock Objects are basically created to ensure consistency while data is entered/changed in a table.

So the update program is the one which is updating the entries in a table. It could be the standard table maintenance generator , some custom function module or some custom/standard report which updates the data in a table.

Do let me know if you need any other details.

Regards,

Chetan.

PS: Reward points if this is helpful.

Read only

0 Likes
901

after activating the lock object , the 2 FM are generated , how we can use these FM in our code. do u have any code.....

regards

martin

Read only

Former Member
0 Likes
901

Hi martin,

1. _SCOPE is useful / comes into picture,

only if

we are using Update routines - Update FMS

in our main program.

2. from help.

3.

you can determine whether a lock should be transferred to the update routine if one is called.

If _SCOPE has the value '1', the lock remains with the the ordering transaction. If _SCOPE has the value '2', the lock can pass to the update routine. Finally, if the parameter has the value '3', two locks of the same kind will be generated, one of which passes to an update routine when one is called.

By calling the DEQUEUE module, a transaction can explicitly release a lock which it holds. The lock parameter and lock mode must be supplied with the same value as for calling the ENQUEUE module. If the parameter _SCOPE has the value '1', only one lock is released which cannot pass to an update routine. If the parameter has the value '2', only one lock is released which can pass to the update program. Finally, if the parameter has the value '3', both locks can be released. Note however that a transaction can release neither a lock which has already been transferred to the update program, nor a lock which is held by another transaction.

regards,

amit m.

Read only

former_member404244
Active Contributor
0 Likes
902

Hi,

i didn't ahve the code,but we can call directly in our program,by using pattern button as we do for FM.

call function 'Enqueue_<lockobjectname>

call function 'DEQUEUE_<lockobjectname>.

For dequeue FM u neednot pass any parameter,but for enqueue u need to pass.

regards,

nagaraj