ABAP清空内表方法

初始化内表的作用是清空内表所有的数据行,将内表恢复到填充或赋值之前的状态。初始化内表过程中需要注意之处仍然是初始化无 表头行内表和有表头行内表的区别,以及初始化内表和表头行的区别。 概述如下

1CLEAR    ITAB[].       同时清空表头和行内表的值

2CLEAR    ITAB.       只清空内表本身的值,保留表头行的值。

3REFRESH ITAB     只清空内表本身的值,保留表头行的值。

4FREE    ITAB.           只清空内表本身的值,保留表头行的值。

----------------------------------详细描述--------------------------------------------------------------- -

1.with headerline.
CLEAR itab.        : Clear the headerline of the Internal Table only.
CLEAR itab[].        : Clear the contents of the Internal Table except the headerline.
REFRESH itab.        : Same as CLEAR itab[].
REFRESH itab[].       : Same as CLEAR itab[].
2. without headerline. ( all four commands have same functionality )
CLEAR itab.        : Clear all contents of the Internal Table.
CLEAR itab[].        : Same as CLEAR itab.
REFRESH itab.        : Same as CLEAR itab.
REFRESH itab[].        : Same as CLEAR itab.

posted @ 2011-08-21 23:22  VerySky  阅读(4206)  评论(0)    收藏  举报