1定义变量
GS_LAYOUT TYPE SLIS_LAYOUT_ALV.
2 如何调用'REUSE_ALV_GRID_DISPLAY'传入GS_LAYOUT变量
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_BACKGROUND_ID = 'ALV_BACKGROUND'
I_CALLBACK_PROGRAM = G_REPID
I_STRUCTURE_NAME = 'SFLIGHT'
IS_LAYOUT = GS_LAYOUT
IT_FIELDCAT = GT_FIELDCAT[]
* IT_EXCLUDING =
IT_SPECIAL_GROUPS = GT_SP_GROUP[]
IT_SORT = GT_SORT[]
* IT_FILTER =
* IS_SEL_HIDE =
* i_default = g_default
I_SAVE = G_SAVE
IS_VARIANT = G_VARIANT
IT_EVENTS = GT_EVENTS[]
* IT_EVENT_EXIT =
IS_PRINT = GS_PRINT
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
TABLES
T_OUTTAB = GT_SFLIGHT.
3通过GS_LAYOUT来设置Grid的字段列宽度自动适应
GS_LAYOUT-COLWIDTH_OPTIMIZE = 'X'
4通过GS_LAYOUT来设置Grid的行颜色变换显示
GS_LAYOUT-ZEBRA = 'X'
5通过GS_LAYOUT来设置Grid的多行选择列
GS_LAYOUT-BOX_FIELDNAME= 'BOX'
其中BOX必须为内表的一列,为一个字符长度
6通过GS_LAYOUT来设置Grid是否显示列分割线
GS_LAYOUT-NO_VLINE= 'X'
7通过GS_LAYOUT来设置Grid合计行显示在明细的上面
GS_LAYOUT-TOTALS_BEFORE_ITEMS= 'X'
8通过GS_LAYOUT来设置Grid不显示弹出明细显示窗口
GS_LAYOUT-DETAIL_POPUP= 'X'
9通过GS_LAYOUT来设置Grid显示LED列
GS_LAYOUT-excp_fname= 'LIGHT'
LIGHT为内表字段,一个字符长,值范围为1-3