We are working in APO DP. there are some jobs that show a Finished status (successfully) even when the log says that data was locked. hence the process that typically takes 10 minutes finishes successfully in 1 sec. Is there a way through some user parameter or lock object setting to abend or stop the job if it finds that the object that it is supposed to work on is found locked by another user?
Hi
My best guess is,
when sap is trying to read data and it found locked at that stage you write a program to check for locking concept for the table, then you will need to raise an error
sample code
DATA: l_varkey TYPE rstable-varkey.
l_varkey = sy-mandt.
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
mode_rstable = 'E'
tabname = '/VWNA/WHRS_MULTI'
varkey = l_varkey
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE E038.
ELSE.
CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
mode_rstable = 'E'
tabname = '/VWNA/WHRS_MULTI'
varkey = l_varkey.
ENDIF.
Thanks
Pavan
Add a comment