ABAP编程中对内表的定义,后面接一个OCCURS (n)是代表什么意思.
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/19 17:28:29
ABAP编程中对内表的定义,后面接一个OCCURS (n)是代表什么意思.
ABAP编程中对内表的定义,后面接一个OCCURS (n)是代表什么意思.
ABAP编程中对内表的定义,后面接一个OCCURS (n)是代表什么意思.
对内表的定义,我只说下有没occurs的区别.
*
*DATA:BEGIN OF itab OCCURS 0,
* matnr LIKE mara-matnr,
* maktx LIKE makt-maktx,
* END OF itab.
*
*SELECT * FROM makt INTO CORRESPONDING FIELDS OF TABLE itab .
*
*LOOP AT itab.
* WRITE:/
* itab-matnr,
* itab-maktx.
*ENDLOOP.
DATA:BEGIN OF itab,
matnr LIKE mara-matnr,
maktx LIKE makt-maktx,
END OF itab.
DATA it_itab LIKE TABLE OF itab.
SELECT * FROM makt INTO CORRESPONDING FIELDS OF TABLE it_itab .
LOOP AT it_itab INTO itab.
WRITE:/
itab-matnr,
itab-maktx.
ENDLOOP.
这是我写的1点特别简单的很基础的代码.
简单的看出了,带有OCCURS的这个关键字的内表,有表存储还有表输出.就是说,它可以不用再次的写like table of 内表.这样做的目的,就是它有存储功能.如果没有occurs,就只有输出显示的功能,只是1个结构.有occurs,就是可以存储了.