Get Example source ABAP code based on a different SAP table
ID REFRESH • REFRESH ABAP Statement
REFRESH> Short Reference >
ABAP_SYNTAX_OBS REFRESH itab.>
What does it do? This statement deletes all lines in an internal table itab>. This releases the memory space required for the table, except for the initial memory requirement>. The operand itab> must be an internal table. The statement FREE>> can be used to delete all lines and release all memory occupied by these lines including the initial memory requirement. System Fields> This statement always sets sy-subrc> to 0.
Latest notes:
The statement REFRESH itab> has the same effect on internal tables as CLEAR itab[]>>. If the internal table itab > has a header line >, the table body> is initialized and not the header line.
If the internal table itab> does not have a header line, REFRESH itab> has the same effect as CLEAR itab>. The use of tables with header lines is obsolete and forbidden in classes, which makes the use of REFRESH> instead of CLEAR> obsolete too. CLEAR>> or FREE> > can always be used to delete lines in internal tables. ABAP_HINT_END
Example ABAP Coding
The following example shows that REFRESH> initializes the table body but not the header line of an internal table itab>. ABEXA 01460 ABAP_EXAMPLE_END