ABAP Keyword Documentation →  ABAP − Reference →  Declarations →  Declaration Statements →  Classes and Interfaces →  ABAP Objects - Overview →  Statements in ABAP Objects → 

Statements in Class and Interface Pools

Class pools and interface pools are the ABAP programs in the class library. They are defined using Class Builder tool in ABAP Workbench and are used as a repository for global classes and interfaces.

These statements are generated by Class Builder.

Each class pool or interface pool can only contain a single global class or a single global interface. These classes or interfaces are declared using the following statements:

Class Builder uses the properties entered here to generate these statements.

Further Statements in Class Pools

As well as the declaration of the global class, a class pool can only contain the following statements:

Locally defined types, classes, and interfaces in class pools can be used in the following ways:

Further Statements in Interface Pools

In addition to the declaration of the global interface, an interface pool cannot contain any of its own declarations or implementations.

Program Organization

Like any other ABAP program, class pools and interface pools consist of a global declaration part for declarations and an implementation part for implementations (or procedures).

The Class Builder organizes the various declarations and implementations of a class pool or interface pool in include programs. The developer cannot usually view the names of these programs. A Class Builder function allows you to open the associated include programs in ABAP Editor and edit them. Include programs exist for:

To edit the global class, Class Builder provides you with both editing functions for the individual include programs and a source code-based mode in which you can display all the include programs as a single program and edit them.

Restrictions

Apart from the statements listed above, statements other than CLASS - ENDCLASS and INTERFACE - ENDINTERFACE are neither required in class pools and interface pools nor are they permitted. The stricter syntax of ABAP Objects applies to all statements permitted.

The following restrictions are particularly important:

Neither event blocks such as START-OF-SELECTION, AT SELECTION-SCREEN, GET, or AT LINE-SELECTION nor dialog modules (defined by MODULE - ENDMODULE) are permitted. This means that runtime environment events cannot be processed. ABAP Objects has its own event concept. Neither function modules nor subroutines can be defined using FUNCTION - ENDFUNCTION or FORM - ENDFORM. The methods of a class pool can still call external function modules and subroutines, as well as methods.
The statements TABLES and NODES and the addition COMMON PART of the DATA statement are not possible. This means that class pools and interface pools do not support any global data areas across programs within a single internal mode.
Screen processing as implemented in other ABAP programs is not possible. No screens can be defined in a class pool or interface pool. If you want to use classic screens, including selection screens, we recommend that you encapsulate them in function groups. We recommend that you use other suitable output media instead of classic lists. For table list output, use the classes of SAP List Viewer (ALV), such as CL_SALV_TABLE. For simple text output, we recommend browser control wrappers such as dynamic documents or text edit control wrappers.
Extract data sets cannot be edited in global classes since the defining statement FIELD-GROUPS is not permitted in class or interface pools.