SAP OBJECT REFERENCE TYPE



Get Example source ABAP code based on a different SAP table
  



Object References
Object references can point to instances of classes. The static type of their reference variables is either a class or an interface. Both types can be used to create objects with the statement CREATE OBJECT.
Class reference variables allow access to all visible components of a class.
Interface reference variables restrict the view of the interface components of a class.
If an attempt is made to access an instance attribute using an object reference variable that contains the null reference, an uncatchable exception is raised. A catchable exception is raised when an instance method is called.
Object references are always heap references.



Latest notes:

For more information, see Object References.
NON_V5_HINTS
ABAP_HINT_END

ABAP_EXAMPLE_VX5
Inline declaration of an object reference variable out with the static type IF_DEMO_OUTPUT on the left side of an object of the class CL_DEMO_OUTPUT created using its factory method NEW. Calling of the method DISPLAY using the object component selector.
ABEXA 01180
ABAP_EXAMPLE_END