SAP ABAP Program Types

Each ABAP program has a type, which is defined in the program attributes. What is the purpose of all the different program types? The program type determines which processing blocks a program can contain, how the program is handled and executed by the runtime environment, and whether it can work with its own screens. The following ABAP program types are available.

Executable programs (Type 1)
Executable programs are introduced with the REPORT statement. They can contain their own screens and are executed via the SUBMIT statement or transaction codes. Executable programs can contain all the various processing blocks in ABAP, except for function modules, and any number of local classes. They can be created directly with the ABAP Editor tool. While they are running, all the runtime environment events can occur.

Module pools (Type M)
Module pools are introduced with the PROGRAM statement. They can contain their own screens and can only be executed through transaction codes. Module pools can contain all the various processing blocks in ABAP, except for reporting event blocks and function modules, and any number of local classes. While they are running, all the runtime environment events can occur, except for reporting events. They can be created directly with the ABAP Editor tool.

Function groups (Type F)
Function groups or pools are introduced with the FUNCTION – POOL statement. They can contain their own screens. Normally, function groups are not executed directly. They are loaded by calling their function modules. They can contain all the various processing blocks in ABAP, except for reporting event blocks, and any number of local classes. They are the only programs that can contain function modules and are created with the Function Builder tool.

Class pools (Type K)
Class pools are introduced with the CLASS-POOL statement. They cannot contain their own screens and no other processing blocks than methods. Class pools can contain a single global class and any number of local classes. They cannot be executed directly. They are loaded by using their global classes.3 They are created with the Class Builder tool.

Interface pools (Type J)
Interface pools are introduced with the INTERFACE-POOL statement. They cannot contain their own screens or processing blocks. They contain a single definition of a global interface, which can be implemented in any global or local class. They are created with the Class Builder tool.

Subroutine pools (Type S)
Subroutine pools are introduced with the PROGRAM statement. They cannot contain their own screens and apart from the LOAD-OF-PROGRAM event block can have only subroutines or methods of local classes as processing blocks. Subroutine pools are not executed directly. They are loaded by calling their procedures externally. They are created with the ABAP Editor.

Type groups
Type groups or pools are introduced with the TYPE-POOL statement. They cannot contain their own screens or processing blocks. They contain the definitions of global data types, which can be made visible in any ABAP program by the TYPE-POOLS statement. They are created with the ABAP Dictionary tool.

Include programs (Type I)
Include programs have no introductory program statement and, unlike all other program types, they do not represent independent compilation units with their own memory space. Include programs provide a library function for ABAP source code and can be embedded at any location in other ABAP programs using the INCLUDE statement. Include programs have no technical relationship to processing blocks. However, it is preferable to separate logical program units, such as the declaration part for global data, and similar or individual processing blocks into independent include programs. The ABAP Workbench supports the automatic division of module pools, function groups, and class pools into include programs. You can create your own include programs directly with the ABAP Editor.

Comments