Programming User Dialogs With Classical Screens (Dynpros)
Programming User Dialogs With Classical Screens (Dynpros)
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.
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:
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:
2. Events (_E01)
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:
2. The DYNP processor: controls the flow logic and prepares data to be displayed on the screen.
GUI Status:
- 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
Status Icons
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.
Radio buttons:
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
Fixed values
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
Tab Title
Tap Pages
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.
-----------------
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.
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.
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.
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.
- 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.
- SY-LOOPC
- SY-STEPL
- <table_control>-CURRENT_LINE
- <table_control>-TOP_LINE
- <table_control>-LINES
Calculating the internal table line that corresponds to the selected table control line:
Context Menus
Context menus are shortcuts for frequently used functions that are accessed when users right-click on
the screen.
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:
...
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 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.
- GET_GUISASH
- SET_SASH
- GET_SASH