Visibility of OOABAP Components

in OOABAP, Each class component has a visibility. The whole class definition is separated into three visibility sections:

  • PUBLIC : Data declared in public section can be accessed by the class itself, by its subclasses as well as by other users outside the class.
  • PROTECTED :  Data declared in the protected section can be accessed by the class itself, and also by its subclasses but not by external users outside the class.
  • PRIVATE: Data declared in the private section can be accessed by the class only, but not by its subclasses and by external users outside the class.
CLASS  <class_name> DEFINITION. 
PUBLIC SECTION: 
CLASS-METHODS :....
CLASS-DATA:...
METHODS:....
DATA:....
PROTECTED SECTION: 
METHODS:....
DATA:....
PRIVATE SECTION: 
METHODS:....
DATA:....
ENDCLASS.
Comments