代码5S
分类:
2020-05-20 16:33:58
原文地址:Class方式的ALV不想定义Screen 作者:qdbarry
REPORT z_barry_alv_noscreen .
SELECTION-SCREEN BEGIN OF SCREEN 1001.
SELECTION-SCREEN END OF SCREEN 1001.
DATA: l_alv TYPE REF TO cl_gui_alv_grid ,
lt_sflight TYPE TABLE OF sflight .
SELECT * FROM sflight INTO TABLE lt_sflight.
CREATE OBJECT l_alv
EXPORTING
i_parent = cl_gui_container=>screen0.
CALL METHOD l_alv->set_table_for_first_display
EXPORTING
i_structure_name = 'SFLIGHT'
CHANGING
it_outtab = lt_sflight.
CALL SELECTION-SCREEN 1001.
或者不定义SELECTION-SCREEN,利用标准的输出屏幕
REPORT z_barry_alv_noscreen .
DATA: l_alv TYPE REF TO cl_gui_alv_grid ,
lt_sflight TYPE TABLE OF sflight .
SELECT * FROM sflight INTO TABLE lt_sflight.
CREATE OBJECT l_alv
EXPORTING
i_parent = cl_gui_container=>screen0.
CALL METHOD l_alv->set_table_for_first_display
EXPORTING
i_structure_name = 'SFLIGHT'
CHANGING
it_outtab = lt_sflight.
WRITE ' '.