Get Example source ABAP code based on a different SAP table
ABAP_RELEXP > - Comparing Reference Variables It is possible to compare data references with data references and object references with object references, but it is not possible to compare data references with object references. Two reference variables are identical if they point to the same object. Size comparisons are defined internally and always produce similar results in similar situations. The null reference> in an initial reference variable is always smaller than any non-initial reference. However, a non-initial invalid reference that no longer points to an object cannot be compared. A comparison with a non-initial invalid reference always produces an uncatchable exception.
Latest notes:
For data references to be identical, the data type of the referenced objects must be compatible> and it is not enough for the operands just to contain the same reference. If, for example, two reference variables contain the same memory address, with one pointing to a structure and the other to the first component of the structure, 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>.
The fact that non-initial invalid references cannot be compared affects all operations with internal tables where comparisons take place, for example, WHERE> conditions, sorts, or accesses using a sorted key. If a comparison with a non-initial invalid reference takes place, a runtime error occurs. NON_V5_HINTS ABAP_HINT_END
ABAP_EXAMPLE_VX5 The following comparisons are both true. Although all references created with the reference operator REF> point to the same data object in the memory, the reference created using < fs2>> is not equal to the other two because it references another data type. ABEXA 01113 ABAP_EXAMPLE_END