Ansicht
Dokumentation

ABENINSTANCE_OF_ABEXA - INSTANCE OF ABEXA

ABENINSTANCE_OF_ABEXA - INSTANCE OF ABEXA

TXBHW - Original Tax Base Amount in Local Currency   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.
SAP E-Book

- Predicate Expression IS INSTANCE OF

This example demonstrates the predicate expression IS INSTANCE OF.

Source Code

Execute

Description

A class c1 contains the interface intf and is the superclass of a class c2. For reference variables of the static types object, intf, c1, and c2, this example demonstrates the behavior of the predicate expression IS INSTANCE OF if these variables point to instances of c1 or c2 or are initial.

If the object reference variable is non-initial, the predicate expression is always true if a downcast to the comparison type is possible. If the object reference variable is initial, the predicate expression is true only if an upcast is possible. This example checks a generically typed field symbol for which this can only be determined at runtime.

For an initial reference variable with the static type object, the result of the expression for all comparison types except for object is false. For an initial reference variable with the static type intf, the result of the expression for all comparison types except for the interface intf is itself false.






SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up   ABAP Short Reference  
This documentation is copyright by SAP AG.

Length: 1694 Date: 20240426 Time: 115017     sap01-206 ( 37 ms )