ALV1
DATA: gt_fieldcat TYPE TABLE OF slis_fieldcat_alv.
DATA: gs_fieldcat TYPE slis_fieldcat_alv.
DATA: gs_layout TYPE slis_layout_alv .
DEFINE append_field.
gs_fieldcat-fieldname = &1.gs_fieldcat-seltext_l = &2.
APPEND gs_fieldcat TO gt_fieldcat.
CLEAR: gs_fieldcat.
END-OF-DEFINITION.
append_field: 'LIGHT' '指示灯' .
append_field: 'VGBEL' '订单号' .
append_field: 'ERDAT' '创建日期' .
append_field: 'ERNAM' '创建人' .
append_field: 'VTWEG' '渠道' .
append_field: 'VGPOS' '行项目' .
append_field: 'MATNR' '物料' .
append_field: 'MAKTX' '物料描述' .
append_field: 'KWMENG' '订单数量' .
append_field: 'LFIMG' '交货单数量' .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
* i_callback_pf_status_set = 'FRM_STATUS_SET3'
* i_callback_user_command = 'FRM_USER_COMMAND3'
*
* I_GRID_SETTINGS =
is_layout = gs_layout
it_fieldcat = gt_fieldcat
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = gt_out[]
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.