Resetting Values to Their Initial Value
To reset a variable <f> to the appropriate initial value for its type, use the statement
CLEAR <f>.
This statement has different effects for different data types:
The CLEAR statement sets the value of an elementary variable to the initial value specified for its type (see the table in
The CLEAR statement resets a reference variable to its initial value, that is, so that it does not point to an object.
The CLEAR statement resets the individual components of a structure to their respective initial values.
The CLEAR statement deletes the entire contents of an internal table (see also
You cannot use the CLEAR statement to reset a constant.
DATA NUMBER TYPE I VALUE '10'.
WRITE NUMBER.
CLEAR NUMBER.
WRITE / NUMBER.
The output appears as follows:
10
0
The CLEAR statement resets the contents of the field NUMBER from 10 to its initial value 0.