SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
ABAP Keyword Documentation →
ABAP − Reference →
Declarations →
Declaration Statements →
Classes and Interfaces →
CLASS →
CLASS - DEFINITION →
PRIVATE SECTION 
Syntax
PRIVATE SECTION.
Effect
This statement can only be used in the declaration part of a class. It defines the private
visibility section
of the class class. All components of the class defined in the section behind the PRIVATE SECTION statement can only be addressed in the class itself, and in its
friends.
Notes
-
The class is the smallest encapsulation unit in ABAP Objects. This means that a method can use all private
components of all instances of the same class, apart from the private components of its own class. An exception to this rule are subclasses that cannot access the private components of superclasses, if they are not their
friends.
-
The declaration of attributes in the private section does not stop methods of the
References class from declaring externally to these attributes in the form of
reference variables or
field symbol, and therefore making the attributes visible and modifiable outside the private section.
-
Private components declared in a class but not used statically there produce a warning in the extended program check.
-
Private attributes are the only attributes for which the declaration of the addition
READ ONLY is not required and therefore can not be specified.
Example
See Visibility Sections.