0% found this document useful (0 votes)
91 views

Programming User Dialogs With Classical Screens (Dynpros)

The document discusses various aspects of programming user dialogs with classical screens (dynpros) in ABAP, including: 1. The single-screen transaction model and ABAP program types. 2. Elements of GUI status like menu bars, toolbars, and status icons. 3. Differences between checkboxes and radio buttons. 4. Using parameters, field input checks, and the FIELD statement for validation. 5. Features of subscreens, tabstrips, and table controls.

Uploaded by

Yousif Ahmed
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
91 views

Programming User Dialogs With Classical Screens (Dynpros)

The document discusses various aspects of programming user dialogs with classical screens (dynpros) in ABAP, including: 1. The single-screen transaction model and ABAP program types. 2. Elements of GUI status like menu bars, toolbars, and status icons. 3. Differences between checkboxes and radio buttons. 4. Using parameters, field input checks, and the FIELD statement for validation. 5. Features of subscreens, tabstrips, and table controls.

Uploaded by

Yousif Ahmed
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Programming User Dialogs with Classical Screens (Dynpros)

The Screen Painter has a Layout Editor with two modes:

Graphical mode (available only on Windows platforms)

Alphanumeric mode: the Alphanumeric Layout Editor is used in cases when it is not possible to use the
Graphical Layout Editor (Screen Painter → Utilities → Settings → Graphical layout editor)

Single-Screen Transaction Model: SAP programming model. The aim of this model is to replace long,
nested screen sequences with single-screen transactions.

- Input and data screens are combined in one window.

- It is easy to switch between create, change, and display mode.

- The system retains context after saving.

- Direct access to the object is possible.

The ABAP program types:

1. Complete: can be executed and are of the following types:

- Executable Program (type 1)

- Module Pool (type M)

2. Incomplete: cannot be executed directly. They serve as containers for modularization units that are
called from other programs. The following types of programs cannot be executed directly:

- Function group (type F)

- Include program (type I)

- Interface pool (type J)

- Class pool (type K)

A list: a type of output format, such as a normal list or an interactive list. In modern reports, lists are
defined using SAP ABAP List Viewer (ALV).

Includes of a program:

1. Global declarations (TOP)

2. Events (_E01)

3. Form routines (_F01)


4. PAI module (<module>_I01)

5. PBO module (<module>_O01)

Flow logic of a screen contains the flow logic code, not ABAP statements.

The software processors that are involved in screen processing for a program:

1. The ABAP processor: controls the program flow in a module

2. The DYNP processor: controls the flow logic and prepares data to be displayed on the screen.

GUI Status:

- ABAP programs objects that can be displayed on screens and lists.

- You can add one or more GUI statuses per screen.

- Elements of GUI Status: a single component can be used by multiple GUI statuses.

1. Menu Bar: a menu can contain up to 15 entries, which can be functions, separators, and cascading
menus. Menus can contain up to three levels. A menu bar contain up to eight menus. You can freely
assign a maximum of six menus to a menu bar (System and Help menus).

2. Standard Toolbar

3. Application Toolbar: can contain up to 35 pushbuttons.

4. Function Key Settings

Status Icons

An output field with an icon.

Set dynamically at runtime.

Predifned in the system.

Have two to four characters.

ICONS: ABAP Dictionary Structure

ICON_CREATE: a function module (called in the PBO event) that returns the technical value of the status
icon field. You must pass the name of the icon you want to display as well as the icon's display text.

Checkboxes vs. Radio Buttons

Radio buttons:

- Allow a user to choose only a single element from a group of fields.


- One selection deselects all other options in the group.

Checkboxes:

- Allow the user to choose one or more elements from a group of fields.

The SET Parameter: copies the input/output field contents into the SAP memory in the Process After
Input (PAI) processing block.

The GET Parameter: copies the corresponding field contents from the SAP memory at the end of the
Process Before Output (PBO) processing block.

Dialog Parameters:

A: Termination

X: Exit

W: Warning

I: Information

S: Success

Field Input Checks:

Mandatory fields check

Field format check

Fixed values

Foreign key check

The FIELD statement with the MDULE addition:

If the automatic field input checks are insufficient for your requirements, you can program your own
checks in the PAI event.

The module you specify is processed only for the field that you specify in the FIELD statement.

If an error or warning message occurs during the processing of the module, the system throws back the
same screen, but without processing the PBO module. When the message is displayed, only the field to
which the check was applied is ready for input.
The CHAIN Block: ensure that more than one field is ready for input following an error dialog. List the
relevant fields in the FIELD statement and include the fields and the MODULE statement.

The ON INPUT Addition: the system calls a module only if the field contents have changed from their
initial value.

The ON CHAIN-INPUT Addition: the module is called if the contents of at least one screen field in the
CHAIN block have changed from their initial value.

The ON REQUEST Addition: the module is called only if the user enters a new value in that field.

The ON CHAIN-REQUEST Addition: the module is called if the user changes the contents of at least one
screen field in the CHAIN block.

The AT EXIT-COMMAND Addition: the module is processed before the automatic field input checks,
automatic data transport, and all other PAI modules. You can use the AT EXIT-COMMAND addition for
navigation with one module for each screen.

