log_exp - IS BOUND

Syntax

... operand IS [NOT] BOUND ...

Effect

The logical expression checks whether a reference variable contains a valid reference. For operand, you must specify a data object defined with addition REF TO or a functional method, whose return value is typed with REF TO.

A data reference is valid if it can be dereferenced. An object reference is valid if it points to an object.

When using addition NOT, the expression is true if the reference variable does not contain a valid reference.

Note

An object reference variable that contains another reference as a null reference, is always valid, because it keeps the object alive. A data reference variable that contains another reference as a null reference, can become invalid, if the referenced data object is removed from the memory, for example, because its context (procedure, object) is deleted.

Example

The logical expression in the IF statement is false. The data reference dref contains a reference to a deleted table row.

DATA: dref TYPE REF TO data,
      itab TYPE TABLE OF ...

FIELD-SYMBOLS <fs> TYPE ANY.

READ TABLE itab REFERENCE INTO dref
           WITH ...

...

CLEAR itab.

...

IF dref IS BOUND.
  ASSIGN dref->* TO <fs>.
ENDIF.