我得到此语法错误:
" wa_1"不能转换为" it_1"的行类型
我正在尝试从内部表中显示内容,如下所示:
REPORT ZSAM.
DATA: ITable Type ZMUAZ_STRUCTURE OCCURS 10,
IT_1 Type ZSTRUCT1 OCCURS 10,
IT_2 Type ZSTRUCT2 OCCURS 10,
WA_1 like IT_1,
WA_2 like IT_2,
WA_3 like ITable.
WRITE: 'vbeln', 'vtweg', 'posnr', 'matnrr','vrkme'.
select vbeln audat netwr waerk vkorg vtweg from VBAK into corresponding fields of Table IT_1.
LOOP AT IT_1 INTO WA_1.
write: / WA_1-vbeln, WA_1-audat, WA_1-netwr, WA_1-waerk, WA_1-vkorg, WA_1-vtweg.
endloop.
任何想法如何解决此错误?
wa_1
被声明为内部表(不是工作区域(。最简单的解决方案是用LINE OF
完成声明:
... wa_1 LIKE LINE OF it_1,
但是,像您对OCCURS
一样宣布内部表格和工作区域已过时,其现代等效物是STANDARD TABLE OF
:
DATA: it_1 TYPE STANDARD TABLE OF zstruct1,
wa_1 TYPE zstruct1.