‎2010 Feb 02 5:34 AM
The delivery picking program is customizing. I used FM 'ENQUEUE_EVVBLKE' in order to lock the delivery no. before picking. I also used FM 'DEQUEUE_EVVBLKE' after the user finish picking the delivery. But the delivery still be locked if another user run the same program again. The return code of the FM 'ENQUEUE_EVVBLKE' is 2. That's why? Thanks!
The codes are as follows:
lock delivery
CALL FUNCTION 'ENQUEUE_EVVBLKE'
EXPORTING
MODE_LIKP = 'E'
MANDT = SY-MANDT
vbeln = v_vbeln
EXCEPTIONS
foreign_lock = 2
system_failure = 3.
*unlock delivery
CALL FUNCTION 'DEQUEUE_EVVBLKE'
EXPORTING
MODE_LIKP = 'E'
MANDT = SY-MANDT
VBELN = v_vbeln.
X_VBELN = ' '
_SCOPE = '3'
_SYNCHRON = ' '
_COLLECT = ' '
‎2010 Feb 02 6:47 PM
Hi,
put a break-point on CALL FUNCTION 'DEQUEUE_EVVBLKE' and check if it is always reached and if the value of v_vbeln is the same as at the point of calling FM 'ENQUEUE_EVVBLKE'. Also check if no 'ENQUEUE_EVVBLKE' is called after 'DEQUEUE_EVVBLKE' for the same v_vbeln. If these things are ok, try to call dequeue function module with SYNCHRON = 'X'. You can also check locks in transaction SM12 after call of DEQUEUEEVVBLKE.
Regards,
Adrian
‎2010 Feb 02 2:28 PM
‎2010 Feb 02 6:47 PM
Hi,
put a break-point on CALL FUNCTION 'DEQUEUE_EVVBLKE' and check if it is always reached and if the value of v_vbeln is the same as at the point of calling FM 'ENQUEUE_EVVBLKE'. Also check if no 'ENQUEUE_EVVBLKE' is called after 'DEQUEUE_EVVBLKE' for the same v_vbeln. If these things are ok, try to call dequeue function module with SYNCHRON = 'X'. You can also check locks in transaction SM12 after call of DEQUEUEEVVBLKE.
Regards,
Adrian
‎2010 Feb 02 8:22 PM
Hi,
You can try the following too:
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
MODE_RSTABLE = 'X'
TABNAME = 'EVVBLKE'.
CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
MODE_RSTABLE = 'X'
TABNAME = 'EVVBLKE'.
Regards,
Gilberto Li
‎2010 Jul 02 4:01 AM