首页 > 代码库 > 简单的ALV

简单的ALV

*定义内表
DATA WA_SPFLI LIKE TABLE OF SPFLI WITH HEADER LINE.
*内表赋值
SELECT * INTO TABLE WA_SPFLI FROM SPFLI.
*通过数据字典结构显示ALV
CALL FUNCTION ‘REUSE_ALV_LIST_DISPLAY‘
EXPORTING
I_STRUCTURE_NAME = ‘SPFLI‘
TABLES
T_OUTTAB = WA_SPFLI
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

简单的ALV