ABAP Keyword Documentation → ABAP − Reference → Processing External Data → Data Cluster
FREE MEMORY
Other versions: 7.31 | 7.40 | 7.54
Syntax
FREE MEMORY ID id.
Effect
This statement has the same effect as the statement
The addition ID
can be omitted outside of classes. In this case, all
data clusters are deleted from the
ABAP Memory.
Note
The use of FREE MEMORY
without the addition ID
is
obsolete. While the statement EXPORT
without addition ID
involves only one data cluster, in this case all clusters
are involved. It is safest to use the statement DELETE FROM
, because here the addition ID
is mandatory.
Example
Deletes the data cluster with the ID demo from the ABAP memory.
DATA(dobj) = `xxx`.
EXPORT contents = dobj TO MEMORY ID 'demo'.
IMPORT contents = dobj FROM MEMORY ID 'demo'.
ASSERT sy-subrc = 0.
FREE MEMORY ID 'demo'.
IMPORT contents = dobj FROM MEMORY ID 'demo'.
ASSERT sy-subrc = 4.