ALV 動態顯示列Demo
阿新 • • 發佈:2019-01-05
*-------------ALV
相關--------------------------
DATA
:
wa_layo
TYPE
lvc_s_layo.
DATA
:
wa_fcat
TYPE
lvc_s_fcat,
it_fcat
TYPE
lvc_t_fcat.
DATA
it_scol
TYPE
lvc_t_scol.
DATA
:
g_grid
TYPE
REF
TO
cl_gui_alv_grid.
FIELD
-
SYMBOLS
:
< dyn_table >
TYPE
STANDARD
TABLE
,
<
dyn_wa >,
<
dyn_field >.
DATA
:
dy_table
TYPE
REF
TO
data,
dy_line
TYPE
REF
TO
data.
DATA
:
colname(10),
index(2).
*
列數
PARAMETERS
:
col
TYPE
i.
CLEAR
:
it_fcat.
*
根據條件動態生成列
DO
col TIMES.
index
= index + 1.
CONCATENATE
'COL'
index
INTO
colname.
PERFORM
frm_add_fcat
USING
:
colname
'C'
'描述'
'100'
.
ENDDO
.
*
根據it_fact生成動態表
CALL
METHOD