Get Example source ABAP code based on a different SAP table
ABAP_OBJ - Accessing Class Components When accessing class components, there is a difference between access from inside and outside of the same class. In internal access, that is, within a method of the same class, the name of the component is sufficient. In external access, the object, in the case of instance components, and the class, in the case of static components, must be specified using an object component selector> or class component selector>. Here, a distinction can be made between static and dynamic variants. For static access, object reference variables can only be used to access components that are known to the reference variable. These are the components that are available in the static type of the reference variable (class or interface). Class reference variables that are typed with reference to a superclass but point to subclasses know only the superclass components and the interface references know only interface components. With dynamic access, the dynamic type is used to determine the component for class reference variables. This is the type of the object to which the reference refers, and not the type used for typing the reference. For interface reference variables the static type is also used for dynamic access, that is, the type that was used to type the reference. This means that in dynamic access, reference variables that are typed with reference to a superclass and that point to subclasses can be used to access any component of the subclass for which dynamic access is possible. In particular, reference variables of the type REF TO OBJECT> can be used to access components dynamically. Dynamic access does not allow interface reference variables to be used to access class-specific components and only the corresponding interface components can be accessed. It is not possible to access class-specific components using interface reference variables because the prefix intf~> is always used implicitly when interface reference variables are used.