‎2007 Dec 06 8:36 AM
Hi friends,
please look into the following code
DATA : lw_time TYPE t,
lw_wait_time TYPE t VALUE '001000',
lw_date TYPE d,
lw_uname LIKE sy-msgv1.
CLEAR: lw_time, lw_date.
Get cumulative total for condition record
Lock the table first; unlock takes places in USEREXIT_SAVE_DOCUMENT:
CALL FUNCTION 'ENQUEUE_EZ_QUANT'
EXPORTING
mode_zsd_quotas_quant = 'E'
mandt = sy-mandt
knumh = xkomv-knumh
X_KNUMH = ' '
_SCOPE = '2'
_wait = 'X'
_COLLECT = ' '
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
Try to set the lock on the record for next 10 minutes.
If still you don't then raise the error message.
GET TIME.
To add 10 minutes to the existing time, we can use the following
function module 'DIMP_ADD_TIME'
CALL FUNCTION 'DIMP_ADD_TIME'
EXPORTING
iv_starttime = sy-uzeit
iv_startdate = sy-datum
iv_addtime = lw_wait_time
IMPORTING
ev_endtime = lw_time
ev_enddate = lw_date.
WHILE sy-uzeit LT lw_time.
CALL FUNCTION 'ENQUEUE_EZ_QUANT'
EXPORTING
mode_zsd_quotas_quant = 'E'
mandt = sy-mandt
knumh = xkomv-knumh
X_KNUMH = ' '
_SCOPE = '2'
_wait = 'X'
_COLLECT = ' '
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc = 0.
CLEAR lw_time.
EXIT.
ENDIF.
ENDWHILE.
IF sy-uzeit >= lw_time AND sy-subrc NE 0.
MOVE sy-msgv1 TO lw_uname.
MESSAGE e064(zsdsls) WITH
'User' lw_uname 'is locking the table ZSD_quant.
ENDIF.
ENDIF.
......................
the problem here is i am not getting the error message when i run the transacton VA02 and wait for 10minutes . But when i run VA02 ,debug and reach the error message i am getting the message exactly after 10 minutes. please help me what could be the problem
‎2007 Dec 06 8:59 AM