Show TOC

 Creating Local Definitions and ImplementationsLocate this document in the navigation structure

Use

The Class Builder creates a global class in an ABAP program of type class pool. A class pool can contain exactly one global class. But like any other ABAP program, a class pool can contain further declarations and implementations that are not part of the global class. Compared to other program types, the declarations and implementations that are possible in class pool are restricted to the following list of statements.

Outside the global class, you can use the following statements in a class pool:

  • TYPE-POOLS to declare type groups from the ABAP Dictionary.
  • TYPES to declare local data types in the class pool. The global class can refer to these types in the declarations of its private visibility section and in its implementation part.
  • INTERFACE  … ENDINTERFACEto declare local interfaces in the class pool. The global class can refer to these interfaces in the declarations of its private visibility section and in its implementation part.
  • CLASS  … ENDCLASS to declare and implement local classes in the class pool. The global class can refer to and use these classes in the declarations of its private visibility section and in its implementation part.
  • DEFINE  … END-OF-DEFINTIION (obsolete) to define macros. The global class can use these macros in its implementation part.
    Note

    Local definitions, especially local classes, can be useful as auxiliary classes for the global class. In local classes you can encapsulate implementation details that should not be visible from the outside (they should not even occur in the private section).

The Class Builder organizes local definitions and implementations in special include programs that you can edit by selecting the appropriate function. There are include programs for:

Procedure
  1. Open the class you want to edit in the Class Builder.
  2. Choose Goto →Local Definitions/Implementations
  3. Choose the Include program that you want to maintain.