Classes and Interfaces
This section describes the definition of classes and
interfaces and of their
components. Classes and interfaces form the basis for
ABAP Objects, the object-oriented part of the ABAP language. Classes and interfaces can be defined in ABAP programs of the following
program types:
- In a class pool, you use the
Class Builder tool of the
ABAP Workbench to define exactly one
global class of the class library, which can then be used in all other ABAP programs. In the global
declaration section of a class pool, you can individually define local data types, classes and interfaces to tbe used in the class pool and make
type groups known. Apart from the
TYPES and TYPE-POOLS statements, in class pools no other statements are allowed outside of classes and interfaces.
- In an interface pool, you use
the Class Builder tool of the ABAP Workbench to define exactly one global interface of the class library
to be used in all other ABAP programs. In the global declaration section of an interface pool, you are
not allowed to define local data types, classes and interfaces. You can declare type groups. Apart from
the statement TYPE-POOLS, in interface pools no other statements are allowed outside of the global interfaces.
- In all other ABAP programs, except type groups, you can define local classes and interfaces to be used in the program itself.
Apart from the TYPES and TYPE-POOLS
statements, in class and interface pools no other statements are allowed outside of CLASS - ENDCLASS or INTERFACE - ENDINTERFACE.