Ansicht
Dokumentation

ABENCLASS_INTERACE_POOLS - CLASS INTERACE POOLS

ABENCLASS_INTERACE_POOLS - CLASS INTERACE POOLS

Vendor Master (General Section)   Fill RESBD Structure from EBP Component Structure  
This documentation is copyright by SAP AG.
SAP E-Book

- Statements in Class Pools and Interface Pools

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

These statements are generated by the Class Builder.

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

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

Further Statements in Class Pools

In addition to the declaration of the global class, a class pool can only contain the following statements:

  • Declaration of local data types using the statement TYPES. These data types can be used by the global class in the private visibility section and in the implementation part.
  • Declaration of local constants using the statement CONSTANTS. These data types can be used by the global class in the private visibility section and in the implementation part.
  • Declaration of local interfaces using the statements INTERFACE ... ENDINTERFACE. These can be used by the global class in the private visibility section and in the implementation part.
  • Declaration and implementation of local classes using the statements CLASS ... ENDCLASS. These can be used by the global class in the private visibility section and in the implementation part.

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

  • Only the methods of the global class access the local declarations and implementations in the program. These provide auxiliary methods, for example, which should not be visible in the interface of the global class. This is the most common scenario. Any changes made to local declarations in the program do not affect the interface of the global class.
  • Apart from the methods of the global class, declarations in the private visibility section of the class also refer to the local declarations in the program. This is a more unusual scenario, in which changes made to the local declarations affect the interface of the global class and subclasses, and friends of the global class are recompiled before the next execution.

Further Statements in Interface Pools

In addition to the declaration of the global interface, an interface pool cannot contain its own declarations or implementations. The obsolete statement TYPE-POOLS is also syntactically possible.

Program Organization

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

  • The global declaration part of a class pool can therefore contain the declarations of local data types, local interfaces, and local classes, in addition to the actual declaration part of the global class. The implementation part of a class pool can contain the implementation parts of local classes in addition to the implementation part of the global class.
  • The global declaration part of an interface pool can only contain the declaration of the global interface and the implementation part of an interface pool is always empty.

The ABAP Development Tools (ADT) or Class Builder organize the various declarations and implementations of a class or interface pool in include programs whose names are usually not visible to the developer. A function in Class Builder enables the associated include programs to be opened and edited in the ABAP Editor. Include programs exist for:

  • Each visibility section in the declaration part of the global class
  • Each implementation of a method of the global class
  • Local declarations and implementations
  • Test classes in ABAP Unit

To edit the global class, the Class Builder provides a source code-based mode in which all the include programs can be displayed and edited as a single program, in addition to the processing of the individual programs.

Apart from the statements listed above, no statements other than CLASS - ENDCLASS and INTERFACE - ENDINTERFACE are required and are therefore not allowed in class pools. The stricter syntax of ABAP Objects applies to all allowed statements.

The following restrictions are particularly important:

  • No processing blocks except methods
Event blocks such as START-OF-SELECTION, AT SELECTION-SCREEN,GET, or AT LINE-SELECTION and dialog modules defined by MODULE - ENDMODULE are not allowed. This means that runtime framework events cannot be processed. ABAP Objects has its own event concept for this. 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 in addition methods.
  • No interface work areas to other programs
The statements TABLES and NODES and the addition COMMON PART of the DATA statement are not possible. This means that class and interface pools do not support any global data areas across programs within an internal session.
Screen processing as performed in other ABAP programs is not possible. No dynpros can be defined in a class pool or interface pool. If classic dynpros, including selection screens, are required, it is best to encapsulate them in function pools. It is recommended that other suitable output media instead of classic lists are used. For tabular list output, the classes of the SAP List Viewer (ALV), such as CL_SALV_TABLE, should be used. For simple text output, wrappers of the browse control, such as dynamic documents or text edit control wrappers, should be used.
  • No processing of extracts
Extract data sets cannot be processed in global classes since the defining statement FIELD-GROUPS is forbidden in class or interface pools.





Addresses (Business Address Services)   rdisp/max_wprun_time - Maximum work process run time  
This documentation is copyright by SAP AG.

Length: 9779 Date: 20240426 Time: 132432     sap01-206 ( 131 ms )