Hi All ,
I use this locking (write lock) and i want to verify if i do it OK .
what i do is to check if the entry is locked if so try 5 times .
one more thing is that that i dont know how the parameter behavior and _wait can help me .
Regards
Chris
DO iv_try_x_times TIMES. "Try to lock object for 5 times before skiping the object
lv_count = lv_count + 1.
CALL FUNCTION 'ENQUEUE_E_D_USR'
EXPORTING
mandt = sy-mandt
userid = mv_userid
x_for_user = iv_is_exact " If FOR_USER is initial this defines the lock behavior
wait = ivis_wait
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc = 0.
RETURN.
ENDIF.
IF lv_count < iv_try_x_times.
WAIT UP TO 1 SECONDS.
ENDIF.
ENDDO.