Get Example source ABAP code based on a different SAP table
ID FREE-DATA • FREE ABAP Statement
FREE> Short Reference >
ABAP_SYNTAX FREE dobj.>
What does it do? The statement FREE> deletes all lines from an internal table and releases the complete memory area that was occupied by the lines, including the initial memory requirement >. On other data objects, FREE> works like the statement CLEAR>>. If dobj> is a structure with tabular components, the memory of all the tabular components is released.
Latest notes:
If dobj> is an internal table with a header line>, FREE> only affects the table body> and not the header line.
Unlike CLEAR>, the initial memory requirement> does not remain occupied when FREE> is used. This can become necessary when there is a lack of memory.
In general, FREE> should only be used if the entire memory is to be released completely and the internal table is no longer needed or at the least not filled again immediately.
See also Memory Requirements of Deep Data Objects>. NON_V5_HINTS ABAP_HINT_END
ABAP_EXAMPLE_VX At the breakpoints in the memory analysis> of the ABAP debugger, it can be observed that FREE> releases more allocated bound memory than CLEAR>. ABEXA 00287 ABAP_EXAMPLE_END
ABAP_EXAMPLE_V5 At the breakpoints in the memory analysis> of the ABAP debugger, it can be observed that FREE> releases more allocated bound memory than CLEAR>. Note that in the restricted language scope breakpoints are not allowed but left here as comments for more clarity. ABEXA 01624 ABAP_EXAMPLE_END