SAP PROTECTED ABAP Statements
Get Example source ABAP code based on a different SAP table
Standard SAP Help for PROTECTED
PROTECTED SECTION
• PROTECTED SECTION ABAP Statement
ABAP Syntax
What does it do? You can only use this statement in the
All components of the class declared in the area behind the statement
Latest notes:The class is the smallest encapsulation unit in ABAP Objects. This is the reason why a method cannot only use the protected components of the own class but also all instances of the same class.
In subclasses, it is not possible to access the protected components of the superclasses using reference variables of the type of the superclass, because otherwise an attribute of an object of the dynamic type of the superclass or another subclass could be changed. In the last case, a warning is produced by the extended syntax check.
A subclass cannot access the protected components of a subclass of a different branch of the inheritance hierarchy even though they are inherited from a shared superclass.
The declaration of attributes in the protected section does not prevent methods in subclasses or in the class itself from passing
Example ABAP Coding
See
Return to menu