Ansicht
Dokumentation

ABAPDATA_REF_TO_INCLUDE - DATA REF TO INCLUDE

ABAPDATA_REF_TO_INCLUDE - DATA REF TO INCLUDE

ABAP Short Reference   General Material Data  
This documentation is copyright by SAP AG.
SAP E-Book

Effect

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.

Note

Objects, i.e.instances of classes, are only addressed with their reference variables. To create objects see CREATE OBJECT.

Example

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.

Additional help

Handling of Objects






Fill RESBD Structure from EBP Component Structure   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.

Length: 1907 Date: 20240329 Time: 125040     sap01-206 ( 30 ms )