Basic Components of a Dialog Program

When we are developing workbench / cockpit applications, we would normally use dialog programming. As such, in this guide, I’ll illustrate the basic components required to build a dialog program.

An example of workbench / cockpit using dialog programming is shown below.

Basic Components

The basic components are:

  • Transaction code
  • ABAP program
  • Selection screen
  • GUI status
  • GUI title
  • Screen flow logic
  • Dynpro

Transaction code

The transaction code starts an ABAP program from its initial screen. It can be created via Maintain Transaction (SE93) or ABAP Workbench (SE80) itself.

ABAP program

An ABAP program is the main program that contains all the other components such as selection screen, GUI status, GUI title, screen flow logic and dynpro. It can be created via ABAP Editor (SE38) / ABAP Workbench (SE80).

Selection Screen

Selection screen is the initial screen a user will see to key in inputs upon executing a program for e.g. executing a transaction code. We can define a selection screen via ABAP Editor (SE38) / ABAP Workbench (SE80).

GUI status

Each screen requires a GUI status, which defines the menu bar, standard toolbar, application toolbar and function keys. It can be created via ABAP Workbench (SE80), using the Menu Painter. Right click on program name and go to Create → GUI Status.

An example for application toolbar button.

An example for standard toolbar button. For standard toolbar such as BACK, EXIT and CANCEL which requires to trigger AT EXIT-COMMAND at screen flow logic of event block PAI, functional type ‘E’ must be selected as shown below.

GUI title

Each screen requires a title, which can be set via GUI title and created via ABAP Workbench (SE80), using the Menu Painter. Right click on program name and go to Create → GUI Titles.

Screen flow logic

The screen flow logic is the procedural part of a screen. It contains four event blocks for the screen events PBO, PAI, POH and POV.

Dynpro

Dynpro is a screen with screen elements such as container, label, text input and etc. It can be created using Screen Painter. Please bear in mind to create dynpros with Responsive Dialog Screen Width and Height.

Assign a variable to the ok code.

Declare the ok code variable as follows.

*-----------------------------------------------------------------------
* DATA DECLARATIONS
*-----------------------------------------------------------------------
DATA:
  g_okcode TYPE sy-ucomm.

Wrap-Up

Once the basic components are created, it will typically look like the object tree as shown below (missed out transaction code).