DATA f.
... TYPE REF TO cif
Data object f is declared as reference
variable within ABAP objects. cif
is a class or an interface. Reference variables
contain references (pointers) to objects.
Reference variables
whose types are defined with reference to a class can contain references to objects of this class. Reference
variables whose types are defined with reference to an intterface can contain references to objects whose class implements the interface.
Objects, i.e.instances of classes, are only addressed with their reference variables. To create objects see CREATE OBJECT.
INTERFACE i1.
METHODS m1.
ENDINTERFACE.
CLASS c1 DEFINITION.
PUBLIC
SECTION.
INTERFACES i1.
ENDCLASS.
CLASS c1 IMPLEMENTATION.
METHOD i1~m1.
...
ENDMETHOD.
ENDCLASS.
DATA: o1 TYPE REF TO c1,
o2 TYPE REF TO c1,
ir
TYPE REF TO i1.
START-OF-SELECTION.
CREATE OBJECT o1.
o2 = o1.
ir = o1.
Handling of Objects
Special variants of other keywords