2011 May 16 12:29 PM
Hi guys,
I want to check if
CALL FUNCTION 'ENQUEUE_was executed
meaning check that the block was already done , i know about the exception foreign_lock = 1 but for get that i need to execute iteh function and i dont want that, is there any other function or a table i could read which inform me about a block object status ??
thank you guys.
Edited by: José M. Sánchez on May 16, 2011 7:00 AM
2011 May 16 12:47 PM
no, there is no other way, you need to try to lock it then you know if its locked already.
2011 May 16 12:47 PM
no, there is no other way, you need to try to lock it then you know if its locked already.
2011 May 16 12:54 PM
...and if it was not locked before, then it is now locked by your ENQUEUE call, so you can immediately unlock it again via the corresponding DEQUEUE call to achieve your "check" functionality.
Thomas
2011 May 16 1:38 PM
Hi Thomas ,
thank you for answered me, yes I have thought about that solution, is just i believed that maybe someone else could maybe know some other solution .
tnxs.
Edited by: José M. Sánchez on May 16, 2011 8:08 AM
2011 May 20 3:18 PM
2024 Jan 15 1:41 PM
*&---------------------------------------------------------------------*
*& Report YRB_ENQUEUE_CHECK
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT yrb_enqueue_check.
DATA: g_belnr TYPE RBKP-BELNR .
DATA: g_gjahr TYPE RBKP-GJAHR
g_belnr = '5106289422'.
g_gjahr = '2024'.
CALL FUNCTION 'ENQUEUE_E_RBKP'
EXPORTING
belnr = g_belnr
gjahr = g_gjahr
_wait = 'X'
EXCEPTIONS
foreign_lock = 1
system_failure = 2.
IF sy-subrc = 0.
ENDIF.
DATA: lv_garg TYPE eqegraarg,
lt_enq TYPE STANDARD TABLE OF seqg3,
ls_enq TYPE seqg3.
CONCATENATE sy-mandt g_belnr g_gjahr '*' INTO lv_garg.
" Get Lock Records
CALL FUNCTION 'ENQUEUE_READ'
EXPORTING
gname = 'RBKP'
garg = lv_garg
guname = '*'
TABLES
enq = lt_enq.
BREAK-POINT.<br>Lock and lock check example