CLEAR

CLEAR

Additions:

1. ... WITH g
2. ... WITH NULL


For predefined types (see DATA ), the following initial values are used:

Type C: ' ... ' (blank character)

Type N: '00...0'

Type D: '00000000'

Type T: '000000'

Type I: 0

Type P: 0

Type F: 0.0E+00

Type X: 0

If f is a field string, each component field is reset to its initial value. If it is an <DS.ABEN.ITAB> internal table without a header line, the entire table is deleted together with all its entries. If, however, f is an internal table with a header line, only the sub-fields in the table header entry are reset to their initial values.

Example

DATA: TEXT(10)	 VALUE 'Hello', 
	NUMBER TYPE I  VALUE 12345, 
	ROW(10) TYPE N VALUE '1234567890', 
	BEGIN OF PLAYER, 
		NAME(10)	VALUE 'John', 
		TEL(8) TYPE N VALUE '08154711', 
		MONEY  TYPE P VALUE 30000, 
	END   OF PLAYER. 
... 
CLEAR: TEXT, NUMBER, PLAYER.

The field contents are now as follows:

ROW = '1234567890'
TEXT = ' '
NUMBER = 0
PLAYER-NAME = ' '
PLAYER-TEL = '00000000'
PLAYER-MONEY = 0

When CLEAR itab references an internal table itab with a header line, it only resets the sub-fields in the header entry to their initial values (as mentioned above). The individual table entries remain unchanged.
To delete the entire internal table together with all its entries, you can use CLEAR itab[] or REFRESH itab.

Effect

The field f is filled with the value of the first byte of the field g.

Note

You should use this addition with particular care because the fields of most data types thus receive values which are really invalid.

The runtime required to reset a field, a structure or the header line of an internal table increases with the size of the object. Resetting a field with type C and length 10 takes about 3 <DS.ABEN.MICROSECONDS_NORM>msn (standard microseconds); with length 100, this is around 8 msn, and with length 10000 around 60 msn.