*& Report ZR_LOCK
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT zr_lock.
DATA wa_sflight TYPE sflight.
PARAMETERS: pa_car LIKE wa_sflight-carrid,
pa_con TYPE sflight-connid.
START-OF-SELECTION.
CALL FUNCTION 'ENQUEUE_ESFLIGHT'
EXPORTING
mode_sflight = 'X'
mandt = sy-mandt
carrid = pa_car
connid = pa_con
* FLDATE =
* X_CARRID = ' '
* X_CONNID = ' '
* X_FLDATE = ' '
* _SCOPE = '2'
_wait = 'X'
_COLLECT = 'X'
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION 'ENQUEUE_ESFLIGHT'
EXPORTING
mode_sflight = 'X'
mandt = sy-mandt
carrid = 'AC'
connid = '0820'
* FLDATE =
* X_CARRID = ' '
* X_CONNID = ' '
* X_FLDATE = ' '
* _SCOPE = '2'
_wait = 'X'
_COLLECT = 'X'
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION 'FLUSH_ENQUEUE'
EXCEPTIONS
FOREIGN_LOCK = 1
SYSTEM_FAILURE = 2
OTHERS = 3
.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION 'DEQUEUE_ALL'
* EXPORTING
* _SYNCHRON = ' '
.
WRITE 'Lock Test'.
* CALL FUNCTION 'DEQUEUE_ESFLIGHT'
* EXPORTING
* mode_sflight = 'E'
* mandt = sy-mandt
* carrid = pa_car
* connid = pa_con
* FLDATE =
* X_CARRID = ' '
* X_CONNID = ' '
* X_FLDATE = ' '
* _SCOPE = '3'
* _SYNCHRON = ' '
* _COLLECT = ' '
.
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT zr_lock.
DATA wa_sflight TYPE sflight.
PARAMETERS: pa_car LIKE wa_sflight-carrid,
pa_con TYPE sflight-connid.
START-OF-SELECTION.
CALL FUNCTION 'ENQUEUE_ESFLIGHT'
EXPORTING
mode_sflight = 'X'
mandt = sy-mandt
carrid = pa_car
connid = pa_con
* FLDATE =
* X_CARRID = ' '
* X_CONNID = ' '
* X_FLDATE = ' '
* _SCOPE = '2'
_wait = 'X'
_COLLECT = 'X'
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION 'ENQUEUE_ESFLIGHT'
EXPORTING
mode_sflight = 'X'
mandt = sy-mandt
carrid = 'AC'
connid = '0820'
* FLDATE =
* X_CARRID = ' '
* X_CONNID = ' '
* X_FLDATE = ' '
* _SCOPE = '2'
_wait = 'X'
_COLLECT = 'X'
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION 'FLUSH_ENQUEUE'
EXCEPTIONS
FOREIGN_LOCK = 1
SYSTEM_FAILURE = 2
OTHERS = 3
.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION 'DEQUEUE_ALL'
* EXPORTING
* _SYNCHRON = ' '
.
WRITE 'Lock Test'.
* CALL FUNCTION 'DEQUEUE_ESFLIGHT'
* EXPORTING
* mode_sflight = 'E'
* mandt = sy-mandt
* carrid = pa_car
* connid = pa_con
* FLDATE =
* X_CARRID = ' '
* X_CONNID = ' '
* X_FLDATE = ' '
* _SCOPE = '3'
* _SYNCHRON = ' '
* _COLLECT = ' '
.
감사합니다.^^