The following code adds simple screen control to the report and whenever the user presses the cancel, exit or back icon they will exit from the report. It also processes the ALVtree user interactions within the 'others' case statement.
*--------------------------------------------------------------* * INCLUDE Z......I01 * *--------------------------------------------------------------* *&-------------------------------------------------------------* *& Module USER_COMMAND_0100 INPUT *&-------------------------------------------------------------* * text *--------------------------------------------------------------* module user_command_0100 input. DATA return TYPE REF TO cl_gui_event. save_ok = ok_code. case ok_code. when 'BACK' or '%EX' or 'RW'. * Exit program leave to screen 0. * Process ALVtree user actions when others. call method cl_gui_cfw=>get_current_event_object receiving event_object = return. call method cl_gui_cfw=>dispatch. endcase. endmodule. " USER_COMMAND_0100 INPUT