REPORT demo_transaction_enqueue MESSAGE-ID sabapdocu. TABLES sflight. DATA text(8) TYPE c. DATA ok_code TYPE sy-ucomm. CALL SCREEN 100. MODULE init OUTPUT. SET PF-STATUS 'BASIC'. sflight-carrid = 'LH'. sflight-connid = '400'. ENDMODULE. MODULE exit INPUT. LEAVE PROGRAM. ENDMODULE. MODULE enqueue INPUT. CASE ok_code. WHEN 'ENQUEUE'. CALL FUNCTION 'ENQUEUE_EDEMOFLHT' EXPORTING mode_sflight = 'X' carrid = sflight-carrid connid = sflight-connid fldate = sflight-fldate EXCEPTIONS foreign_lock = 1 system_failure = 2 OTHERS = 3. CASE sy-subrc. WHEN 0. MESSAGE i888 WITH 'Enqueue successful'(001). WHEN 1. text = sy-msgv1. MESSAGE e888 WITH 'Record already'(002) 'locked by'(003) text. CALL TRANSACTION 'SM12'. WHEN 2 OR 3. MESSAGE e888 WITH 'Error in enqueue!'(004) 'SY-SUBRC:' sy-subrc. ENDCASE. WHEN 'DEQUEUE'. CALL FUNCTION 'DEQUEUE_EDEMOFLHT' EXPORTING mode_sflight = 'X' carrid = sflight-carrid connid = sflight-connid fldate = sflight-fldate EXCEPTIONS OTHERS = 1. CASE sy-subrc. WHEN 0. MESSAGE i888 WITH 'Dequeue successful'(005). WHEN 1. MESSAGE e888 WITH 'Error in dequeue!'(006). ENDCASE. WHEN 'SM12'. CALL TRANSACTION 'SM12'. ENDCASE. ENDMODULE. MODULE select INPUT. CASE ok_code. WHEN 'SELECT'. SELECT * FROM sflight WHERE carrid = sflight-carrid AND connid = sflight-connid AND fldate = sflight-fldate. ENDSELECT. MESSAGE i888 WITH 'SY-SUBRC:' sy-subrc. ENDCASE. ENDMODULE.