Programs, Screens, and Processing Blocks 

This section contains a summary of possible ABAP programs, their screens, and their processing blocks.

Overview

ABAP programs consist of processing blocks, and can contain screens as components. Both processing blocks and screens are controlled by the ABAP runtime environment.

ABAP Programs

ABAP has the following program types:

Type 1; introduced with the REPORT statement; can be started by entering the program name or using a transaction code; can be called using SUBMIT; can have its own screens.

Type M; introduced with the PROGRAM statement; can be started using a transaction code; can be called using CALL TRANSACTION or LEAVE TO TRANSACTION; have their own screens.

Type F; introduced with the FUNCTION-POOL statement; non-executable; container for function modules; can have its own screens.

Type K; introduced with the CLASS-POOL statement; non-executable; container for classes; cannot (currently) have its own screens.

Type J; introduced with the CLASS-POOL statement; non-executable; container for interfaces; cannot have its own screens.

Type S; introduced with the PROGRAM statement; non-executable; container for subroutines; cannot have its own screens.

Type T; introduced with the TYPE-POOL statement; non-executable; container for type definitions; cannot have its own screens.

Type I; no introductory statement; non-executable; container for source code modules.

Non-executable programs with types F, K, J, S, and T are loaded into memory as required. Include programs are not separately-compiled units; their source code is inserted into the programs in which the corresponding include statement occurs.

Screens

ABAP programs with types 1, M, or F can contain and process the following types of screen:

Defined using the Screen Painter; can be combined into screen sequences; called using CALL SCREEN or a transaction code; processed in dialog modules of the corresponding ABAP program.

Defined within an ABAP program; called by the runtime environment or using the CALL SELECTION-SCREEN statement; processed in event blocks of the corresponding ABAP program.

Defined within an ABAP program; called by the runtime environment; processed in event blocks of the corresponding ABAP program.

Class definitions (type K programs) do not yet support screens. Subroutine pools (type S programs) cannot contain their own screens.

Processing Blocks

All ABAP programs are made up of processing blocks. You cannot nest processing blocks. When a program is executed, its processing blocks are called. All of the statements in an ABAP program, apart from its global data declarations, belong to a processing block.

ABAP contains the following processing blocks:

Dialog Module

Defined between the MODULE...ENDMODULE statements in type 1, M, and F programs; has no local data area and no parameter interface; called using the MODULE statement in screen flow logic; processes screens.

Event Block

Defined by one of the event key words; no local data area and no parameter interface; reacts to events in the ABAP runtime environment. (Exceptions: AT SELECTION-SCREEN and GET are implemented internally using subroutines, and have a local data area).

We differentiate between:

INITIALIZATION

START-OF-SELECTION

GET

END-OF-SELECTION

Called by the ABAP runtime environment while a type 1 program is running; contain application logic for report programs.

AT SELECTION-SCREEN OUTPUT

AT SELECTION-SCREEN ON VALUE REQUEST

AT SELECTION-SCREEN ON HELP REQUEST

AT SELECTION-SCREEN ON <f>

AT SELECTION-SCREEN ON BLOCK

AT SELECTION-SCREEN ON RADIOBUTTON GROUP

AT SELECTION SCREEN

AT SELECTION SCREEN ON END OF <f>

Called by the ABAP runtime environment following a user action on a selection screen in a type 1, M, or F program; process selection screens.

TOP-OF-PAGE

END-OF-PAGE

AT LINE-SELECTION

AT PF<nn>

AT USER-COMMAND

Called by the ABAP runtime environment while a list is being created or after a user action on a list in a type 1, M, or F program.

Procedures

ABAP contains the following procedures. They have a local data area and a parameter interface:

Defined by FORM...ENDFORM in any program except for type K; called using the PERFORM statement in any ABAP program.

Defined by FUNCTION...ENDFUNCTION in type F programs; called using CALL FUNCTION from any ABAP program.

Defined by METHOD...ENDMETHOD in global classes in programs with type K, or in local classes in any ABAP program; called using CALL METHOD from any ABAP program for global classes, and, for local classes, from the program in which the class is defined.