Show TOC

Screens and Screen SequencesLocate this document in the navigation structure

Screens and their flow logic, which together form dynamic programs, are instances that control the flow of an ABAP program by calling a series of dialog modules. Screens can be combined into sequences, where the next screen in the sequence can be defined either statically or dynamically. The simplest screen sequence is a single screen. The sequence starts when you call its first screen. You can do this in a variety of ways.

Calling Screens Internally from the Same ABAP Program

In every program that has its own screens (executable programs, module pools or function groups), the statement:

CALL SCREEN dynnr.

can be used to call a screen and its subsequent sequence within that program. The flow logic of each screen calls dialog modules in the program that called the screen.

When the screen sequence ends, control returns to the statement after the dialog module call.

The special screen types selection screen and list are only ever called internally. You should only call subscreens internally.

Calling Screens as a Transaction

A transaction, or a transaction code, can be linked to a screen of any main program. Normally module pools are used for this purpose.

You can call a transaction from any ABAP program using the

CALL TRANSACTION tcod ...

or

LEAVE TO TRANSACTION tcod ...

statements. The transaction starts with the initial screen that you specified when you defined it. The program of the transaction is started in a new internal session and has its own SAP LUW. The screens in the screen sequence call the various dialog modules of the main program.

When the screen sequence is finished, control returns to the program that contained theCALL TRANSACTION statement. If you start a transaction usingLEAVE TO TRANSACTION, control returns to the point from which the calling program was started.

Calling Screens as a Dialog Module

A dialog module can be linked to a screen of any main program. Normally module pools are used for this purpose.

You can call a dialog module from any ABAP program using the

CALL DIALOG diag ...

statement. The dialog module starts with the initial screen that you specified when you defined it. The program of the dialog module is started in a new internal session, but it does not have its own SAP-LUW. The screens in the screen sequence call the various dialog modules of the main program.

When the screen sequence ends, control returns to the statement after the dialog module call.

Dialog modules are obsolete, and should no longer be used. Instead, you can encapsulate screen sequences in function groups and call them from an appropriately-programmed function module.

Ending a Called Screen Sequence

A screen sequence terminates when a screen ends and the defined next screen has the number 0.

You can leave a single screen within a sequence using the

LEAVE SCREEN.

or

LEAVE TO SCREEN dynnr.

statements. These statements exit the current screen and call the defined next screen. If the next screen is screen 0, the entire screen sequence concludes.

Special Single Screens

There are three special types of screen:

Selection Screens

A selection screen is a special screen, created using ABAP statements. You can only call them using the

CALL SELECTION-SCREEN dynnr ...

statement. The selection screen is processed (reaction to user input in the selection screen events) in the calling program.

Lists

Each screen in a screen sequence has a corresponding list system of twenty levels. You can start this list system using the

LEAVE TO LIST-PROCESSING [AND RETURN TO SCREEN dynnr].

statement. This statement calls a system program that contains the standard container screen used for lists. This replaces the current screen. On this screen, you can display a basic list and up to 19 detail lists. List processing (reacting to user actions in list events) takes place in the calling program.

You can leave the list system using the

LEAVE LIST-PROCESSING.

statement.

In an executable program, the list system is automatically called after the last reporting event.

Subscreens

In the PBO event of theflog logic of a screen, you can call a subscreen using the following statement:

CALL SUBSCREEN area INCLUDING [prog] dynnr.

The screen of a subscreen that you call is placed in the subscreen area area on the main screen.

If you do not specify a programprog, the system uses a screen from the current ABAP program. If you do specify a programprog, the system uses a screen from the program prog for the subscreen. This program is treated in the same way as an external subroutine call. In other words, it is loaded into the program group of the calling program, or, if it is a function group, as its own program group in the same internal session as the calling ABAP program.