Entering content frameIntroductory Statements for Programs Locate the document in its SAP Library structure

Each ABAP program type has a statement that introduces programs of that type:

Program type

Introductory statement

1

REPORT

M

PROGRAM

F

FUNCTION-POOL

K

CLASS-POOL

J

CLASS-POOL

S

PROGRAM

T

TYPE-POOL

I

-

Include programs (type I) are not compilation units. Instead, they are purely modularization units that are only ever used in the context of the programs to which they belong. For this reason, include programs do not have a special introductory statement.

The following sections describe the function of introductory statements:

REPORT and PROGRAM

The REPORT and PROGRAM statements currently have the same function. They allow you to specify the message class of the program and the formatting options for its default list. Whether a program is executable or can only be started using a transaction code depends exclusively on the program type and not on the statement that introduces it. However, executable programs should always begin with a REPORT statement, and module pools always with a PROGRAM statement. Subroutine pools (type S programs) should also always begin with a PROGRAM statement.

FUNCTION-POOL

The introductory statement FUNCTION-POOL declares a program in which you can define function modules. At runtime, function pool programs are loaded in to a new program group with their own user dialogs and their own shared data areas in the internal session of the calling program. For this reason, function groups (type F programs) must always begin with a FUNCTION-POOL statement. This is usually generated by the Function Builder. Type 1, M, or S programs should not begin with a FUNCTION-POOL statement, since they would then not share common data areas with the caller. However, in exceptional cases, you can introduce a type 1 or type M program with FUNCTION-POOL to ensure that externally-called subroutines can process their own screens. As in the REPORT and PROGRAM statements, you can specify the message class and standard list formatting options of the program in the FUNCTION-POOL statement.

CLASS-POOL

The introductory statement CLASS-POOL can only be used for class or interface definitions (type K or J programs). A program introduced with the CLASS-POOL statement can only contain global type definitions and definitions of classes and interfaces. The CLASS-POOL statement is generated automatically where required by the Class Builder - you should not insert it into programs manually.

TYPE-POOL

The introductory statement TYPE-POOL can only be used for type groups (type T programs). A program introduced with the TYPE-POOL statement can only contain global type definitions and constants declarations. The CLASS-POOL statement is generated automatically where required by the ABAP Dictionary - you should not insert it into programs manually.

 

 

 

 

Leaving content frame