0% found this document useful (0 votes)
107 views2 pages

ABAP Class Visibility Explained

Each ABAP class has three visibility sections - public, protected, and private - that control access to the class's components. The public section can be accessed from inside or outside the class. The protected section can be accessed from inside the class or subclasses. The private section can only be accessed from inside the class. These sections must be defined in the order of public, protected, and private sections.

Uploaded by

Pankaj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
107 views2 pages

ABAP Class Visibility Explained

Each ABAP class has three visibility sections - public, protected, and private - that control access to the class's components. The public section can be accessed from inside or outside the class. The protected section can be accessed from inside the class or subclasses. The private section can only be accessed from inside the class. These sections must be defined in the order of public, protected, and private sections.

Uploaded by

Pankaj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

 

C) Visibility Components of the Class: 

Each Component of a class must have a Visibility. In ABAP Classes, the whole class
definition is divided into three visibility sections.

1. Public Section
2. Protected Section
3. Private Section

CLASS <class_name> DEFINITION.

PUBLIC SECTION.

……..

PROTECTED SECTION.

……………

PRIVATE SECTION.

………..
END CLASS.
Public section: 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 section: 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 Section: 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.

Please note: They (Public/Protected/Private) have to be defined in the order shown


above.

You might also like