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

Hi,

I have a report where I am updating the pickup date and time for a shipment in LIKP using FM 'WS_DELIVERY_UPDATE_2'.

The requirement is , I want to check each delivery before updating LIKP.

i.e if some user has opened a delivery in VL02n (lock object), then those I need to find those object before calling the FM 'WS_DELIVERY_UPDATE_2'

Any idea how to achieve this?

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,074

Hi

You dont need to worry about this, the FM has already taken care about it.

Just execute this FM and in another Session open delivery document you will get the Message.

in SE37 Just search for ENQUE key word and you will find this FM

574       CALL FUNCTION 'ENQUEUE_EVVBLKE' "  At line number 574
               EXPORTING
                    vbeln          = p_vbak-vbeln
               EXCEPTIONS
                    foreign_lock   = 1 " Means P_VBAK-VBELN is locked by another User
                    system_failure = 2.

Cheerz

Ram

5 REPLIES 5
Read only

Former Member
0 Likes
1,075

Hi

You dont need to worry about this, the FM has already taken care about it.

Just execute this FM and in another Session open delivery document you will get the Message.

in SE37 Just search for ENQUE key word and you will find this FM

574       CALL FUNCTION 'ENQUEUE_EVVBLKE' "  At line number 574
               EXPORTING
                    vbeln          = p_vbak-vbeln
               EXCEPTIONS
                    foreign_lock   = 1 " Means P_VBAK-VBELN is locked by another User
                    system_failure = 2.

Cheerz

Ram

Read only

0 Likes
1,074

Hello Ram,

Yes you are right , the FM already takes care of this. But my requirement is to find out the delivery's which are locked before I update the table and I want to avoid the error msg which is displayed when the object is locked.

Any idea how it can be achieved?

thanks

Quresh

Read only

0 Likes
1,074

Hi,

Then use this FM

Put a break point at the FM 'ENQUEUE_EVVBLKE'

and open a billing document in VL02N and in other session execute the Same

document number with the FM

call function 'ENQUEUE_EVVBLKE'
exporting
  vbeln          = if_delivery " Your Delivery Document Number
exceptions
  foreign_lock   = 2 " Means already locked by other User
the user ID is given back to you in "SY-MSGV
" and Give your Own message
  system_failure = 3.

Cheerz

Ram

Read only

0 Likes
1,074

Thanks Ram,

Read only

0 Likes
1,074

Hi All,

Looking into the import parameters, the lock objects can only lock specific records, not the whole table. I want to prevent insertion of records while the program is selecting from the table. Is there a way to do that? Thanks.

Regards,

Joyie