wa_layout-colwidth_optimize = 'X'.
* init
CLEAR gv_repid.
gv_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = gv_repid
i_callback_pf_status_set = 'FRM_PF_STATUS'
i_callback_user_command = 'FRM_USER_COMMAND'.
CLEAR:gwa_events.
gwa_events-name = 'TOP_OF_PAGE'.
MOVE 'ALV_TOP_OF_PAGE' TO gwa_events-form.
APPEND gwa_events TO gt_events .
CLEAR:gwa_events.
gwa_events-name = 'TOP_OF_PAGE'.
MOVE 'ALV_TOP_OF_PAGE_02' TO gwa_events-form.
APPEND gwa_events TO gt_events_02.
* 字段设定
PERFORM frm_fill_fieldcat_alv
TABLES gt_fieldcat
USING:
'' '' 'MVC' '车辆型号'.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = wa_layout
it_fieldcat = gt_fieldcat
i_tabname = 'ITAB1'
it_events = gt_events
TABLES
t_outtab = it_outtab.
PERFORM frm_fill_fieldcat_alv
TABLES gt_fieldcat_down
USING:
'' '' 'ZCERT' '配置序列号',
'X' 'X' 'FLAG' '选择'.
* 样式设定
CLEAR wa_layout.
wa_layout-colwidth_optimize = 'X'.
wa_layout-zebra = 'X'.
wa_layout-box_fieldname = 'FLAG'.
IF gv_lines = 1.
wa_layout-no_input = 'X'.
ENDIF.
* alv输出
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = wa_layout
it_fieldcat = gt_fieldcat_down
i_tabname = 'ITAB2'
it_events = gt_events_02
TABLES
t_outtab = gt_output.
*Display
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.