1. Introduction
The statements CLEAR, REFRESH, and FREE initialize data objects, that is, they set the content of a data object to an initial value.
2.Usage
2.1 Clear
Syntax
CLEAR dobj
Effect
The data object dobj is assigned the type-specific initial value. The following applies:
• The initial values are assigned to elementary data types according to the table of built-in ABAP types.
• Reference variables are assigned null references.
• Structures are set to their initial values component by component.
• All rows in an internal table are deleted. All the memory required for the table, except for the initial memory requirement, is released (see Declaring Internal Tables). The FREE statement is used to release the memory space occupied by the rows of internal tables.
The optional additions allow you to

本文介绍了在ABAP编程中,CLEAR、REFRESH和FREE这三个命令的作用,它们用于设置数据对象(基本类型、引用变量、结构和内部表)为初始值,以及删除内部表的行并释放内存。特别指出,REFRESH仅适用于内部表,而CLEAR适用于所有数据对象,包括带头行的情况。
最低0.47元/天 解锁文章
702

被折叠的 条评论
为什么被折叠?



