2010 Apr 20 2:42 AM
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
2010 Apr 20 4:06 AM
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
2010 Apr 20 6:48 AM
Hi...
Check transaction "SM12" for locked entries details.
Regards,
Lokeswari.
2010 Apr 20 6:59 AM
Check sy-subrc value after calling ENQUEUE function module related to LIKP.
Regards
Vinod
2010 Apr 20 11:55 PM
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
2010 Apr 21 12:26 AM
>
> 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,
2010 Apr 21 6:13 AM
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
2022 Jul 19 4:11 PM
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.