CLEAR内表的用法

 

Like all data objects, you can initialize internal tables with the

 

CLEAR <itab>.

和其它数据对象一样,你可以用CLEAR <ITAB> 语句来初始化内表。

statement. This statement restores an internal table to the state it was in immediately after you declared it. This means that the table contains no lines. However, the memory already occupied by the memory up until you cleared it remains allocated to the table.

这条语句将内表恢复到你声明它的时候的状态。这就意味着内表中没有表行。尽管如此,先前被占用而未被释放的内存将仍分配给内表。

If you are using internal tables with header lines, remember that the header line and the body of the table have the same name. If you want to address the body of the table in a comparison, you must place two brackets ([ ]) after the table name.

CLEAR <itab>[].

如果你使用的是带有表头的内表,请注意,表头行和内表有相同的名字,相比之下,你要想使用内表(而不是表头行),你必须要在表名后加两个中括号。CLEAR <ITAB>[]

To ensure that the table itself has been initialized, you can use the

REFRESH <itab>.

statement. This always applies to the body of the table. As with the CLEAR statement, the memory used by the table before you initialized it remains allocated. To release the memory space, use the statement

FREE <itab>.

为了确保内表本身(而不是表头行)已经被初始化,你可以用REFRESH <ITAB> 语句。这个语句总是应用于内表本身,和CLEAR 语句一样,在你初始化内表以前内表的内存仍被分配给该内表。要想释放内存空间,请作用:FREE <ITAB>语句。

You can use FREE to initialize an internal table and release its memory space without first using the REFRESH or CLEAR statement. Like REFRESH, FREE works on the table body, not on the table work area. After a FREE statement, you can address the internal table again. It still occupies the amount of memory required for its header (currently 256 bytes). When you refill the table, the system has to allocate new memory space to the lines.

你可以用FREE来初始化一个内表并释放它的内存空间而不必使用REFRESH 或者CLEAR语句,像REFRESH,FREE,作用于内表体,而不是表头工作区,使用FREE以后,你就可以重新使用这个内表。它仍旧只占用表头所需的256bytes内存。当你重新填充内表时,系统不得不给表行分本新的内存空间。

 

注:对于带有表头行的内表,要特殊对待,CLEAR <ITAB> 只是清空表头,CLEAR <ITAB>[] 才可以清空表体本身。

 

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值