SAP INHERITANCE VISIBILITY
Get Example source ABAP code based on a different SAP table
ABAP_OBJ - Inheritance and Visibility
It is not possible to change the
Public Components
The public visibility area of a subclass consists of all its own public components plus the public components of all its superclasses. Public components are visible externally without restrictions.
Protected Components
The protected visibility section of a subclass consists of all its own protected components plus the protected components of all superclasses. The protected section is only visible in the class itself and in all its subclasses. Externally, protected is the same as private.
Private Components
The private visibility section of a subclass includes only the private components of this class. They are visible only in this class. The private components of superclasses cannot be used in subclasses. Only methods inherited from superclasses use private attributes of the superclass that were not redefined, even if the subclass has private attributes with the same name.
Example of Protected Components
Within a subnode in the inheritance tree, the protected components of superclasses can always be accessed. The classes involved, such as the static types of reference variables, must however be part of the inheritance tree.
In the following example, the reference variables
BEGIN_SECTION VERSION 5 OUT and it causes a warning from the extended program check
END_SECTION VERSION 5 OUT .