OOALV
效果图:
功能包含双击节点、工具栏按钮、ALV按钮、ALV更新
荧幕逻辑流:
*&---------------------------------------------------------------------*
*& Report ZYC_OOALV *&OO ALV *&---------------------------------------------------------------------* REPORT ZYC_OOALV. *--------------------------------------------------------------------* *PERFORM (FORM_NAME) IN PROGRAM (SY-CPROG) IF FOUND . *--------------------------------------------------------------------*end "TYPES NODE_TABLE TYPE STANDARD TABLE OF MTREESNODE . TYPES: BEGIN OF TY_STRUC, BOX TYPE flag, CHK TYPE flag, VBELN TYPE vbeln, POSNR TYPE posnr, MATNR TYPE matnr, MAKTX TYPE maktx, LFIMG TYPE lfimg, MEINS TYPE meins, ERDAT TYPE erdat, ERZET TYPE erzet, BTN(17) TYPE C, END OF TY_STRUC. TYPES:BEGIN OF TY_NODE, K(3) TYPE C,"key V(10) TYPE C,"value END OF TY_NODE. "CLASS alv_event_receiver DEFINITION DEFERRED. "声明类对象 CLASS alv_event_receiver DEFINITION. PUBLIC SECTION. CLASS-METHODS: handle_toolbar FOR EVENT toolbar of cl_gui_alv_grid IMPORTING e_object e_interactive, handle_menu_button FOR EVENT menu_button of cl_gui_alv_grid IMPORTING e_object e_ucomm, handle_user_command FOR EVENT user_command of cl_gui_alv_grid IMPORTING e_ucomm, handle_data_changed FOR EVENT data_changed of cl_gui_alv_grid IMPORTING er_data_changed, handle_node_dclick FOR EVENT node_double_click of cl_gui_simple_tree IMPORTING node_key, handle_data_finished FOR EVENT data_changed_finished of cl_gui_alv_grid IMPORTING e_modified et_good_cells . ENDCLASS. DATA GT_N TYPE STANDARD TABLE OF TY_NODE. DATA: OK_CODE TYPE SY-UCOMM, MY_CODE LIKE OK_CODE. DATA: G_FULL_CONT TYPE REF TO cl_gui_custom_container, G_TREE_CONT TYPE REF TO cl_gui_container, G_ALV_CONT TYPE REF TO cl_gui_container, G_ALV TYPE REF TO cl_gui_alv_grid, G_TREE TYPE REF TO cl_gui_simple_tree, G_SPLITTER TYPE REF TO cl_gui_splitter_container, G_BHAV_TREE TYPE REF TO CL_DRAGDROP, G_BHAV_ALV TYPE REF TO CL_DRAGDROP, G_NODE_TABLE TYPE STANDARD TABLE OF MTREESNODE."节点信息 DATA:LT_ALV TYPE STANDARD TABLE OF ZZS_YC_OOALV, GT_ALV TYPE STANDARD TABLE OF TY_STRUC, GT_FIELD TYPE lvc_t_fcat, LW_ALV TYPE ZZS_YC_OOALV, GW_ALV TYPE TY_STRUC, GS_FIELD TYPE lvc_s_fcat, GT_LAYOUT TYPE lvc_s_layo, gt_exclude TYPE ui_functions. DATA:lt_events TYPE cntl_simple_events, ls_event TYPE cntl_simple_event. DATA:gs_toolbar TYPE stb_button,"按钮 event_receiver TYPE REF TO alv_event_receiver. CLASS alv_event_receiver IMPLEMENTATION. METHOD handle_toolbar. CLEAR gs_toolbar. gs_toolbar-BUTN_TYPE = '3'. APPEND gs_toolbar TO e_object->MT_TOOLBAR. CLEAR gs_toolbar. gs_toolbar-FUNCTION = 'BSUM'. "为按钮分配功能码 gs_toolbar-ICON = icon_export."为按钮分配图标 gs_toolbar-TEXT = '汇总行数'."为按钮分配文本 APPEND gs_toolbar TO e_object->MT_TOOLBAR."添加按钮到工具栏 CLEAR gs_toolbar. gs_toolbar-FUNCTION = 'BLIST'. gs_toolbar-ICON = icon_biw_report_view. gs_toolbar-TEXT = '下拉选择'. gs_toolbar-BUTN_TYPE = '2'."默认为0 APPEND gs_toolbar TO e_object->MT_TOOLBAR. ENDMETHOD. METHOD handle_menu_button. if e_ucomm = 'BLIST'. e_object->ADD_FUNCTION( EXPORTING icon = icon_display fcode = 'LIST' text = '下拉列表' ). endif. ENDMETHOD. METHOD handle_user_command. case e_ucomm. when 'BSUM'. MESSAGE 'HUIZONG HANG SHU' TYPE 'I'. when 'LIST'. "MESSAGE '下拉选择列表' TYPE 'I'. PERFORM SHOW_SEL_DATA. endcase. ENDMETHOD. METHOD handle_data_changed. "PERFORM ALV_DATA_CHANGE USING er_data_changed. data: x_change TYPE lvc_s_modi, i_but(17) TYPE c. LOOP AT er_data_changed->MT_GOOD_CELLS INTO x_change. READ TABLE GT_ALV INTO GW_ALV INDEX x_change-ROW_ID. CALL METHOD er_data_changed->GET_CELL_VALUE EXPORTING I_ROW_ID = x_change-ROW_ID I_FIELDNAME = x_change-FIELDNAME IMPORTING E_VALUE = i_but. GW_ALV-BTN = I_BUT. modify GT_ALV FROM GW_ALV INDEX x_change-ROW_ID. * 更新后要刷新报表,可在finished之后统一刷新 "CALL METHOD G_ALV->REFRESH_TABLE_DISPLAY. ENDLOOP. ENDMETHOD. METHOD handle_node_dclick. MESSAGE G_NODE_TABLE[ NODE_KEY = NODE_KEY ]-text TYPE 'I'. ENDMETHOD. METHOD handle_data_finished. data:ls_cell TYPE lvc_s_modi. LOOP at et_good_cells INTO ls_cell. READ TABLE GT_ALV INTO GW_ALV INDEX ls_cell-ROW_ID. IF GW_ALV-CHK = 'X'. GW_ALV-CHK = SPACE. ELSE. GW_ALV-CHK = 'X'. ENDIF. modify GT_ALV FROM GW_ALV INDEX ls_cell-ROW_ID. *如此时未刷新或仅在data_changed中刷新,则finished事件不显示在ALV中; *下次 data changed之后会显示上次finished事件 "重新设置布局,自适应列宽 CALL METHOD G_ALV->SET_FRONTEND_LAYOUT EXPORTING is_layout = GT_LAYOUT. CALL METHOD G_ALV->REFRESH_TABLE_DISPLAY. ENDLOOP. ENDMETHOD. ENDCLASS. START-OF-SELECTION. PERFORM GET_FIELD. PERFORM GET_EXCLUDE. PERFORM GET_LAYOUT. PERFORM GET_DATA. CALL SCREEN 100. *&---------------------------------------------------------------------* *& Form GET_FIELD *&---------------------------------------------------------------------* FORM GET_FIELD . CLEAR:GT_FIELD. DEFINE DEF_STRUC. CLEAR GS_FIELD. GS_FIELD-FIELDNAME = &1. GS_FIELD-NO_ZERO = &2. GS_FIELD-COLTEXT = &3. CASE &1. WHEN 'CHK'. GS_FIELD-CHECKBOX = 'X'. WHEN 'MATNR'. GS_FIELD-NO_ZERO = 'X'. WHEN 'LFIMG'. GS_FIELD-EDIT = 'X'. GS_FIELD-DECIMALS = 3. WHEN 'BTN'. GS_FIELD-STYLE = cl_gui_alv_grid=>mc_style_button. ENDCASE. APPEND GS_FIELD TO GT_FIELD. END-OF-DEFINITION. DEF_STRUC 'CHK' '' '标识'. DEF_STRUC 'VBELN' '' '交货单号'. DEF_STRUC 'POSNR' '' '交货项次'. DEF_STRUC 'MATNR' '' '物料编号'. DEF_STRUC 'MAKTX' '' '物料名称'. DEF_STRUC 'LFIMG' '' '交货重量'. DEF_STRUC 'MEINS' '' '交货单位'. DEF_STRUC 'ERDAT' '' '交货日期'. DEF_STRUC 'ERZET' '' '交货时间'. DEF_STRUC 'BTN' '' '提示信息'. ENDFORM. *&---------------------------------------------------------------------* *& Form GET_LAYOUT *&---------------------------------------------------------------------* FORM GET_LAYOUT . "GT_LAYOUT-EDIT = ''. "GT_LAYOUT-EDIT_MODE = 'X'. GT_LAYOUT-ZEBRA = 'X'. GT_LAYOUT-CWIDTH_OPT = 'X'. "GT_LAYOUT-NO_TOOLBAR = 'X'." 隐藏全部按钮 GT_LAYOUT-BOX_FNAME = 'BOX'. GT_LAYOUT-SEL_MODE = 'D'."多选 ENDFORM. *&---------------------------------------------------------------------* *& Form GET_EXCLUDE *&---------------------------------------------------------------------* FORM GET_EXCLUDE . *隐藏不需要的标准按钮 *--------------------------------------------------------------------* * gt_exclude = value #( ( '&FILTER' ) ( '&AUF' ) * ( '&SUBTOT' ) ( '&SUMC' ) ( '&AVERAGE') ( '&MAXIMUM' ) ( '&MINIMUM' ) ). *--------------------------------------------------------------------* DATA ls_exclude TYPE ui_func. ls_exclude = cl_gui_alv_grid=>mc_fc_filter . "过滤器 APPEND ls_exclude TO gt_exclude. ls_exclude = cl_gui_alv_grid=>mc_fc_current_variant . "布局更改 APPEND ls_exclude TO gt_exclude. ls_exclude = cl_gui_alv_grid=>mc_fc_average ."平均值 APPEND ls_exclude TO gt_exclude. ls_exclude = cl_gui_alv_grid=>mc_mb_sum ."求和 APPEND ls_exclude TO gt_exclude. "ls_exclude = cl_gui_alv_grid=>mc_mb_export . "导出 "APPEND ls_exclude TO gt_exclude. ls_exclude = cl_gui_alv_grid=>mc_fc_loc_cut . "剪切 APPEND ls_exclude TO gt_exclude. ls_exclude = cl_gui_alv_grid=>mc_fc_loc_delete_row . "删除行 APPEND ls_exclude TO gt_exclude. ls_exclude = cl_gui_alv_grid=>mc_fc_loc_insert_row . "插入行 APPEND ls_exclude TO gt_exclude. ls_exclude = cl_gui_alv_grid=>mc_fc_refresh . "刷新 APPEND ls_exclude TO gt_exclude. ls_exclude = cl_gui_alv_grid=>mc_fc_find ."查找 APPEND ls_exclude TO gt_exclude. "ls_exclude = cl_gui_alv_grid=>mc_fc_sort_asc . "升序排列 "APPEND ls_exclude TO gt_exclude. "ls_exclude = cl_gui_alv_grid=>mc_fc_sort_dsc . "降序排列 "APPEND ls_exclude TO gt_exclude. ls_exclude = cl_gui_alv_grid=>mc_fc_views . "视图 APPEND ls_exclude TO gt_exclude. ls_exclude = cl_gui_alv_grid=>mc_fc_print ."打印 APPEND ls_exclude TO gt_exclude. ls_exclude = cl_gui_alv_grid=>mc_fc_detail . "详细按钮 APPEND ls_exclude TO gt_exclude. ls_exclude = cl_gui_alv_grid=>mc_fc_graph . "显示图形 APPEND ls_exclude TO gt_exclude. "ls_exclude = cl_gui_alv_grid=>mc_fc_info . "最终用户文档 "APPEND ls_exclude TO gt_exclude. ls_exclude = cl_gui_alv_grid=>mc_fc_loc_append_row . "附加行 APPEND ls_exclude TO gt_exclude. ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy_row . "复制行 APPEND ls_exclude TO gt_exclude. ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy . "复制文本 APPEND ls_exclude TO gt_exclude. ls_exclude = cl_gui_alv_grid=>mc_fc_loc_undo . "撤消 APPEND ls_exclude TO gt_exclude. ls_exclude = cl_gui_alv_grid=>MC_FC_LOC_PASTE_NEW_ROW."插入新条目 APPEND ls_exclude TO gt_exclude. ls_exclude = cl_gui_alv_grid=>MC_FC_LOC_PASTE."插入总览 APPEND ls_exclude TO gt_exclude. ls_exclude = cl_gui_alv_grid=>MC_FC_CHECK."检查条目 APPEND ls_exclude TO gt_exclude. ENDFORM. *&---------------------------------------------------------------------* *& Form GET_DATA *&---------------------------------------------------------------------* FORM GET_DATA . *--------------------------------------------------------------------*Begin *方式一:使用SE11定义数据结构 * LW_ALV = VALUE #( box = '' vbeln = 8100001766 posnr = 900001 matnr = 'ADC12' maktx = 'ADC12' lfimg = 970 meins = 'KG' * erdat = 20180509 erzet = 103528 ). * APPEND LW_ALV TO LT_ALV. *--------------------------------------------------------------------* *方式二:在程式中定义数据结构 PERFORM GET_FIELD GT_ALV = VALUE #( ( CHK = 'X' VBELN = 8100002066 POSNR = 900016 MATNR = '000000000004009660' MAKTX = '软管, 液压软管 尺寸&类别:GH506-16-33"' lfimg = '970.5' meins = 'KG' erdat = '20190509' erzet = 103528 BTN = 'msg' ) ( CHK = '' VBELN = 8100006099 POSNR = 900036 MATNR = '000000000003000421' MAKTX = '切片台下料 (90%)' lfimg = '1250.8' meins = 'KG' erdat = '20200609' erzet = 103528 BTN = 'shw' ) ( CHK = 'X' VBELN = 8100006137 POSNR = 900022 MATNR = '000000000004010615' MAKTX = '球阀,, 2" 双球阀, 螺纹式 (GI有等级标志)' lfimg = 1070 meins = 'KG' erdat = '20230519' erzet = 103528 BTN = 'Inf' ) ). *--------------------------------------------------------------------* end ENDFORM. *&---------------------------------------------------------------------* *& Form SHOW_SEL_DATA *&---------------------------------------------------------------------* FORM SHOW_SEL_DATA . SELECT 'X' AS CHK, L~VBELN, L~POSNR, L~MATNR, M~MAKTX, L~LFIMG, L~MEINS, L~ERDAT, L~ERZET, 'INF' AS BTN INTO CORRESPONDING FIELDS OF TABLE @GT_ALV FROM LIPS AS L LEFT JOIN MAKT AS M ON L~MATNR = M~MATNR WHERE VBELN = '0180000583' . CALL METHOD G_ALV->SET_FRONTEND_LAYOUT EXPORTING is_layout = GT_LAYOUT. CALL METHOD G_ALV->REFRESH_TABLE_DISPLAY. ENDFORM. *&---------------------------------------------------------------------* *& Form SHOW_UPDA *&---------------------------------------------------------------------* FORM SHOW_UPDA . DATA:HMSG TYPE STRING, IT_ROWS TYPE LVC_T_ROID. *设置BOX不会生效,以下方式获取选中行 CALL METHOD G_ALV->GET_SELECTED_ROWS IMPORTING ET_ROW_NO = IT_ROWS. LOOP AT IT_ROWS INTO DATA(IT_ROW). HMSG = HMSG && GT_ALV[ IT_ROW-ROW_ID ]-LFIMG && ';'. CLEAR GW_ALV. ENDLOOP. IF HMSG IS NOT INITIAL. CALL FUNCTION 'POPUP_CONTINUE_YES_NO' EXPORTING DEFAULTOPTION = 'Y' TEXTLINE1 = HMSG * TEXTLINE2 = ' ' TITEL = 'Infomation' * START_COLUMN = 25 * START_ROW = 6 * IMPORTING * ANSWER = . ELSE. MESSAGE 'Pls select the rows!' TYPE 'I'. ENDIF. ENDFORM. *&---------------------------------------------------------------------* *& Form ALV_DATA_CHANGE *&---------------------------------------------------------------------* FORM ALV_DATA_CHANGE USING data_changed TYPE REF TO cl_alv_changed_data_protocol. data: x_change TYPE lvc_s_modi, i_but(17) TYPE c. LOOP AT data_changed->MT_GOOD_CELLS INTO x_change. READ TABLE GT_ALV INTO GW_ALV INDEX x_change-ROW_ID. CALL METHOD data_changed->GET_CELL_VALUE EXPORTING I_ROW_ID = x_change-ROW_ID I_FIELDNAME = x_change-FIELDNAME IMPORTING E_VALUE = i_but. GW_ALV-BTN = I_BUT. modify GT_ALV FROM GW_ALV INDEX x_change-ROW_ID. *更新后要刷新报表,可在finished之后统一刷新 "CALL METHOD G_ALV->REFRESH_TABLE_DISPLAY. ENDLOOP. ENDFORM. *&---------------------------------------------------------------------* *& Module USER_COMMAND_0100 INPUT *&---------------------------------------------------------------------* MODULE USER_COMMAND_0100 INPUT. MY_CODE = OK_CODE. CLEAR OK_CODE. CASE MY_CODE. WHEN 'BACK' OR 'EXIT' OR 'CANC'. LEAVE TO SCREEN 0. WHEN 'SRCH'. PERFORM SHOW_SEL_DATA. WHEN 'UPDA'. PERFORM SHOW_UPDA. ENDCASE. ENDMODULE. *&---------------------------------------------------------------------* *& Module STATUS_0100 OUTPUT *&---------------------------------------------------------------------* MODULE STATUS_0100 OUTPUT. * SET PF-STATUS 'xxxxxxxx'. * SET TITLEBAR 'xxx'. * CL_SALV_FUNCTIONS_LIST SET PF-STATUS 'MAINSTS'. ENDMODULE. *&---------------------------------------------------------------------* *& Module SCREEN_EXT INPUT *&---------------------------------------------------------------------* * 按钮选择功能类型:E *----------------------------------------------------------------------* MODULE SCREEN_EXT INPUT. CASE SY-UCOMM. WHEN 'EXT'. "LEAVE TO SCREEN 0. LEAVE PROGRAM. ENDCASE. ENDMODULE. *&---------------------------------------------------------------------* *& Form CREATE_TREE_NODE *&---------------------------------------------------------------------* FORM CREATE_TREE_NODE . DATA G_NODE TYPE MTREESNODE. GT_N = VALUE #( ( k = 'BJ' v = '北京' ) ( k = 'SH' v = '上海' ) ( k = 'JS' v = '江苏' ) ( k = 'SD' v = '山东' ) ( k = 'GZ' v = '广州' ) ( k = 'SZ' v = '深圳' ) ( k = 'JX' v = '江西' ) ( k = 'HN' v = '湖南' ) ( k = 'HB' v = '河北' ) ). IF G_TREE IS NOT INITIAL. CLEAR: G_NODE. G_NODE-NODE_KEY = 'CHA'. G_NODE-ISFOLDER = 'X'. G_NODE-DISABLED = 'X'. G_NODE-TEXT = '省份'. G_NODE-EXPANDER = 'X'. APPEND G_NODE TO G_NODE_TABLE. LOOP AT GT_N INTO DATA(WA_N). CLEAR: G_NODE. G_NODE-NODE_KEY = WA_N-K. G_NODE-ISFOLDER = ''. G_NODE-TEXT = WA_N-V. G_NODE-RELATKEY = 'CHA'. G_NODE-RELATSHIP = CL_GUI_SIMPLE_TREE=>RELAT_LAST_CHILD. APPEND G_NODE TO G_NODE_TABLE. ENDLOOP. CALL METHOD G_TREE->ADD_NODES EXPORTING TABLE_STRUCTURE_NAME = 'MTREESNODE' NODE_TABLE = G_NODE_TABLE EXCEPTIONS FAILED = 1 ERROR_IN_NODE_TABLE = 2 DP_ERROR = 3 TABLE_STRUCTURE_NAME_NOT_FOUND = 4 others = 5. IF SY-SUBRC <> 0. MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF. G_TREE->EXPAND_ROOT_NODES( ). ENDIF. ENDFORM. *&---------------------------------------------------------------------* *& Form CREATE_AND_INIT_CONTROLS *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* FORM CREATE_AND_INIT_CONTROLS . IF G_SPLITTER IS INITIAL. *--------------------------------------------------------------------*Begin *方式一:界面中使用自定义控件 MAIN * 大小按照MAIN定义的范围 * CREATE OBJECT G_FULL_CONT * EXPORTING * CONTAINER_NAME = 'MAIN'. * CREATE OBJECT G_SPLITTER * EXPORTING * PARENT = G_FULL_CONT * ROWS = 1 * COLUMNS = 2. *--------------------------------------------------------------------* *方式二:使用系统默认提供的CONTAINER,默认大小为整个荧幕 G_SPLITTER = NEW CL_GUI_SPLITTER_CONTAINER( PARENT = CL_GUI_CONTAINER=>SCREEN0 ROWS = 1 COLUMNS = 2 ) . *--------------------------------------------------------------------*End CALL METHOD G_SPLITTER->GET_CONTAINER EXPORTING ROW = 1 COLUMN = 1 RECEIVING CONTAINER = G_TREE_CONT. G_SPLITTER->GET_CONTAINER( EXPORTING ROW = 1 COLUMN = 2 RECEIVING CONTAINER = G_ALV_CONT ). *设置TREE CONTAINER的宽度,内容超出时自动增加滚动条 G_SPLITTER->SET_COLUMN_WIDTH( EXPORTING ID = 1 WIDTH = 12 EXCEPTIONS CNTL_ERROR = 1 CNTL_SYSTEM_ERROR = 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. * 创建树形结构 CREATE OBJECT G_TREE EXPORTING PARENT = G_TREE_CONT NODE_SELECTION_MODE = CL_GUI_SIMPLE_TREE=>NODE_SEL_MODE_SINGLE EXCEPTIONS LIFETIME_ERROR = 1 CNTL_SYSTEM_ERROR = 2 CREATE_ERROR = 3 FAILED = 4 ILLEGAL_NODE_SELECTION_MODE = 5. IF SY-SUBRC <> 0. MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF. PERFORM CREATE_TREE_NODE. CLEAR:ls_event. ls_event-EVENTID = cl_gui_simple_tree=>EVENTID_NODE_DOUBLE_CLICK. ls_event-APPL_EVENT = 'X'. APPEND ls_event TO lt_events. CALL METHOD G_TREE->SET_REGISTERED_EVENTS EXPORTING events = lt_events EXCEPTIONS CNTL_ERROR = 1 CNTL_SYSTEM_ERROR = 2 ILLEGAL_EVENT_COMBINATION = 3 OTHERS = 4 . * 创建ALV G_ALV = NEW CL_GUI_ALV_GRID( I_PARENT = G_ALV_CONT ) . *显示ALV *--------------------------------------------------------------------*BEGIN *方式一:SE11数据结构 * G_ALV->SET_TABLE_FOR_FIRST_DISPLAY( * EXPORTING i_structure_name = 'ZZS_YC_OOALV' * CHANGING it_outtab = LT_ALV * EXCEPTIONS * invalid_parameter_combination = 1 * program_error = 2 * too_many_lines = 3 * OTHERS = 4 ). *--------------------------------------------------------------------* *方式二:自定义数据结构 CREATE OBJECT event_receiver. SET HANDLER event_receiver->HANDLE_TOOLBAR FOR G_ALV. SET HANDLER event_receiver->HANDLE_MENU_BUTTON FOR ALL INSTANCES. SET HANDLER event_receiver->handle_user_command FOR G_ALV. SET HANDLER event_receiver->HANDLE_DATA_CHANGED FOR G_ALV. SET HANDLER event_receiver->HANDLE_DATA_FINISHED FOR G_ALV. "SET HANDLER alv_event_receiver=>handle_user_command FOR G_ALV. SET HANDLER event_receiver->handle_node_dclick FOR G_TREE. CALL METHOD G_ALV->REGISTER_EDIT_EVENT EXPORTING i_event_id = G_ALV->MC_EVT_MODIFIED. G_ALV->SET_TABLE_FOR_FIRST_DISPLAY( EXPORTING I_SAVE = 'A' IS_LAYOUT = GT_LAYOUT it_toolbar_excluding = gt_exclude CHANGING it_outtab = GT_ALV it_fieldcatalog = GT_FIELD EXCEPTIONS invalid_parameter_combination = 1 program_error = 2 too_many_lines = 3 OTHERS = 4 ). *--------------------------------------------------------------------*END 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 METHOD G_ALV->SET_TOOLBAR_INTERACTIVE . ELSE. DATA: is_stable TYPE lvc_s_stbl. is_stable-col = 'X'. is_stable-ROW = 'X'. CALL METHOD G_ALV->REFRESH_TABLE_DISPLAY EXPORTING IS_STABLE = is_stable EXCEPTIONS finished = 1 OTHERS = 2 . ENDIF. ENDFORM. *&---------------------------------------------------------------------* *& Module PBO_SCREEN OUTPUT *&---------------------------------------------------------------------* MODULE PBO_SCREEN OUTPUT. PERFORM CREATE_AND_INIT_CONTROLS. ENDMODULE.