Class and interface pools are the ABAP programs of the class library. They are exclusively defined with the Class Builder of the ABAP Workbench and are used to store global classes and interfaces. Class pools have the program type K, while interface pools have the program type J. A class pool can contain only one global class, and an interface pool can contain only one global interface.
Like any other ABAP program, class and interface pools consist of a global declaration section and processing blocks. The global declaration part of a class pool is made up of a definition section in which you can define data types, interfaces and classes local in the program, and the actual declaration section of the global class. The global declaration section of an interface pool consists only of the definition of the global interface.
In class and interface pools, you use the statements for defining classes and interfaces to define the local and global classes or interfaces. Outside the definition of classes and interfaces, you can only use the following statements:
TYPE-POOLS ...
Use this statement to declare type groups from the ABAP Dictionary. From this point onwards, you can refer to the corresponding types anywhere in the class pool.
TYPES ...
Use this statement to define data types local in the program. These types are only visible in the implementation section of the global class.
TYPE-POOLS ...
Use this statement to declare type groups from the ABAP Dictionary to use them in the interface for typing components. In interface pools, however, you cannot define types local in the program.
Besides the statements above, no other statements are necessary outside CLASS - ENDCLASS and INTERFACE - ENDINTERFACE and are therefore not permitted. The statements permitted are subject to the restricted syntax rules of ABAP Objects.
This has the following effects: