----------------------------------------------------------------------------------------------------------------------------------
PARAMETERS : p_table TYPE tabname.
* FM to lock a table
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
mode_rstable = 'E'
tabname = p_table
* VARKEY =
* X_TABNAME = ' '
* X_VARKEY = ' '
* _SCOPE = '2'
* _WAIT = ' '
* _COLLECT = ' '
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc = 0.
MESSAGE 'Table locked' TYPE 'I'.
ENDIF.
* FM to unlock the table
CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
mode_rstable = 'E'
tabname = p_table
* _COLLECT = ' '
.
MESSAGE 'Table Unlocked' TYPE 'I'.
----------------------------------------------------------------------------------------------------------------------------------
Tx- SM12
Here is lock entry in Tx- SM12
----------------------------------------------------------------------------------------------------------------------------------
PARAMETERS : p_table TYPE tabname.
* FM to lock a table
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
mode_rstable = 'E'
tabname = p_table
* VARKEY =
* X_TABNAME = ' '
* X_VARKEY = ' '
* _SCOPE = '2'
* _WAIT = ' '
* _COLLECT = ' '
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc = 0.
MESSAGE 'Table locked' TYPE 'I'.
ENDIF.
* FM to unlock the table
CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
mode_rstable = 'E'
tabname = p_table
* _COLLECT = ' '
.
MESSAGE 'Table Unlocked' TYPE 'I'.
----------------------------------------------------------------------------------------------------------------------------------
Tx- SM12
Run the report.
----------------------------------------------------------------------------------------------------------------------------------
No comments:
Post a Comment