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: 

How to check lock entries?

Former Member
0 Kudos
18,324

Hi all,

Im working on a custom smartform to print a smartform for a particular batch no(for which i have no of deliveries/handling units) mainatined in a custom table .After this custom smartform ,2-3 proceeding /trailing smartform outputs(for the same batch) will be called.Now In the driver program,after fetching all the data and before calling my smartform,I need to check whether all trailing outputs for the released batch are completed and stapled to the spool.To ensure this,I need to check no locks exists for the Delivery/ HU being processed.

Now how do I check if there are any locks on any of the deliveries which exist in the batch ID for which my smartform will be called?

Any inputs will be highly appreciated.

Thanks.

BR,

Andy

7 REPLIES 7

Former Member
0 Kudos
4,638

Hello,

Put break-points at different points in your program flow and execute the program. Now use SM12 for the user and check the locks when the program stops at break-points.

Thanks,

Venu

Former Member
0 Kudos
4,638

Hi...

Check transaction "SM12" for locked entries details.

Regards,

Lokeswari.

Former Member
0 Kudos
4,638

Check sy-subrc value after calling ENQUEUE function module related to LIKP.

Regards

Vinod

Former Member
4,638

Hi,

Use the FM- ENQUEUE_READ which gives all the entries which are locekd at that moment. In the table entries which is return from the FM, search for ur required data. If you are successful in reading the entry then the object is still locked otherwise it is unlocked.

Regards,

Naveen

Former Member
0 Kudos
4,638

>

> Hi all,

>

> Im working on a custom smartform to print a smartform for a particular batch no(for which i have no of deliveries/handling units) mainatined in a custom table .After this custom smartform ,2-3 proceeding /trailing smartform outputs(for the same batch) will be called.Now In the driver program,after fetching all the data and before calling my smartform,I need to check whether all trailing outputs for the released batch are completed and stapled to the spool.To ensure this,I need to check no locks exists for the Delivery/ HU being processed.

>

> Now how do I check if there are any locks on any of the deliveries which exist in the batch ID for which my smartform will be called?

>

> Any inputs will be highly appreciated.

>

> Thanks.

>

> BR,

> Andy

Hi Andy,

First you will need to find which Lock Object it uses when Delivery / HU are being processed. so when processing these delivery put a break point in the main program so that it stops the process while locks are engaged. Then go to sm12and find out which Lock Objects & Table it is engaging.

Once you get that, the FM would be Enqueue_lock Object

Hope this helps.

Cheers,

Former Member
0 Kudos
4,638

Hi,

Check the lock object EVVBLKE. Call the below dequeue function module to check whether a delivery number is locked.

CALL FUNCTION 'ENQUEUE_EVVBLKE'
 EXPORTING
   MODE_LIKP            = 'E'
   MANDT                = SY-MANDT
   VBELN                = <delivery Number>
 EXCEPTIONS
   FOREIGN_LOCK         = 1
   SYSTEM_FAILURE       = 2
   OTHERS               = 3
          .
IF sy-subrc <> 0.
  delivery is locked.
else.
  delivery is not locked.  
ENDIF.

Regards

Vinod

0 Kudos
4,638

Hi Vinod,

Small doubt though,

Above code is it going to only check if the Delivery locked or will it also lock the delivery.

Regards,

Pruthvi.