1. 程式人生 > >根據表名或結構名獲取alv fieldcat

根據表名或結構名獲取alv fieldcat

當ALV類顯示時,可以根據結構名而獲得對應的fieldcatalog

設定ALV的輸出的欄位

CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'

EXPORTING

i_structure_name = 'YZGZ_001_STR' 這裡也可以是表名

CHANGING

ct_fieldcat      = gt_fieldcat_0100.

當做CALL FUNCTION顯示時,可以根據結構名而獲得對應的fieldcatalog

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_internal_tabname = v_items_itable

i_structure_name = v_items_table

CHANGING

ct_fieldcat = gt_fieldcat.