请问一下下面的ABAP程序出现了什么错误,应该怎样修改? .

来源:百度知道 编辑:UC知道 时间:2024/05/29 07:01:48
REPORT ZTESTWRG021 .
data:begin of line,
num type i,
sqr type i,
end of line.
types itab type standard table
of line
with non-unique key line.
do 5 times.
line-num = sy-index.
line-sqr = sy-index ** 2.
append line to itab.
enddo.
loop at itab into line.
write: / line-num,line-sqr.
endloop.
clear itab.

REPORT ZTESTWRG021 .

TYPES:BEGIN OF line,
num TYPE i,
sqr TYPE i,
END OF line.

DATA: itab TYPE STANDARD TABLE OF line WITH NON-UNIQUE KEY num,
wa LIKE LINE OF itab.

DO 5 TIMES.
wa-num = sy-index.
wa-sqr = sy-index * 2.
APPEND wa TO itab.
ENDDO.

LOOP AT itab INTO wa.
WRITE: / wa-num,wa-sqr.
ENDLOOP.

REFRESH itab.