Show TOC

Screen SequencesLocate this document in the navigation structure


For the user, an application program consists of a series of screens that are displayed one after the other. The major difference between the program flow of an executable program and a dialog program is that, in a dialog program, you can program screens to appear in any sequence you want. In executable programs, the screen sequence is controlled by events, which occur in a fixed order. In a dialog program, the programmer is free to program any sequence of screens, and the user can affect the program flow by his or her actions. However, it is still possible to call a freely-defined screen sequence within an executable program and thus to branch into a form of dialog program.

Screens always belong to an ABAP program. The dialog modules in an ABAP program can only be called from screens in the same program. The system field sy-dynnr always contains the number of the current screen. You can create any number of complex screen sequences from the screens in a single program . For example, you can navigate from one screen to any other screen in the same program, or repeat part of a sequence any number of times.

To start a screen sequence, you have to call its first screen. You can do this either by starting a transaction (the first screen is contained in the transaction definition), or by using the CALL SCREEN statement in an ABAP program. When you call a screen sequence using the CALL SCREEN statement, you nest it within the screen sequence that was already running at the time.

The actual sequence of screens is defined by setting the next screen for each screen in the chain. The attributes of every screen in the Screen Painter contain a statically-defined next screen. This forms a static screen sequence . You can overwrite the value of the static next screen dynamically in the ABAP processing logic. This enables the definition of any dynamic screen sequences that can depend on user actions.

You can also run a screen sequence without displaying all of the screens. The SUPPRESS DIALOG statement allows you to prevent a screen from being displayed. You include it in a PBO module of the screen concerned. When you use SUPPRESS DIALOG, the entire PBO and PAI logic is processed, even though the screen itself is not displayed. Suppressing a screen is useful when you need to display a list within a screen sequence (refer to Switching Between Screens and Lists ).

Screen sequences always end when they reach the next screen number zero. For this reason you cannot create screens with number 0. Instead, you use 0 to terminate a screen sequence. When a screen sequence ends, the system returns to the point from which the first screen in the sequence was called. If you started the screen sequence using a transaction code, this is the point from which you started the transaction. If you started it using CALL SCREEN , it is the point in the ABAP program where the statement occurred.

The following sections describe in more detail how to define screen sequences.

Leaving a Screen from a Program

Calling Screen Sequences

Embedding Modal Dialog Boxes

Screen Sequences: Example Transaction

Filling an Initial Screen Using SPA/GPA Parameters