Introductory Program Statements

Introductory program statements include: REPORT, PROGRAM, FUNCTION-POOL, CLASS-POOL, INTERFACE-POOL, TYPE-POOL.

The introductory program statement of each program depends on the program type specified in the program properties. The following table lists all program types that require an introductory program statement:

Program Type Global Declarations Processing Blocks Screens
Executable program local interfaces and classes, all other declarative statements all except function modules yes
Class pool a global class of the class library, local interfaces and classes statements TYPES and TYPE-POOLS methods only no
Function group or function pool local interfaces and classes, all other declarative statements all except event blocks for reporting events yes
Interface pool a global interface of the class library, statement TYPE-POOLS none no
Module pool local interfaces and classes, all declarative statements event block LOAD-OF-PROGRAM, subroutines, methods yes
Subroutine pool local interfaces and classes, all other declarative statements event block LOAD-OF-PROGRAM, subroutines, methods no
Type group or type pool statements TYPES, TYPE-POOLS and CONSTANTS none no

The second table column shows which declarations in the global declaration section of a program of the specified type can be made. The third column indicates which processing blocks it can contain. The last column indicates whether or not the program type supports separate screens.

All statements that follow the introductory program statements in the source texts or are included as include programs are treated as a single unit by the ABAP Compiler.

The first statement of every independent ABAP program must be an introductory program statement, and each program can only contain one of these statements. The only other statement at the first position - instead of an introductory statement - an be the INCLUDE statement. In this case, an introductory program statement must appear at the first position of the program after the include program has been expanded during the program generation..

Executable programs, module pools, function groups, class pools, interface pools, subroutine pools, and type groups are stand-alone compilation units. Include programs, on the other hand, are are only used in the context of superior programs.

Type groups, also known as type pools (program type T) are stand-alone programs from a logical point of view. However, they do not contain executable code but only type definitions and constant definitions. For this reason, type groups have their own introductory program statement, the TYPE-POOL.

Note

It is syntactically not mandatory to assign introductory program statements to the program types specified in the program properties. However, you should always use the assignments listed in the following sections. When you create a program, the ABAP Workbench automatically generates the appropriate statement. If changes are necessary, only the statement's additions should be edited. In particular, the keywords FUNCTION-POOL, CLASS-POOL, INTERFACE-POOL, and TYPE-POOL should only be generated by the corresponding tools of the ABAP Workbench. These keywords should never be manually entered in a source text to avoid unexpected system behavior.