col_id. METHODS handle_delayed_move_curr_cell " DELAYED_MOVE_CURRENT_CELL FOR EVENT delayed_move_current_cell OF cl_gui_alv_grid_base. METHODS handle_f1 " F1 FOR EVENT f1 OF cl_gui_alv_grid_base. METHODS handle_dblclick_row_col " DBLCLICK_ROW_COL FOR EVENT dblclick_row_col OF cl_gui_alv_grid_base IMPORTING row_id col_id. METHODS handle_click_row_col " CLICK_ROW_COL FOR EVENT click_row_col OF cl_gui_alv_grid_base IMPORTING row_id col_id. METHODS handle_toolbar_button_click " TOOLBAR_BUTTON_CLICK FOR EVENT toolbar_button_click OF cl_gui_alv_grid_base. METHODS handle_double_click_col_sep " DOUBLE_CLICK_COL_SEPARATOR FOR EVENT double_click_col_separator OF cl_gui_alv_grid_base IMPORTING col_id. METHODS handle_delayed_change_select " DELAYED_CHANGE_SELECTION FOR EVENT delayed_change_selection OF cl_gui_alv_grid_base. METHODS handle_context_menu " CONTEXT_MENU FOR EVENT context_menu OF cl_gui_alv_grid_base. METHODS handle_total_click_row_col " TOTAL_CLICK_ROW_COL FOR EVENT total_click_row_col OF cl_gui_alv_grid_base IMPORTING row_id col_id. METHODS handle_context_menu_selected " CONTEXT_MENU_SELECTED FOR EVENT context_menu_selected OF cl_gui_alv_grid_base IMPORTING fcode. METHODS handle_toolbar_menu_selected " TOOLBAR_MENU_SELECTED FOR EVENT toolbar_menu_selected OF cl_gui_alv_grid_base IMPORTING fcode.ENDCLASS. "cl_base_event_receiver DEFINITION*----------------------------------------------------------------------** CLASS cl_base_event_receiver IMPLEMENTATION*----------------------------------------------------------------------*CLASS cl_base_event_receiver IMPLEMENTATION. METHOD set_protected_handlers. SET HANDLER me->handle_toolbar_menubutton_clk FOR go_grid. SET HANDLER me->handle_click_col_header FOR go_grid. SET HANDLER me->handle_delayed_move_curr_cell FOR go_grid. SET HANDLER me->handle_f1 FOR go_grid. SET HANDLER me->handle_dblclick_row_col FOR go_grid. SET HANDLER me->handle_click_row_col FOR go_grid. SET HANDLER me->handle_toolbar_button_click FOR go_grid. SET HANDLER me->handle_double_click_col_sep FOR go_grid. SET HANDLER me->handle_delayed_change_select FOR go_grid. SET HANDLER me->handle_context_menu FOR go_grid. SET HANDLER me->handle_total_click_row_col FOR go_grid. SET HANDLER me->handle_context_menu_selected FOR go_grid. SET HANDLER me->handle_toolbar_menu_selected FOR go_grid. ENDMETHOD. "set_protected_handlers METHOD handle_toolbar_menubutton_clk. BREAK-POINT. ENDMETHOD. "handle_toolbar_menubutton_clk METHOD handle_click_col_header. BREAK-POINT. ENDMETHOD. "handle_click_col_header METHOD handle_delayed_move_curr_cell. BREAK-POINT. ENDMETHOD. "handle_delayed_move_curr_cell METHOD handle_f1. BREAK-POINT. ENDMETHOD. "handle_f1 METHOD handle_dblclick_row_col. BREAK-POINT. ENDMETHOD. "handle_dblclick_row_col METHOD handle_click_row_col. BREAK-POINT. ENDMETHOD. "handle_click_row_col METHOD handle_toolbar_button_click. BREAK-POINT. ENDMETHOD. "handle_toolbar_button_click METHOD handle_double_click_col_sep. BREAK-POINT. ENDMETHOD. "handle_double_click_col_sep METHOD handle_delayed_change_select. BREAK-POINT. ENDMETHOD. "handle_delayed_change_select METHOD handle_context_menu. BREAK-POINT. ENDMETHOD. "handle_context_menu METHOD handle_total_click_row_col. BREAK-POINT. ENDMETHOD. "handle_total_click_row_col METHOD handle_context_menu_selected. BREAK-POINT. ENDMETHOD. "handle_context_menu_selected METHOD handle_toolbar_menu_selected. BREAK-POINT. ENDMETHOD. "handle_toolbar_menu_selectedENDCLASS. "cl_base_event_receiver IMPLEMENTATION*&---------------------------------------------------------------------**& START-OF-SELECTION*&---------------------------------------------------------------------*START-OF-SELECTION.* read sample data to internal table SELECT * FROM usr02 UP TO 30 ROWS APPENDING CORRESPONDING FIELDS OF TABLE gt_usr ORDER BY bname.* create field catalog PERFORM create_fieldcat.* display screen CALL SCREEN 0100.*&---------------------------------------------------------------------**& Form create_fieldcat*&---------------------------------------------------------------------*FORM create_fieldcat. DATA: ls_fcat TYPE lvc_s_fcat.* create field catalog CALL FUNCTION 'LVC_FIELDCATALOG_MERGE' EXPORTING i_structure_name = 'USR02' CHANGING ct_fieldcat = gt_fcat.* hotspot fields ls_fcat-hotspot = 'X'. MODIFY gt_fcat FROM ls_fcat TRANSPORTING hotspot WHERE fieldname = 'BNAME'.* editable column ls_fcat-edit = 'X'. MODIFY gt_fcat FROM ls_fcat TRANSPORTING edit WHERE fieldname = 'GLTGV'.* F4 list ls_fcat-f4availabl = 'X'. MODIFY gt_fcat FROM ls_fcat TRANSPORTING f4availabl WHERE fieldname = 'UFLAG' OR fieldname = 'ANAME'.* dropdown list ls_fcat-drdn_hndl = '1'. MODIFY gt_fcat FROM ls_fcat TRANSPORTING drdn_hndl WHERE fieldname = 'CLASS' OR fieldname = 'LOCNT'.ENDFORM. "create_fieldcat*&---------------------------------------------------------------------**& Form field_f4_register*&---------------------------------------------------------------------*FORM field_f4_register. DATA: lt_f4 TYPE lvc_t_f4, ls_f4 TYPE lvc_s_f4. ls_f4-fieldname = 'UFLAG'. ls_f4-register = 'X'.* ls_f4-getbefore = 'X'.* ls_f4-chngeafter = 'X'. INSERT ls_f4 INTO TABLE lt_f4. ls_f4-fieldname = 'ANAME'. ls_f4-register = 'X'.* ls_f4-getbefore = 'X'.* ls_f4-chngeafter = 'X'. INSERT ls_f4 INTO TABLE lt_f4. CALL METHOD go_grid->register_f4_for_fields EXPORTING it_f4 = lt_f4.ENDFORM. "field_f4_register*----------------------------------------------------------------------** MODULE pbo_0100 OUTPUT*----------------------------------------------------------------------*MODULE pbo_0100 OUTPUT.* set GUI status SET PF-STATUS 'STAT_0100'. IF go_custom_container IS INITIAL. CREATE OBJECT go_custom_container EXPORTING container_name = 'CONT1_0100'. CREATE OBJECT go_grid EXPORTING i_appl_events = 'X' i_parent = go_custom_container.* create handler CREATE OBJECT go_event_receiver.* register handler for events SET HANDLER go_event_receiver->handle_right_click FOR go_grid. SET HANDLER go_event_receiver->handle_left_click_design FOR go_grid. SET HANDLER go_event_receiver->handle_move_control FOR go_grid. SET HANDLER go_event_receiver->handle_size_control FOR go_grid. SET HANDLER go_event_receiver->handle_left_click_run FOR go_grid. SET HANDLER go_event_receiver->handle_onf1 FOR go_grid. SET HANDLER go_event_receiver->handle_onf4 FOR go_grid. SET HANDLER