SWITCH Addition: the dialog module is called only if the switch you specified has the ON status.

Navigation: the main functions used to navigate between screens include the Back function, Cancel
function, and Exit function.

SY-DATAR:

- If the user enters any data into the screen, the field is set to X.

- By checking the field you can avoid accidential loss of data by sending a predefined security prompt.

Subscreens

Calling a subscreen

- PAO Module

- PAI Module
Tapstrips

Tabstrip Control

The default number of tab pages for a tabstrip control is two.

Tab Title

Can have the function type ’ ’ (space) or P.

Tap Pages

Assign a subscreen area to each tab page.

The subscreen area assigned to a tab page is automatically entered as the reference object in the
Dictionary attributes for the tab title of that page.

CONTROLS Statement: declare an object with the same name of the tapstrip control. Use the TABSTRIP
as the type.

ACTIVETAB Field: contains the function code of the tab title of the currently active tabstrip.

Tabstrip Control Local Scrolling

-----------------

Table Contorls

-----------------

The Process After Input (PAI) processing block is triggered when you scroll vertically in the table control
or save the user configuration.

The table control contains series of actions that are controlled entirely at the presentation server.

The stepl and loopc fields of the global structure SYST contain information about the loop processing
used with table controls.

Table Control Area

Table Control Fields

In the ABAP program, declare a structure with the same name table control.
CONTROLS statement: declares a complex data object with the type TABLEVIEW. At runtime, the data
object contains the static attributes of the table control.

USING SCREEN addtion in the CONTROLS statement: determines the screen whose initial values are to
be used for the table control.

REFRESH CONTROL <control_name> FROM SCREEN <screen_name>

You can create fields in a table control using the Dictionary/Program fields function. Alternatively, you
can position individual input/output fields in the table control area. Each field generates a single column.

Selection column (for selecting a row): a field with length 1 and data type CHAR must be entered in the
attributes of the table control.

The table control attributes can be saved at runtime in the structure that you declared in the CONTROLS
statement.

Table control attributes can be divided into the following categories:

1. General attributes: information about the properties of the entire table control.

2. Column attributes: saved in an internal table (one entry for each column).

You can change a table control dynamically by modifying the contents of the fields in the table control
structure declared in the program.

LINES function: get the number of entries in the internal table. Save this number in the lines field of the
table control.

You need a LOOP ... ENDLOOP structure in both the PBO and PAI events for each table control.

- In the PBO processing block, you must fill one line of the table control with the corresponding line
from the internal table in each loop pass. Data is transferred from the ABAP program to the screen after
each loop pass.

- In the PAI processing block, you must pass the changes made in the table control back to the correct
line of the internal table.

Change the contents of table control

- Permanent

- Temporary

Changing table control attribute: overwriting the field contents of the structure created in the CONTROL
statement. Or temporarily by changing the SCREEN table in PBO module.

Changing the attributes of the columns in a table control.

- Change the respective entries in the <control> -cols table.

- Table has no header lines: create an explicit work area.

Tha COLS line strucutr


Table control line counter variables:

- SY-LOOPC

- SY-STEPL

- <table_control>-CURRENT_LINE

- <table_control>-TOP_LINE

- <table_control>-LINES

The LINE parameter

The GET CURSOR statement

Calculating the internal table line that corresponds to the selected table control line:

line = <control>-top_line + cursor position - 1.

Placing the cursor on a particular element within the table control

SET CURSOR FIELD <field_name> LINE <line>.

Table Control Paging

Sorting a table control

Selecting and deselecting a line in a table control

Context Menus

Context menus are shortcuts for frequently used functions that are accessed when users right-click on
the screen.

A context menu is a special GUI status.

When you assign a context menu to a box, table control, or screen (normal or subscreen), the
subordinate input/output fields without a context menu inherit that context menu.

When you right-click on screen, a callback routine is triggered in your program. They are named as
ON_CTMENU_<arbitrarily>.

Create the structure of the context menu by loading a statically defined menu or by adding entries
dynamically with methods of class CL_CTMENU.

Directly assign a callback routine to input/output fields, text fields, and status icons.

Checkboxes, radio buttons, and pushbuttons do not have their own callback routines. However, these
fields can inherit context menus from boxes or screens.

A callback routine is triggered for all fields of a table control that do not have their own callback routine.
The callback routine takes the form:

FORM <form_name> USING <menu_name> TYPE REF TO cl_ctmenu.

...

ENFFORM.

The static method LOAD_GUI_STATUS of class CL_CTMENU is used to load a context menu that was
predefined in the Menu Painter (parameters: program, status, menu).

Splitter Control

A splitter control is a screen element that divides an area into two subscreen areas, either horizontally
beside each other, or vertically, one above the other.

The division is made by a sash.

Can only be created in the Alphanumeric Screen Painter.

The position of the sash of a splitter control is controlled using an instance of the CL_DYNPRO_SPLITTER
class. The splitter name is used as exporting parameter when creating the object.

Important methods of the class CL_DYNPRO_SPLITTER:

- GET_GUISASH

- SET_SASH

- GET_SASH

You might also like