Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Program Flow Logic →  Expressions and Functions for Conditions →  log_exp - Logical Expressions →  rel_exp - Comparison Expressions →  rel_exp - Comparison Rules 

rel_exp - Comparing Reference Variables

It is possible to compare data references to data references, and object references to object references, but not data references to object references. Two reference variables are identical if they point to the same object. A comparison of size is defined internally and always delivers the same results in similar situations.

Other versions: 7.31 | 7.40 | 7.54


For data references to be identical it is not enough for the operands to contain the same reference. Instead, the data type of the objects references must be compatible. If, for example, two reference variables have the same memory address, and one points to a structure, the other to the first component of the structure, then these variables are not identical since the data type of the operands is incompatible. Reference variables filled using GET REFERENCE might not be identical, even though they point to the same data object, if GET REFERENCE or the reference operator REF is executed for a field symbol to which the data object was assigned using casting.