这是一个层级报告,我正面临挑战。我无法弄清楚出了什么问题,我已经阅读了所有相关的博客,但是徒劳无功。请帮助我。
以下是代码:
REPORT ZTEST28.
TYPE-POOLS: SLIS.
TYPES: BEGIN OF TY_EKKO,
EBELN TYPE EBELN,
STATU TYPE STATU,
BEDAT TYPE BEDAT,
END OF TY_EKKO,
BEGIN OF TY_EKPO,
EBELN TYPE EBELN,
EBELP TYPE EBELP,
TXZ01 TYPE TXZ01,
MATNR TYPE MATNR,
END OF TY_EKPO,
TY_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA: IT_EKKO TYPE TABLE OF TY_EKKO,
IT_EKPO TYPE TABLE OF TY_EKPO.
DATA: WA_EKKO TYPE TY_EKKO,
WA_EKPO TYPE TY_EKPO,
WA_LAYOUT TYPE ty_layout.
DATA: IT_FCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_FCAT TYPE SLIS_FIELDCAT_ALV,
GS_KEYINFO TYPE SLIS_KEYINFO_ALV.
DATA: G_HEADER TYPE SLIS_TABNAME,
G_ITEM TYPE SLIS_TABNAME.
SELECT-OPTIONS: S_EBELN FOR WA_EKKO-EBELN.
INITIALIZATION.
S_EBELN-LOW = '4500000000'.
S_EBELN-HIGH = '4500000010'.
S_EBELN-SIGN = 'I'.
S_EBELN-OPTION = 'BT'.
APPEND S_EBELN.
START-OF-SELECTION.
SELECT EBELN STATU BEDAT FROM EKKO
INTO TABLE IT_EKKO
WHERE EBELN IN S_EBELN.
IF SY-SUBRC = 0.
SELECT EBELN EBELP TXZ01 MATNR FROM EKPO
INTO TABLE IT_EKPO
FOR ALL ENTRIES IN IT_EKKO
WHERE EBELN EQ IT_EKKO-EBELN.
ENDIF.
Data: LV_REPID LIKE SY-REPID.
WA_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
WA_LAYOUT-MIN_LINESIZE = 1.
wa_layout-zebra = 'X'.
WA_FCAT-FIELDNAME = 'EBELN'.
WA_FCAT-SELTEXT_L = 'Pur Doc No'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'STATU'.
WA_FCAT-SELTEXT_L = 'Status'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'BEDAT'.
WA_FCAT-SELTEXT_L = 'Date'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'EBELP'.
WA_FCAT-SELTEXT_L = 'Pur Item No'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'TXZ01'.
WA_FCAT-SELTEXT_L = 'Tax Code'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'MATNR'.
WA_FCAT-SELTEXT_L = 'Material'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
GS_KEYINFO-HEADER01 = 'EBELN'.
GS_KEYINFO-ITEM01 = 'EBELN'.
G_HEADER = 'IT_EKKO'.
G_ITEM = 'IT_EKPO'.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-CPROG
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = IT_FCAT
i_tabname_header = G_HEADER
i_tabname_item = G_ITEM
is_keyinfo = GS_KEYINFO
tables
t_outtab_header = IT_EKKO
t_outtab_item = IT_EKPO
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.
------&GT;在调用功能模块的最后,我面临这个错误。