Mastering User Interaction and Selection Screens in ABAP
I. Foundations of User Interaction in ABAP
User interaction forms the critical interface between end-users and the business
logic encapsulated within SAP systems. In the Advanced Business Application
Programming (ABAP) environment, this interaction has traditionally been managed
through a robust presentation layer, which has evolved over time. Understanding
these foundations is crucial before delving into specific components like selection
screens.
A. The ABAP Presentation Layer and UI Technologies Landscape
The SAP system architecture is fundamentally based on a three-tiered client-server
model. The Presentation Layer is the tier closest to the user and is responsible for
rendering the graphical user interface (GUI), enabling data entry, facilitating data
retrieval, and managing other direct interactions with application components. A key
characteristic of this layer is its focus on the user experience, generally without
performing significant application processing or data storage itself.1 This separation
of concerns allows for flexibility in how users interact with the backend application
server, where the business logic (Application Layer) and database operations
(Database Layer) reside.
Over the years, SAP has introduced and supported a variety of front-end
technologies to cater to different user needs and technological advancements 1:
1. SAP GUI (Graphical User Interface): For many years, the SAP GUI has been the
cornerstone of user interaction with ABAP-based systems. It is a dedicated client
software that provides a rich, interactive environment for users to perform tasks
ranging from simple data entry to complex system operations.1 The SAP GUI can
interact with applications running on various SAP platforms, including traditional
Business Suite systems, SAP Business Warehouse (BW), and SAP S/4HANA.3 It
implements the visual interface using elements like buttons, icons, and windows,
allowing navigation and task execution.
2. SAP GUI for HTML: To provide browser-based access without requiring the
installation of the full SAP GUI for Windows client, SAP introduced the SAP GUI
for HTML. This allows users to access SAP system functionalities through a web
browser, primarily for navigation and transaction execution.3 This was an early
initiative to broaden accessibility to SAP systems via standard web technologies.
3. SAP Business Client: Bridging the gap between traditional and newer UI
technologies, the SAP Business Client is a desktop application that offers a
unified and more modern user experience. It allows users to access a mix of SAP
applications, including those built with classical Dynpros, Web Dynpro for ABAP,
and even Fiori design-based applications, all within a harmonized, browser-like
interface.1 This client aims to streamline workflow management and provide a
role-based, personalized experience.
4. SAP Fiori: Representing SAP's current strategic direction for user experience,
SAP Fiori offers a modern, intuitive, and user-friendly interface. It is designed to
provide a consistent experience across various devices (desktop, tablet, mobile)
and deployment options. Fiori applications typically follow a role-based
approach, presenting users with a tile-based launchpad where each tile
represents a business application relevant to their job.1 Key features include
simple design, icon-based navigation, responsive layouts, interactive charts, and
real-time notifications.
The evolution from the traditional SAP GUI to the modern SAP Fiori paradigm is
indicative of broader shifts in the software industry towards web-based, mobile-first,
and user-centric design principles. While selection screens, the primary focus of this
report, are deeply rooted in the classical SAP GUI environment, understanding this
evolutionary trajectory is important. It provides context for why newer UI technologies
have emerged and the direction SAP is taking to enhance user experience. The
existence of transitional technologies like SAP GUI for HTML and SAP Business Client
highlights SAP's strategy to accommodate diverse technical landscapes and provide
pathways for customers to gradually adopt newer interfaces while still leveraging
their existing ABAP investments. This report will primarily focus on user interaction
mechanisms within the SAP GUI, as selection screens are a core and extensively used
feature of this environment.
B. Core Principles of ABAP User Interaction via SAP GUI
Interaction within the SAP GUI is predominantly transaction-based. Users navigate
the system by executing specific transactions, each identified by a unique transaction
code (T-code). Each transaction typically calls an ABAP program or application,
guiding the user through a series of dialog steps to complete a logical unit of work.3
There are three primary ways to access SAP transactions 3:
● The SAP Menu: A standard menu structure delivered by SAP, providing access to
all transactions for which a user has authorization.
● The User Menu: A personalized menu derived from the security roles assigned to
the user.
● The Command Field: A dedicated input field present on every SAP screen,
where users can directly enter T-codes. This is the most common navigation
method for experienced users due to its efficiency.
The prevalence of T-code usage among seasoned SAP users points to a system
optimized for high efficiency once a certain level of familiarity is achieved. While
menus aid in discovery for new or infrequent users, direct command access is
paramount for power users who perform repetitive tasks. This historical emphasis on
T-code efficiency has influenced the design philosophy of classical SAP applications
and sets a benchmark for speed that users accustomed to this interaction style often
expect, even from newer interfaces.
The SAP GUI offers several personalization options to enhance user experience 3:
● Themes: Control the visual appearance (colors, menus, icons).
● Display Options: Adjustments for font, keyboard settings, accessibility features,
and sounds.
● Input History: A local database on the front-end that stores recent entries in
input fields, offering them as suggestions.
Users can also manage multiple application sessions simultaneously by using the /o
command followed by a T-code to open a new session. Conversely, /n followed by a
T-code terminates the current transaction and starts the new one in the same
session. It is crucial to save any work before navigating away from a screen using
commands like /n, as unsaved changes will be lost.3
The concept of a transaction comprising a "series of dialog steps" that culminate in a
"completed logical unit of work" 3 is an early embodiment of structured process flows.
This classical model, where users are guided through a sequence of screens and
interactions to achieve a specific business outcome, shares conceptual similarities
with modern user experience (UX) design principles like user journey mapping.
Recognizing this connection helps in relating traditional ABAP interaction patterns to
contemporary UX thinking.
C. Introduction to Classical Dynpro Programming
Dynpro, an abbreviation for "Dynamic Program," is a fundamental component of
classical ABAP applications that present a user interface. A Dynpro is a repository
object, always part of an ABAP program, and consists of two main parts: the screen
layout and its associated flow logic.4 General Dynpros are created using the Screen
Painter tool in the ABAP Workbench, while special Dynpros, like selection screens, are
generated from ABAP statements.
The Screen Flow Logic dictates the processing of a Dynpro and is divided into two
main event blocks 4:
● PBO (Process Before Output): This block of logic is executed before the screen
is displayed to the user. Its primary purpose is to prepare the screen for display,
such as setting default values for fields, enabling or disabling fields, or populating
table controls.
● PAI (Process After Input): This block is triggered after a user performs an action
on the screen (e.g., presses Enter, clicks a button). It processes the user's
entries, validates data, and executes the corresponding application logic.
This PBO-PAI cycle forms a fundamental processing loop in classical ABAP UIs. The
event-driven nature of this model, where user actions trigger PAI processing, which in
turn prepares data for the next PBO, is a core concept. While the implementation
details are specific to ABAP Dynpros, this cyclical, event-driven approach to UI
management shares conceptual similarities with event handling mechanisms found in
many modern UI frameworks. Understanding this loop is essential for developing,
debugging, and extending classical ABAP applications.
Data exchange between the Dynpro fields (input/output fields on the screen) and the
ABAP program variables occurs based on matching names. When a screen is
displayed (PBO) or exited after user input (PAI), data is transferred between Dynpro
fields and ABAP data objects that share the same name.4 This direct name-based
binding is a straightforward mechanism for data transfer. However, it implies a tight
coupling: if a variable name in the ABAP program is changed, the corresponding
Dynpro field name in the Screen Painter must also be updated (and vice-versa) to
maintain the linkage. While simple to grasp initially, this can introduce maintenance
overhead in large or evolving applications, contrasting with more abstracted data-
binding mechanisms found in newer UI paradigms that offer greater resilience to such
changes.
Each screen is typically associated with a GUI Status, which defines the menu bar,
standard toolbar (with system functions like Save, Back, Exit, Cancel), and an
application toolbar (with program-specific functions). GUI statuses are independent
components created using the Menu Painter tool and are assigned to Dynpros
dynamically within the ABAP program.4
Regarding Object-Oriented Programming (OOP), while the core Dynpro processing
framework (the PBO-PAI loop) is inherently procedural, it is possible to incorporate
OO principles within the ABAP modules or form routines called from the flow logic.
Developers can instantiate classes and call methods within these PBO/PAI modules,
often structuring their application logic in an MVC (Model-View-Controller)-like
pattern, where the Dynpro acts as the View, and ABAP classes handle the Model and
Controller responsibilities.6
II. Selection Screens: An In-Depth Exploration
Selection screens are a specialized and ubiquitous form of user interface in ABAP,
primarily used for gathering input parameters and selection criteria for reports and
other programs. They offer a standardized way for users to control program
execution and filter data.
A. Defining Purpose: The Role and Functionality of Selection Screens
Selection screens are distinct from general Dynpros in that they are not created using
the graphical Screen Painter tool. Instead, they are generated directly from ABAP
statements declared within a program.5 This declarative approach means developers
specify what inputs are needed (e.g., a date parameter, a range for customer
numbers), and the system automatically handles the rendering of these elements into
a standardized screen layout. This automatic generation represents a higher level of
abstraction compared to the manual design of each field and label in the Screen
Painter. It significantly simplifies and speeds up the development process for
common input scenarios, though it offers less granular control over the precise
screen layout than the Screen Painter allows. This reflects a design trade-off:
development efficiency and standardization versus ultimate layout flexibility.
The primary purpose of a selection screen is to provide a standardized user
interface where users can enter 5:
● Input parameters: Typically single values used to control the program's flow or
provide specific data points for processing.
● Selection criteria: Often complex selections (e.g., ranges, multiple individual
values, exclusions) used to restrict the amount of data retrieved from the
database or processed by the program.
When a selection screen is defined, the system automatically assumes many of the
tasks that would otherwise be handled by the Screen Painter (for layout) and Menu
Painter (for basic toolbar functions).5
Beyond direct user interaction, selection screens serve a crucial role as a data
interface for programmatic execution. When an executable program (report) is
started using the SUBMIT statement from another ABAP program, the input fields
defined on the selection screen of the called program act as an interface to receive
data.5 This dual role is a powerful feature, enabling significant reusability and
modularity. A report designed for interactive use can also be called as a component in
a larger automated process, with its input parameters supplied programmatically.
This capability is fundamental for scenarios like batch processing, report chaining,
and building complex application flows that might not require direct user interaction
at every step.
Other key characteristics of selection screens include:
● Text Elements: All descriptive texts displayed on the selection screen (e.g.,
labels for parameters and selection options) are stored as language-specific
selection texts. These are part of the program's text elements, allowing for easy
translation and internationalization.5
● Variants: Users can save predefined sets of input values for any selection screen
as variants. These variants can then be loaded to quickly populate the selection
screen with common entries, significantly improving usability for frequently run
reports or complex input scenarios.5 Variants are particularly important for
scheduling programs in background processing.
B. Constructing Selection Screens: Core ABAP Statements
Selection screens are defined in the declaration part of an ABAP program using a set
of specific keywords.14 The primary statements involved are PARAMETERS, SELECT-
OPTIONS, and SELECTION-SCREEN.
Table 1: Core ABAP Statements for Selection Screen Definition
Statement Core Purpose Key Functionality/Additions
PARAMETERS Defines single input fields Type definition, default
values, checkboxes, radio
buttons, mandatory fields,
input validation, F4 help
linkage.
SELECT-OPTIONS Defines complex selection Defines fields for LOW and
criteria (ranges, etc.) HIGH values, multiple
selection button, default
ranges, mandatory input,
interval control.
SELECTION-SCREEN Formats and structures the Defines blocks, lines,
selection screen comments, pushbuttons, tabs,
user-defined screens, and
includes elements from other
selection screens.
1. The PARAMETERS Statement: Defining Single Input Fields
The PARAMETERS statement is used to declare individual input fields on a selection
screen. These can be simple text entry fields, checkboxes, or radio buttons.14
The basic syntax is 16:
PARAMETERS p[(length)].
● p: The name of the parameter (historically limited to 8 characters 16). This name is
used for the ABAP variable that will hold the input value and also, by default, as
the label on the screen (though this can be overridden by selection texts).
● length: Optional length specification for generic types like c, n, p, x.
● TYPE type or LIKE obj: Defines the data type of the parameter. This can be an
elementary ABAP type (excluding type f) or a reference to an existing data object
(obj) or a data type from the ABAP Dictionary (e.g., mara-matnr).16 Referencing
Dictionary types is highly recommended as it brings along attributes like field help
(F1) and possible entries help (F4).16
● DECIMALS d: Specifies the number of decimal places for packed numbers (type
p).
The PARAMETERS statement offers numerous additions to control the appearance
and behavior of the input field.
Table 2: PARAMETERS Statement - Essential Additions and Their Impact
Addition Example Syntax Snippet Effect on Screen Element
and Program Variable
DEFAULT PARAMETERS p_date TYPE d Pre-fills the input field with
DEFAULT sy-datum. the specified default value
(sy-datum). The user can
override it. The ABAP variable
p_date will have this value
initially.15
OBLIGATORY PARAMETERS p_werks TYPE Makes the input field
werks_d OBLIGATORY. mandatory. The user cannot
execute the program if this
field is empty. An error
message is displayed.15
AS CHECKBOX PARAMETERS p_flag AS Displays the parameter as a
CHECKBOX. checkbox. The ABAP variable
p_flag (must be type c length
1) will hold 'X' if checked,
space if unchecked.15
RADIOBUTTON GROUP PARAMETERS p_rb1 Displays as a radio button
RADIOBUTTON GROUP gr1. belonging to group gr1. Only
one radio button in a group
can be selected. Variable
(type c length 1) holds 'X' if
selected.15
VALUE CHECK PARAMETERS p_carr TYPE Validates user input against
s_carr_id VALUE CHECK. ABAP Dictionary definitions
(domain fixed values/value
range, or check table for
foreign keys). Issues an error
if validation fails.16
MEMORY ID PARAMETERS p_prog TYPE Links to SPA/GPA parameter
sy-repid MEMORY ID 'RID'. RID. Defaults from memory if
p_prog is initial. Updates
memory on user action.26
MATCHCODE OBJECT PARAMETERS p_mat TYPE (Obsolete) Associates field
matnr MATCHCODE OBJECT with a matchcode object mat1
mat1. for F4 help. Modern approach
uses Search Helps via
Dictionary type.17
MODIF ID PARAMETERS p_field TYPE Assigns the parameter to
char10 MODIF ID m01. modification group m01,
allowing dynamic screen
changes via the SCREEN table
(e.g., in AT SELECTION-
SCREEN OUTPUT).21
LOWER CASE PARAMETERS p_text TYPE Prevents automatic
string LOWER CASE. conversion of input to
uppercase for character-like
fields.17
NO-DISPLAY PARAMETERS p_tech TYPE i Declares the parameter for
NO-DISPLAY. the program interface (e.g.,
for SUBMIT) but does not
display it on the selection
screen.21
VISIBLE LENGTH PARAMETERS p_desc TYPE Sets the visible length of the
char40 VISIBLE LENGTH 20. input field on the screen to 20
characters. If actual length is
longer, content may be
scrollable.21
AS LISTBOX PARAMETERS p_opt AS Displays the parameter as a
LISTBOX VISIBLE LENGTH 15. dropdown list box. Values are
typically populated using
VRM_SET_VALUES FM.
Parameter (type c length 1
usually) gets the key of
selected value.15
The VALUE CHECK addition is a prime example of the tight integration between the
ABAP runtime environment and the ABAP Dictionary.24 When a parameter is typed
with reference to a Dictionary field that has associated domain fixed values, a value
range, or a check table (foreign key), the VALUE CHECK addition instructs the system
to automatically validate the user's input against these centrally defined rules.18 This
promotes data consistency across the SAP system because the validation logic is
defined once in the Dictionary and reused wherever that data element is employed,
rather than being re-implemented (and potentially inconsistently) in numerous
individual programs. If the check fails, the system issues an error message, and the
field remains input-enabled for correction.24
Similarly, the evolution from the now-obsolete MATCHCODE OBJECT addition 28 to
the more comprehensive and flexible Search Help mechanism 18 reflects SAP's
continuous efforts to improve user assistance. Search Helps, defined in the ABAP
Dictionary, provide richer F4 input help capabilities, including complex search paths,
multi-value selection, and better user interface integration, compared to the older
matchcode objects. Modern ABAP development strongly favors the use of these
advanced Search Helps, which are often automatically available when parameters are
typed with reference to appropriate Dictionary elements.
2. The SELECT-OPTIONS Statement: Handling Complex Selections
For scenarios requiring more than a single input value, such as specifying ranges or
multiple individual values, the SELECT-OPTIONS statement is used.14
The basic syntax is 34:
SELECT-OPTIONS selcrit FOR {dobj|(name)}.
● selcrit: The name of the selection criterion (maximum 8 characters).
● FOR dobj|(name): Specifies the data object (dobj) or ABAP Dictionary type
(name) that the selection criterion is based on. The data type of the LOW and
HIGH components of the associated internal table will be derived from this.
When a SELECT-OPTIONS statement is declared, the system automatically creates an
internal table, known as a selection table, with the same name as the selection
criterion (selcrit). This table always has a header line and contains the following four
fields 15:
● SIGN: (Type c, Length 1) Determines whether the condition is inclusive or
exclusive. Common values are 'I' (Include) and 'E' (Exclude).
● OPTION: (Type c, Length 2) Specifies the relational operator for the condition
(e.g., 'EQ' for Equal, 'BT' for Between, 'CP' for Contains Pattern, 'GT' for Greater
Than).
● LOW: (Type of dobj or name) Holds the single value or the lower limit of a range.
● HIGH: (Type of dobj or name) Holds the upper limit of a range. For single value
options (like 'EQ', 'GT'), this field is typically initial.
On the selection screen, SELECT-OPTIONS typically generates two input fields (for
LOW and HIGH values) and a pushbutton that opens a "Multiple Selection" dialog.
This dialog allows users to enter more complex criteria, such as multiple single values,
multiple ranges, and exclusions for both single values and ranges.34 The standardized
internal table structure (SIGN, OPTION, LOW, HIGH) is fundamental to how ABAP
processes these complex user queries, particularly in the WHERE clause of SELECT
statements (e.g., WHERE field IN selcrit_table). This abstraction greatly simplifies the
construction of dynamic database queries, as developers do not need to manually
parse various input combinations; the IN operator in Open SQL intelligently interprets
the contents of the selection table.
While the "Multiple Selection" pushbutton offers a rich user experience for defining
intricate criteria, it also means that developers must understand how these varied
user inputs translate into potentially multiple rows within the selection table if they
need to process or validate these inputs programmatically beyond standard IN
operator usage.
Table 3: SELECT-OPTIONS Statement - Essential Additions and Their Impact
Addition Example Syntax Snippet Effect on Screen Element
and Internal Selection Table
DEFAULT SELECT-OPTIONS s_date FOR Pre-fills the LOW, HIGH,
sy-datum DEFAULT OPTION, and SIGN fields of
'20230101' TO '20231231' the first row/header line of
OPTION 'BT' SIGN 'I'. the selection table s_date.34
OBLIGATORY SELECT-OPTIONS s_mat FOR Makes the LOW input field
mara-matnr OBLIGATORY. mandatory. An error is issued
if empty on execution.34
NO INTERVALS SELECT-OPTIONS s_code Suppresses the HIGH input
FOR t001-bukrs NO field on the screen. Only
INTERVALS. single value comparisons are
directly possible on the main
screen. The selection table's
HIGH component remains
initial.15
NO-EXTENSION SELECT-OPTIONS s_item FOR Suppresses the "Multiple
vbap-posnr NO-EXTENSION. Selection" pushbutton. Users
can only enter a single
condition (value or range)
directly on the screen.15
MODIF ID SELECT-OPTIONS s_vbeln Assigns the select-option to
FOR vbak-vbeln MODIF ID modification group m02 for
m02. dynamic screen changes.34
VISIBLE LENGTH SELECT-OPTIONS s_text FOR Sets the visible length of the
char100 VISIBLE LENGTH 30. LOW and HIGH input fields to
30 characters.34
LOWER CASE SELECT-OPTIONS s_desc Prevents automatic
FOR char40 LOWER CASE. conversion of input to
uppercase.
NO-DISPLAY SELECT-OPTIONS s_tech FOR Declares the select-option for
char1 NO-DISPLAY. the program interface but
does not display it on the
screen. Values can be passed
via SUBMIT.
3. The SELECTION-SCREEN Statement: Structuring and Enhancing Layout
While PARAMETERS and SELECT-OPTIONS define the input fields, the SELECTION-
SCREEN statement provides the means to format the selection screen, define entirely
user-specific selection screens, and manage screen elements not directly covered by
the other two statements.14
Key syntax forms and additions include:
● Defining User-Defined Screens:
○ SELECTION-SCREEN BEGIN OF SCREEN dynnr.
○ SELECTION-SCREEN END OF SCREEN dynnr. These statements define the
start and end of a user-defined selection screen. dynnr is a four-digit screen
number (not 1000). TITLE allows specifying a custom title. AS WINDOW
makes the selection screen appear as a modal dialog box.5
● Structuring with Blocks:
○ SELECTION-SCREEN BEGIN OF BLOCK block].
○ SELECTION-SCREEN END OF BLOCK block. These group related screen
elements into a logical block, optionally drawing a frame around them and
providing a title for the frame.22 The NO INTERVALS addition, if used on a
block, implicitly applies NO INTERVALS to all SELECT-OPTIONS defined within
that block, and the block's visual width is narrowed accordingly. This
structured approach to layout, while not as free-form as a graphical painter,
imposes a degree of order and consistency, which can be beneficial for
maintainability and user familiarity across different reports.
● Adding Textual Information and Visual Elements:
○ SELECTION-SCREEN COMMENT [/][pos](len) text. Displays comments or
labels on the screen. The text can be a literal or a text symbol (e.g., text-001).
The FOR FIELD f addition is particularly important as it links the comment
semantically to a parameter or select-option f, enabling shared F1/F4 help
behavior and improving accessibility for screen readers.39
○ SELECTION-SCREEN ULINE [[/][pos](len)]. Draws a horizontal line for visual
separation of elements.40
○ SELECTION-SCREEN SKIP [n]. Inserts n blank lines (default is 1 if n is omitted)
for vertical spacing.
● Interactive Elements:
○ SELECTION-SCREEN PUSHBUTTON [/][pos](len) button_text USER-
COMMAND ucomm. Creates a pushbutton on the selection screen. When
clicked, it triggers the AT SELECTION-SCREEN event, and the specified
ucomm (user command) is passed to the system field sscrfields-ucomm. This
allows for interactive behavior beyond simple data input.41
● Tabbed Layouts:
○ SELECTION-SCREEN BEGIN OF TABBED BLOCK tblock FOR n LINES.
○ SELECTION-SCREEN TAB (len) tabname USER-COMMAND ucomm.
○ SELECTION-SCREEN END OF TABBED BLOCK tblock. These statements
create a tabstrip control on the selection screen. Each TAB defines a tab title
and is typically associated with a selection screen defined AS SUBSCREEN
(subscreen_dynnr) that forms the content of that tab page.43 This is
invaluable for organizing a large number of input fields into logical groups,
preventing overly long and cluttered screens.
● Reusing Elements:
○ SELECTION-SCREEN INCLUDE PARAMETERS p | SELECT-OPTIONS selcrit |
BLOCKS block | COMMENT comm | PUSHBUTTON push. This powerful
addition allows elements (parameters, select-options, entire blocks,
comments, or pushbuttons) already defined in another part of the selection
screen (e.g., on the standard selection screen) to be included in the current
user-defined selection screen or block.14 This promotes modularity and
reduces redundancy, especially in programs with multiple or complex
selection screens, by allowing common sets of inputs to be defined once and
reused.
C. Dynamic Control: Modifying Selection Screen Elements and Properties
ABAP provides a mechanism to dynamically alter the properties of selection screen
elements (like visibility, input-readiness, or highlighting) just before the screen is
displayed. This is primarily achieved during the AT SELECTION-SCREEN OUTPUT
event using the system internal table named SCREEN.22
The SCREEN table is populated by the system before AT SELECTION-SCREEN
OUTPUT is triggered and contains one row for each element on the current selection
screen. Developers can loop through this table, identify specific elements (e.g., by
their NAME or assigned MODIF ID), change their attributes in the work area, and then
use the MODIFY SCREEN statement to apply these changes.
Table 4: SCREEN Table - Key Fields for Dynamic Modification
SCREEN Field Name Description Typical Values (0/1, Purpose in Dynamic
X/' ') Modification
NAME Name of the screen To identify a specific
element (parameter, element.
SO-LOW/HIGH)
GROUP1 - GROUP4 Modification groups XXX (MODIF ID value) To collectively modify
assigned via MODIF elements belonging
ID to a group (e.g., hide
all fields in group
'G01').22
ACTIVE Element is active 1 (Active), 0 (Inactive) 0 makes the element
(visible and enabled) invisible and non-
interactive. Often
used with INVISIBLE.
INPUT Element is ready for 1 (Input), 0 (Display) 0 makes the field
input display-only.
OUTPUT Element is an output 1 (Output), 0 (Not Usually 1 for display
field output) fields.
INVISIBLE Element is invisible 1 (Invisible), 0 1 hides the element.
(Visible)
REQUIRED Element is a 1 (Required), 0 1 marks the field as
mandatory field (Optional) mandatory (similar to
OBLIGATORY but can
be set dynamically).
INTENSIFIED Element is displayed 1 (Intensified), 0 To draw attention to
intensified (Normal) a field.
(highlighted)
DISPLAY_3D Element is displayed 1 (3D), 0 (2D) Controls visual
with a 3D frame appearance of
(checkboxes/radio) certain elements.
VALUE_HELP Input help (F4) is 1 (Available), 0 (Not) Can be used to
available dynamically
enable/disable F4
help.
REQUEST Field content was 1 (Changed), 0 (Not) (More relevant in PAI)
changed by user in Indicates if the user
PAI modified the field.
Common dynamic modifications include 22:
● Hiding or showing elements: screen-invisible = '1' or screen-active = '0'.
● Enabling or disabling input: screen-input = '0' (display only) or screen-input = '1'
(input-enabled).
● Making fields dynamically mandatory: screen-required = '1'.
● Highlighting fields: screen-intensified = '1'.
The MODIF ID addition for parameters, select-options, and other screen elements is
crucial for efficiently managing dynamic changes. By assigning elements to a
modification group (e.g., MODIF ID GR1), developers can easily identify and modify all
elements belonging to that group by checking screen-group1 = 'GR1' (or group2,
group3, group4) within the LOOP AT SCREEN.21
This capability to dynamically adapt the UI allows for the creation of more responsive
and user-friendly selection screens. For instance, the visibility or input-readiness of
certain fields can be made dependent on the values entered in other fields or the
selection of specific radio buttons. This guides the user by presenting only relevant
options and reducing clutter. However, while this dynamic modification offers
significant flexibility, implementing overly complex interdependencies can render the
selection screen logic difficult to understand, debug, and maintain. A judicious
balance between dynamic behavior and the clarity and simplicity of the underlying
code is essential.
III. Categorization of Selection Screens: Types and Use Cases
Selection screens in ABAP can be categorized based on how they are defined, called,
and used within different program types. Understanding these distinctions is vital for
effective ABAP development.
Table 5: Comparative Overview of Selection Screen Types
Type Definition Invocation Dynpro No. Modality Primary Use
Method Case
Standard Implicitly Automatic 1000 Non-modal Default input
Selection from on program screen for
Screen PARAMETER execution executable
S, SELECT- (for reports) programs
OPTIONS (reports).5
not in BEGIN
OF SCREEN
blocks
User- SELECTION- Explicitly via Any!=1000 Non-modal Additional
Defined SCREEN CALL (default) or input
(Standalone) BEGIN OF SELECTION- Modal (AS dialogs,
SCREEN SCREEN WINDOW) specific
dynnr... END dynnr. input steps,
OF SCREEN use in
dynnr. module
pools/functio
n groups.5
LDB- Defined in Automatic 1000 Non-modal Standardize
Integrated LDB's when report d data
DBldbSEL linked to LDB retrieval for
include; is run reports
merged with using Logical
program's Databases.5
standard
screen
Selection SELECTION- Embedded in Any!=1000 N/A (part of Modularizing
Subscreen SCREEN host Dynpro host) complex UIs,
BEGIN OF (via CALL content for
SCREEN SUBSCREEN tab pages in
dynnr AS ) or selection tabbed
SUBSCREEN. screen tab blocks.8
.. END OF
SCREEN
dynnr.
A. The Standard Selection Screen (Dynpro 1000)
The standard selection screen is arguably the most frequently encountered type. It is
automatically defined for executable programs (reports) and always carries the
Dynpro number 1000.5 All PARAMETERS, SELECT-OPTIONS, and SELECTION-SCREEN
formatting statements that are not explicitly enclosed within a user-defined screen
block (SELECTION-SCREEN BEGIN OF SCREEN...) contribute to this standard
selection screen.14
A key characteristic is its automatic invocation: when an executable program is
started, its standard selection screen (if defined with any input elements) is displayed
without requiring an explicit CALL SCREEN statement from the developer.5 By default,
the title of the standard selection screen is the title of the executable program itself,
as defined in its attributes. This can be programmatically changed using the SET
TITLEBAR statement during the AT SELECTION-SCREEN OUTPUT event.9
The automatic generation and invocation of Dynpro 1000 greatly simplifies the
creation of typical reports. Developers can declare their necessary input fields, and
the system handles the complexities of screen creation and display. This significantly
lowers the barrier to entry for programs requiring user input, promoting rapid
development for common data retrieval and processing tasks. However, the inherent
nature of Dynpro 1000 as the standard selection screen means that its fundamental
processing behavior is largely system-controlled and less amenable to deep
customization compared to manually created Dynpros. While element properties can
be modified and input validated through selection screen events, the underlying flow
logic is predefined. This reinforces its role as a standardized, easy-to-use input
mechanism rather than a fully flexible, general-purpose screen.
B. User-Defined (Standalone) Selection Screens
For scenarios requiring more than one input screen or when selection screens are
needed in program types other than executable reports (like module pools or function
groups), user-defined selection screens are employed. These are explicitly defined
within the ABAP program using the syntax SELECTION-SCREEN BEGIN OF SCREEN
dynnr... END OF SCREEN dynnr..5
The dynnr can be any four-digit number except 1000 (which is reserved for the
standard selection screen) and must not conflict with other Dynpro numbers within
the same program.5 User-defined selection screens can have a custom TITLE
specified in their definition. Furthermore, the AS WINDOW addition allows them to be
displayed as modal dialog boxes, which float above the current screen and require
user interaction before control returns to the underlying screen.14 This modal behavior
is useful for focused input tasks, such as requesting specific filter criteria or
confirming actions with parameters, preventing interaction with the main screen until
the dialog is addressed.
Unlike the standard selection screen, user-defined selection screens are not called
automatically. They must be explicitly invoked using the CALL SELECTION-SCREEN
dynnr. statement.5 They can be utilized in executable programs, module pools, and
function groups. Notably, in module pools and function groups, only user-defined
selection screens can be implemented (as these program types do not have an
implicit standard selection screen 1000).5 A user-defined selection screen can even
serve as the initial screen of a transaction if defined within a module pool.5
User-defined selection screens provide significant modularity. They allow developers
to create multiple, specialized input dialogs within a single program. This is
particularly beneficial for complex applications that might require different sets of
inputs at various stages of processing or for different functionalities, improving UI
clarity by presenting only relevant inputs at any given time.
C. Selection Screens in Conjunction with Logical Databases (LDB)
Logical Databases (LDBs) are special ABAP programs that provide a particular view of
database tables and encapsulate data retrieval logic. When an executable program is
linked to an LDB, its standard selection screen (Dynpro 1000) is automatically
augmented. It becomes a composite of selections defined by the LDB itself and any
program-specific selections defined in the executable program.5 Typically, the LDB's
selection criteria appear first on the screen, followed by the program-specific ones.46
LDBs define their own parameters and select-options within a special include
program named DBldbSEL (where ldb is the name of the logical database).46 An
important detail is that only those LDB selection criteria whose corresponding
database tables (nodes in the LDB structure) are also declared in the executable
program (using NODES or TABLES statements) will actually appear on the selection
screen.46
LDBs often provide a feature called "Dynamic Selections." This allows users to click a
button on the application toolbar of the selection screen to access an additional
screen where they can choose fields from the LDB's underlying tables to use as
further filter criteria, even if these fields were not predefined as static parameters or
select-options on the main selection screen.46 This capability offered an early form of
user-configurable filtering, a precursor to more flexible ad-hoc querying seen in
modern analytical tools.
To offer further customization, LDBs can define "selection screen versions." These
are essentially variants of the LDB's own selection screen, assigned Dynpro numbers
less than 1000, where certain LDB fields can be hidden. An executable program can
then specify in its attributes which version of the LDB selection screen it wants to use,
allowing for a more tailored input experience.46
Logical Databases, with their predefined selection screens and encapsulated data
access logic (including authorization checks), aimed to standardize data retrieval for
related tables across multiple reports. While their usage has declined in modern ABAP
development, which tends to favor technologies like Core Data Services (CDS) views
and dedicated service layers, a vast amount of legacy SAP code and standard reports
still rely on LDBs. Therefore, understanding how their selection screens are
composed and interact with program-specific selections remains crucial for
maintaining and enhancing these existing applications.
D. Selection Screens as Reusable Subscreens
ABAP allows selection screens to be defined as subscreens, which can then be
embedded within other Dynpros or, more commonly, within tabstrip controls on other
selection screens. This is achieved using the syntax: SELECTION-SCREEN BEGIN OF
SCREEN dynnr AS SUBSCREEN... END OF SCREEN dynnr..5
A key characteristic of selection screens defined as subscreens is that they cannot
be called using the CALL SELECTION-SCREEN dynnr. statement.49 Instead, they
are incorporated into a "host" screen. If embedded into a regular Dynpro (created
with Screen Painter), the host Dynpro's flow logic must include the CALL SUBSCREEN
area_name INCLUDING sy-repid subscreen_dynnr. statement in both its PBO and PAI
event blocks to manage data transport and display.48 This indicates that while the
definition of the selection subscreen leverages familiar ABAP selection screen
keywords, its integration into a classical Dynpro relies on standard Dynpro subscreen
handling mechanisms.
Selection subscreens are particularly useful for modularizing complex user interfaces.
For instance, when using a SELECTION-SCREEN BEGIN OF TABBED BLOCK... to
create tabs on a selection screen, each tab page typically hosts a subscreen. A
selection screen defined AS SUBSCREEN can then provide the content for one of
these tabs.43 This allows developers to encapsulate related sets of parameters and
select-options onto their own dedicated selection subscreens, which are then
assembled into a cohesive, tabbed interface. This approach significantly improves the
organization and usability of selection screens that would otherwise be overly long or
complex.
Additions like NO INTERVALS (which narrows the subscreen if it only contains select-
options without intervals) and NESTING LEVEL n (which adjusts subscreen width
when embedded within frames, like those in tabstrip controls) are particularly
relevant for ensuring proper layout and appearance when using selection
subscreens.48
IV. The Lifecycle of Selection Screens: Processing, Events, and
Validation
The processing of selection screens in ABAP follows a well-defined lifecycle governed
by a sequence of events. Developers can write code in event blocks associated with
these events to initialize fields, dynamically modify the screen, validate user input,
and provide custom help.
Table 6: Key Selection Screen Processing Events
Event Trigger Point Primary Purpose
INITIALIZATION Once, before the (first) Set default values for
selection screen is displayed parameters, select-options,
for the first time. and other screen elements
(e.g., selection screen
comments).22
AT SELECTION-SCREEN Before the selection screen is Dynamic modifications to
OUTPUT displayed (after screen elements (hide/show,
INITIALIZATION, and after PAI enable/disable, intensify)
if errors or refresh needed). using the SCREEN table.22
`AT SELECTION-SCREEN ON select-option}` PAI: After input for a specific
{parameter\ parameter or select-option
line is transferred to ABAP.
AT SELECTION-SCREEN ON PAI: After all values for a Validation or processing of
END OF {select-option} select-option (potentially the complete select-option
from multiple selection table.
popup) are transferred.
AT SELECTION-SCREEN ON PAI: After all values in a Validation of interdependent
BLOCK block_name named block are transferred. fields within a block.52
AT SELECTION-SCREEN ON PAI: When a radio button React to radio button
RADIOBUTTON GROUP within the specified group is changes, often to dynamically
group_name selected. adjust other screen parts.52
AT SELECTION-SCREEN ON POH: User presses F1 (Help) Provide custom F1 field help,
HELP-REQUEST FOR {field} on the specified field overriding Dictionary help.51
(parameter, selopt-low, or
selopt-high).
AT SELECTION-SCREEN ON POV: User presses F4 Provide custom F4 value help,
VALUE-REQUEST FOR {field} (Possible Entries) on the overriding Dictionary help.52
specified field (parameter,
selopt-low, or selopt-high).
AT SELECTION-SCREEN PAI: After all user inputs are General validation of all
(general) transferred and after more inputs, cross-field
specific AT SELECTION- consistency checks.22
SCREEN ON... events.
AT SELECTION-SCREEN ON PAI: User clicks Back (F3), Exit Perform cleanup actions
EXIT-COMMAND (Shift+F3), or Cancel (F12) before exiting selection
function. screen processing.51
START-OF-SELECTION After all selection screen Beginning of the main data
processing and validations processing logic of the
are successful and user program.
executes the program (e.g.,
F8).
A. The Standard Event Processing Flow
The standard flow of events provides a clear and predictable structure for selection
screen processing, allowing developers to intervene at logical points:
1. INITIALIZATION: This is the very first event triggered in relation to selection
screen processing, occurring only once before the selection screen (either the
standard screen 1000 or the first user-defined screen if no standard screen
elements exist) is displayed to the user for the first time. It is the ideal place to
set initial default values for parameters and select-options, or to initialize texts
for SELECTION-SCREEN COMMENT elements that are defined with a variable
name.22
2. AT SELECTION-SCREEN OUTPUT: This event is triggered every time just before
the selection screen is actually displayed. This includes the first display (after
INITIALIZATION) and any subsequent redisplays, such as after a user action that
requires a screen refresh (e.g., pressing Enter, a pushbutton click that modifies
the screen) or if a validation error in a PAI event block causes the screen to be
shown again.22 This event block is primarily used for dynamic modifications to
screen elements using the SCREEN internal table (discussed in section II.C).
3. User Interaction: The user interacts with the selection screen by entering data
into input fields, selecting checkboxes or radio buttons, clicking pushbuttons, or
pressing function keys like Enter or Execute (F8).
4. AT SELECTION-SCREEN (and its PAI variants): When the user performs an
action that triggers the Process After Input (PAI) logic of the selection screen
Dynpro (e.g., pressing Enter, clicking a pushbutton with a USER-COMMAND, or
executing the report), the values from the input fields are transferred to the
corresponding ABAP variables. Subsequently, the various AT SELECTION-
SCREEN event blocks are triggered. These are the primary events for validating
the user's input. If a validation check within one of these event blocks fails and an
error message (e.g., MESSAGE TYPE 'E'...) is issued, the processing of the current
PAI event typically stops, the selection screen is redisplayed with the fields ready
for input again (often with the cursor on or near the erroneous field), and the AT
SELECTION-SCREEN OUTPUT event is triggered once more before the screen is
shown.22
A critical detail for error handling is the context in which an error message is
issued. Issuing MESSAGE... TYPE 'E' within an AT SELECTION-SCREEN OUTPUT
event block can lead to the transaction terminating unexpectedly. In contrast, the
same error message within an AT SELECTION-SCREEN (PAI) event block will
correctly halt further processing, display the error to the user, and keep them on
the selection screen to correct their input.22 This distinction underscores the
importance of placing input validation logic in the appropriate PAI-related event
blocks.
5. START-OF-SELECTION: If all input validations in the AT SELECTION-SCREEN
events pass successfully and the user executes the program (e.g., by pressing F8
or an equivalent pushbutton), the START-OF-SELECTION event is triggered. This
event marks the end of selection screen processing and the beginning of the
main application logic of the program (e.g., data retrieval, calculation, output
generation).
This well-defined sequence ensures that operations occur in a logical order: defaults
are set, the screen is dynamically prepared, user input is received and validated, and
only then does the main program logic commence. This structured lifecycle is crucial
for building robust and predictable ABAP applications.
B. Granular Control: Field, Block, and Element-Specific Events
Beyond the general AT SELECTION-SCREEN event, ABAP provides more granular
event blocks that allow for targeted logic execution based on specific fields, blocks,
or user actions 17:
● AT SELECTION-SCREEN ON {parameter|select-option}: This event is
triggered when the user has entered or changed data in the specified parameter
or a line of the select-option, and this data is transferred to the ABAP program
(typically on pressing Enter or a similar PAI-triggering action). It's ideal for field-
specific validation or for triggering dynamic screen modifications based on the
value of a particular field.52 For example, if a user selects a specific plant, this
event could trigger logic to populate a list of storage locations relevant only to
that plant. Using such field-specific events, instead of re-validating all fields in
the general AT SELECTION-SCREEN event on every PAI, can lead to more
efficient processing and clearer, more modular code.
● AT SELECTION-SCREEN ON END OF {select-option}: This event is specific to
select-options and fires after all entries for that select-option (which could be
multiple rows if the user utilized the multiple selection dialog) have been
transferred to the program. It's useful for validating the entirety of a complex
selection criterion.
● AT SELECTION-SCREEN ON BLOCK block_name: If selection screen elements
are grouped into a named block using SELECTION-SCREEN BEGIN OF BLOCK
block_name, this event is triggered after all input values within that block have
been transferred to the ABAP program. This is useful for validating
interdependent fields that logically belong together within that block.52
● AT SELECTION-SCREEN ON RADIOBUTTON GROUP group_name: This event
fires when a radio button within the specified group_name is selected by the
user. It allows the program to react immediately to changes in radio button
selections, often to dynamically enable/disable or show/hide other screen
elements that are dependent on this choice.52
● AT SELECTION-SCREEN ON EXIT-COMMAND: This event is triggered if the
user initiates an exit command, such as clicking the standard Back (F3), Exit
(Shift+F3), or Cancel (F12) pushbuttons on the GUI status. This event block allows
the program to perform any necessary cleanup actions before selection screen
processing is terminated.51
The USER-COMMAND addition, available for pushbuttons, checkboxes, and radio
button groups 21, is fundamental to making selection screens interactive. When a user
interacts with an element that has a USER-COMMAND fcode defined, a PAI is
triggered, the fcode is typically placed in sscrfields-ucomm, and the relevant AT
SELECTION-SCREEN event block is processed. Inside this event block, the developer
can check the fcode and execute logic that might alter global variables. These
variables can then be used in the subsequent AT SELECTION-SCREEN OUTPUT event
to dynamically modify the screen layout or field properties. This sequence—User
Action -> PAI with fcode -> AT SELECTION-SCREEN logic -> AT SELECTION-SCREEN
OUTPUT logic -> Screen Refresh—is the cornerstone of creating dynamic and
responsive selection screens.
C. Implementing User Assistance: F1 Help and F4 Value Help
Effective user assistance through field help (F1) and possible entries help (F4) is
crucial for usability. ABAP selection screens offer strong integration with the ABAP
Dictionary to provide these automatically, along with event-driven mechanisms for
custom help.
F1 Help (Field Documentation):
● Automatic F1 Help: If a parameter or select-option is typed with reference to an
ABAP Dictionary data element (e.g., PARAMETERS p_matnr LIKE mara-matnr.),
the system automatically displays the documentation maintained for that data
element when the user presses F1 on the corresponding screen field.16 This tight
integration is a significant productivity feature, as documentation defined once in
the Dictionary is reused wherever the data element appears.
● Custom F1 Help: For more specific or dynamic help, developers can implement
the AT SELECTION-SCREEN ON HELP-REQUEST FOR {parameter|selcrit-low|
selcrit-high} event.50 Inside this event block, one can call function modules like
HELP_OBJECT_SHOW or DSYS_SHOW_FOR_F1HELP to display custom
documentation objects or dynamically generated help texts. Implementing this
event overrides any default Dictionary-based F1 help for that field.51
F4 Help (Possible Entries Help):
● Automatic F4 Help: The system automatically provides F4 help if a parameter or
select-option is typed with reference to an ABAP Dictionary type that has one of
the following defined 18:
○ A domain with fixed values or an explicitly assigned value table.
○ An attached search help (elementary or collective).
○ A check table (defined via a foreign key relationship). The key fields of the
check table are often proposed as possible entries. If the check table has a
text table, the texts are also displayed.31
● Custom F4 Help: When standard Dictionary help is insufficient (e.g., if possible
values depend on other inputs on the screen), custom F4 help can be
implemented using the AT SELECTION-SCREEN ON VALUE-REQUEST FOR
{parameter|selcrit-low|selcrit-high} event.50 Within this event block, developers
can:
○ Call function modules like F4IF_INT_TABLE_VALUE_REQUEST to display a list
of values constructed dynamically in an internal table.
○ Use F4IF_FIELD_VALUE_REQUEST to programmatically trigger a specific
search help.
○ Implement entirely custom logic to determine and display possible entries.
This custom implementation overrides any default Dictionary-based F4 help.51
This "escape hatch" mechanism provides full programmatic control over the
F4 help process, offering immense flexibility for complex, context-dependent
scenarios.
For parameters defined AS LISTBOX, the list of values is typically populated by calling
the function module VRM_SET_VALUES within the AT SELECTION-SCREEN OUTPUT
event or, if the list depends on other field values, potentially within an AT SELECTION-
SCREEN ON VALUE-REQUEST FOR... event for that listbox parameter.15
D. Ensuring Data Integrity: Input Validation Techniques
Robust input validation is essential to ensure data integrity and prevent errors in
subsequent processing. Selection screens offer several mechanisms for this:
1. OBLIGATORY Addition: For PARAMETERS and the LOW field of SELECT-
OPTIONS, this declarative addition ensures that the user must enter a value in
the field. If the field is left blank and the user attempts to execute, an error
message is displayed, and processing does not proceed.15
2. VALUE CHECK Addition: Used with PARAMETERS that are typed with reference
to ABAP Dictionary fields. This addition automatically validates the user's input
against:
○ Fixed values or value ranges defined in the domain of the data type.
○ The key values of a check table if a foreign key relationship exists for the
field.16 If the input value does not conform to these Dictionary rules, the
system issues an error message in the status bar, and the field remains input-
enabled for correction.24 Since this check is performed even if the input field
is empty, it's often recommended to use VALUE CHECK in conjunction with
OBLIGATORY for required fields.24
3. Custom Validation in AT SELECTION-SCREEN Events: For more complex
validation logic that cannot be covered by declarative means (e.g., cross-field
consistency checks, authorization checks, business rule validation), developers
write custom ABAP code within the AT SELECTION-SCREEN event blocks
(general, ON field, ON BLOCK, etc.).22
○ Within these event blocks, the program can check the values of parameters
and select-options.
○ If an invalid condition is detected, a message should be issued using the
MESSAGE statement. MESSAGE... TYPE 'E' (Error) will typically prevent the
program from proceeding to START-OF-SELECTION and will redisplay the
selection screen with the erroneous field(s) ready for input. MESSAGE... TYPE
'W' (Warning) will display a message but may allow processing to continue,
depending on user action. MESSAGE... TYPE 'S' (Success) or 'I' (Information)
can also be used to provide feedback without halting processing. The
system's behavior of redisplaying the screen with the erroneous field input-
enabled upon MESSAGE E... in AT SELECTION-SCREEN is a key part of
effective error handling, allowing users to correct their input directly.22
4. ABAP Dictionary Data Types: Simply using appropriate data types from the
ABAP Dictionary (e.g., DATS for dates, TIMS for times, specific numeric types)
provides a level of inherent basic validation, as the system will often prevent
fundamentally incorrect entries (e.g., non-numeric characters in a numeric field)
at the GUI level or during data transport.
A multi-layered approach to validation is generally considered best practice.
Declarative checks like OBLIGATORY and VALUE CHECK handle common and
straightforward validation scenarios with minimal code. Programmatic checks within
AT SELECTION-SCREEN events are then used to implement more complex business
rules and cross-field validations. This combination leverages the simplicity of
declarative syntax for basic cases and the full power of ABAP for intricate logic,
leading to robust and comprehensive input validation. Proper error message handling
is also paramount; messages should be clear, concise, and guide the user directly to
the error, facilitating easy correction.
V. Advanced Topics and Best Practices for Selection Screens
Beyond the fundamental definition and event processing, several advanced topics
and best practices contribute to creating more usable, efficient, and maintainable
selection screens.
A. Enhancing Usability and Automation with Selection Screen Variants
Selection screen variants are a powerful feature that allows users and developers to
save and reuse sets of input values for any program that uses selection screens.5
Purpose and Creation:
If a program is frequently executed with the same or similar input criteria, users can enter
these values once on the selection screen and then save them as a named variant (typically
via the menu path Goto -> Variants -> Save as Variant).10 When creating a variant, various
attributes can be set 10:
● Variant Name and Description: For identification.
● Protect variant: Prevents other users from changing the variant.
● Only for background processing: Restricts the variant to be used only when the
program is run in the background. This is a critical attribute for batch processing,
ensuring that variants designed for potentially large data selections in
background mode are not inadvertently run in dialog mode.
● Hide field: Makes specific selection screen fields invisible when this variant is
used.
● Protect field (Save field without value): Makes specific fields display-only, or
saves them without a value that must be entered at runtime.
● Selection variable: Allows dynamic value determination for fields at runtime
(e.g., current date, end of month).
Usage:
● Dialog Mode: Variants significantly simplify execution for end-users by pre-filling
the selection screen, reducing manual entry and potential errors.12 They can also
tailor the screen's appearance by hiding irrelevant fields for specific tasks or user
groups, without altering the underlying ABAP program. This customization is
achieved purely through variant settings, offering a flexible way to adapt
standard or complex reports.
● Background Processing: Variants are essential for scheduling programs to run
in background jobs. When a program is run in the background, there is no
interactive user to provide input, so a variant must be specified to supply the
necessary parameter and select-option values.12
Management and Transport:
Variants can be displayed, changed, copied, or deleted.12 System variants, whose names
typically start with "CUS&" (for customer-specific variants) or "SAP&" (for SAP standard
variants), can be included in transport requests and moved between systems.11 The program
RSTRANSP is often used for transporting variants.56 This transportability is crucial for
ensuring consistent program behavior across development, quality assurance, and
production environments.
B. Programmatic Interaction with Selection Screens
ABAP programs can call other executable programs (reports) and pass values to their
selection screens programmatically using the SUBMIT statement.5 This is a
cornerstone of modular design and report chaining.
Key additions to the SUBMIT statement for selection screen interaction include:
● SUBMIT rep | (name_variable): Specifies the program to be called, either statically
(rep) or dynamically via a variable name_variable holding the program name.
● VIA SELECTION-SCREEN: If this addition is present, the selection screen of the
called program is displayed to the user, allowing them to review or modify the
passed values before execution. If omitted, selection screen processing happens
in the background (values are passed, events are triggered, but no screen is
shown).
● USING SELECTION-SET variant: Fills the selection screen of the called program
with values stored in the specified variant.
● WITH sel {EQ|NE|...} val or WITH sel BETWEEN val1 AND val2 or WITH sel IN rtab:
Passes specific values to individual parameters (sel) or select-options (sel) on the
called program's selection screen. rtab is a ranges table compatible with the
select-option.
● WITH SELECTION-TABLE rspar: This provides a highly flexible method to pass
multiple, dynamically constructed selection criteria. rspar is an internal table of
type RSPARAMS (or RSPARAMS_255), where each row defines a selection
criterion (name, kind, sign, option, low, high).58 This is more powerful than multiple
WITH sel val clauses for complex or dynamically determined inputs.
● AND RETURN: This crucial addition ensures that after the called program
completes its execution, control returns to the statement following the SUBMIT in
the calling program.57 Without AND RETURN, the calling program's session is
terminated, and control does not return. This enables the creation of modular
applications where one program can invoke another as a sub-function and then
continue its own processing, potentially based on results from the called program
(e.g., data exported to memory or spool lists).
Additionally, SAP provides various function modules (e.g., RS_CREATE_VARIANT,
RS_CHANGE_VARIANT, RS_VARIANT_CONTENTS, RS_VARIANT_DELETE,
RS_VARIANT_EXISTS) for programmatically creating, modifying, reading, and
managing selection screen variants.
C. Designing for Accessibility
While classical ABAP selection screens were developed before many modern
accessibility standards became prevalent, certain design considerations can improve
their usability for individuals with disabilities:
● Semantic Linking of Labels: Using the SELECTION-SCREEN COMMENT... FOR
FIELD... syntax is paramount.39 This explicitly links a descriptive text (comment) to
an input field (parameter or select-option). Screen reader software can then
correctly announce the label associated with an input field, providing essential
context for visually impaired users.
● Logical Grouping and Tab Order: Employing SELECTION-SCREEN BEGIN OF
BLOCK... WITH FRAME TITLE... to group related fields and ensuring a logical
declaration order (which generally dictates the tab order) helps users navigate
the screen predictably using the keyboard.
● Keyboard Accessibility: Ensure that all functionalities available via mouse clicks
(e.g., executing the report, triggering F4 help) also have keyboard equivalents
(e.g., F8 for execute, F4 key for value help). Standard SAP GUI functions usually
adhere to this.
● Clear Visual Cues: While not strictly an accessibility feature for all, using
INTENSIFIED for important fields or providing clear visual separation with ULINE
can aid some users.
Conscious effort in applying these techniques, even within the constraints of older
technology, can significantly enhance the accessibility of selection screens.
D. Performance Considerations
The performance of selection screen processing can directly impact user satisfaction,
as it's the first interactive part of many programs. Sluggish selection screens create a
poor first impression. Key areas for performance consideration include:
● AT SELECTION-SCREEN OUTPUT Logic: This event block fires every time the
selection screen is (re)displayed. Avoid placing time-consuming operations (like
complex database reads or extensive loops over the SCREEN table for minor
modifications) within it. If data is needed from the database to dynamically set
field properties, fetch it efficiently and, if possible, only once or when truly
necessary.
● Custom F4 Help (AT SELECTION-SCREEN ON VALUE-REQUEST): If custom
F4 help involves database lookups to populate the list of possible entries, these
lookups must be highly optimized. Avoid fetching unnecessarily large datasets.
Use appropriate indexes and filter conditions. Consider buffering frequently
accessed, relatively static F4 help data if appropriate.
● VALUE CHECK Performance: While VALUE CHECK is convenient, be aware that
checks against large, unbuffered check tables can sometimes be slow. Ensure
that underlying check tables are appropriately indexed if performance issues
arise. Table buffering for check tables is often utilized by the system.25
● Minimizing Database Reads During Events: In general, any database access
within selection screen event blocks should be scrutinized for necessity and
efficiency. Defer non-essential data retrieval to START-OF-SELECTION if
possible.
By being mindful of these aspects, developers can ensure that selection screens
remain responsive and contribute positively to the overall user experience.
VI. Conclusion and Strategic Recommendations
User interaction in ABAP, particularly through the SAP GUI and its classical Dynpro
mechanisms, has a long and established history. Selection screens stand out as a
specialized, declarative, and highly utilized method for defining user input interfaces,
especially for report programs. They offer a balance between standardization, which
promotes consistency and rapid development, and customization, which allows
developers to tailor input processes to specific business needs.
A. Synthesizing Key Learnings on ABAP User Interaction and Selection Screens
The journey from the traditional SAP GUI to modern paradigms like SAP Fiori
illustrates a significant evolution in UI philosophy, driven by changing user
expectations and technological advancements.1 However, the foundational concepts
of event-driven processing (PBO/PAI in Dynpros, selection screen events), data
binding (albeit simpler in classical ABAP), and modular UI construction (subscreens)
learned in the context of classical ABAP provide a valuable conceptual basis for
understanding newer UI technologies.
Selection screens, generated from ABAP statements like PARAMETERS, SELECT-
OPTIONS, and SELECTION-SCREEN, offer a powerful abstraction over manual Dynpro
design for input scenarios.5 Their dual role as both a direct user interface and a
programmatic interface via the SUBMIT statement underpins much of the modularity
found in ABAP reporting and batch processing landscapes.5 The structured event
model (INITIALIZATION, AT SELECTION-SCREEN OUTPUT, various AT SELECTION-
SCREEN PAI events, START-OF-SELECTION) provides clear extension points for
custom logic, from defaulting values and dynamic screen modifications to complex
input validation and user assistance.22
B. Recommendations for Optimal Selection Screen Design
To create effective, usable, and maintainable selection screens, developers should
adhere to the following best practices:
1. Prioritize Clarity and Simplicity: Design selection screens from the user's
perspective. Group related fields logically using BLOCKS and TABS. Use clear
and descriptive labels (via selection texts or SELECTION-SCREEN COMMENT
FOR FIELD). Avoid overly cluttered screens; if many inputs are required, consider
breaking them down into multiple user-defined screens or tabs.
2. Leverage ABAP Dictionary Integration: Maximize the use of ABAP Dictionary
types for PARAMETERS and SELECT-OPTIONS. This provides automatic F1 help,
F4 value help (from domains, check tables, search helps), and enables robust
VALUE CHECK validation with minimal coding effort.16
3. Utilize Variants Effectively: Encourage users to create and use variants for
frequently run reports with common selections. Design variants specifically for
background processing, utilizing attributes like "Only for background processing"
and dynamic date variables where appropriate.10 Ensure transportable system
variants ("CUS&") are used for standard batch jobs.
4. Modularize Complex Screens: For selection screens with a large number of
inputs, use SELECTION-SCREEN BEGIN OF SCREEN... AS SUBSCREEN to define
modular parts and assemble them using SELECTION-SCREEN BEGIN OF TABBED
BLOCK.43 The SELECTION-SCREEN INCLUDE statement can also help reduce
redundancy within a program.14
5. Implement Comprehensive Validation: Employ a multi-layered validation
strategy. Use declarative additions like OBLIGATORY and VALUE CHECK for basic
checks. Implement custom business logic and cross-field validation in the
appropriate AT SELECTION-SCREEN event blocks. Provide clear, concise, and
actionable error messages using the MESSAGE statement, ensuring they guide
the user to the point of error.22
6. Consider Performance: Write efficient ABAP code within all selection screen
event blocks, especially AT SELECTION-SCREEN OUTPUT and custom F4 help
implementations (AT SELECTION-SCREEN ON VALUE-REQUEST). Minimize
database accesses during these events to ensure a responsive user interface.
7. Design for Accessibility: Use SELECTION-SCREEN COMMENT... FOR FIELD... to
link labels to input fields. Ensure a logical tab order and provide keyboard
alternatives for all actions to improve usability for all users.39
C. Future Directions: Evolving UI Paradigms in SAP
The SAP ecosystem is progressively shifting towards modern UI paradigms like SAP
Fiori, which leverages SAPUI5 (HTML5) for a more contemporary, responsive, and
user-centric experience across devices.1 While new application development
increasingly focuses on these technologies, the vast existing codebase of ABAP
reports and classical Dynpro applications ensures that selection screens will remain
relevant for maintenance and specific use cases for many years to come.
Understanding the principles of classical user interaction in ABAP, such as the event-
driven nature of screens, the importance of data validation, and the concept of
modular UI components, provides a solid conceptual foundation that can aid
developers in transitioning to and mastering newer UI frameworks. The core
challenges of gathering user input, validating it, and providing assistance are
universal, even as the technologies to address them evolve. Therefore, expertise in
ABAP selection screens remains a valuable skill for any ABAP developer working
within the SAP landscape.
Works cited
1. Exploring SAP Front-End Technologies, accessed on May 29, 2025,
https://learning.sap.com/learning-journeys/introducing-sap-abap-platform-
fundamentals/exploring-sap-front-end-technologies-1
2. User Interfaces - ABAP Keyword Documentation - SAP Help Portal, accessed on
May 29, 2025,
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenuser_interfa
ces_guidl.htm
3. Introducing the SAP GUI, accessed on May 29, 2025,
https://learning.sap.com/learning-journeys/introducing-sap-abap-platform-
fundamentals/introducing-the-sap-gui-1
4. General Dynpros - SAP Help Portal, accessed on May 29, 2025,
https://help.sap.com/doc/saphelp_nw74/7.4.16/en-us/4a/3ba64275771cb8e1000
0000a42189b/frameset.htm
5. Selection Screens - SAP Help Portal, accessed on May 29, 2025,
https://help.sap.com/doc/saphelp_nw73ehp1/7.31.19/en-US/4a/43c0475a503f04
e10000000a421937/content.htm
6. SAP Classic Dynpro and OO programming. Why not? - Stack Overflow, accessed
on May 29, 2025, https://stackoverflow.com/questions/36008783/sap-classic-
dynpro-and-oo-programming-why-not
7. help.sap.com, accessed on May 29, 2025,
https://help.sap.com/doc/saphelp_nw73ehp1/7.31.19/en-US/4a/43c0475a503f04
e10000000a421937/content.htm#:~:text=Selection%20screens%20are%20a
%20standardized,data%20read%20from%20the%20database.
8. Selection Screens - SAP Documentation - SAP Help Portal, accessed on May 29,
2025,
https://help.sap.com/doc/saphelp_gbt10/1.0/en-US/4a/43c0475a503f04e10000
000a421937/content.htm
9. Abenselection screen overview - ABAP docs, accessed on May 29, 2025,
https://eduardocopat.github.io/abap-docs/7.54/abenselection_screen_overview/
10. Save Variants | SAP Help Portal, accessed on May 29, 2025,
https://help.sap.com/docs/ERP_HCM/a353317f4d7147f48c04361df8384d62/
a793e0535e56424de10000000a174cb4.html?version=6.04.latest
11. Creating Variants - SAP Help Portal, accessed on May 29, 2025,
https://help.sap.com/doc/saphelp_nw75/7.5.5/en-US/c0/980389e58611d194cc00
a0c94260a5/content.htm
12. Variant Maintenance - SAP Help Portal, accessed on May 29, 2025,
https://help.sap.com/doc/saphelp_nw75/7.5.5/en-US/c0/980374e58611d194cc00
a0c94260a5/content.htm
13. Variants: Overview (SAP Library - ABAP Workbench Tools) - SAP Help Portal,
accessed on May 29, 2025,
https://help.sap.com/doc/saphelp_snc700_ehp01/7.0.1/en-US/c0/98037ae58611d
194cc00a0c94260a5/content.htm
14. Defining Selection Screens - SAP Help Portal, accessed on May 29, 2025,
https://help.sap.com/doc/saphelp_scm700_ehp02/7.0.2/en-US/4a/43c2a55a503f
04e10000000a421937/content.htm
15. Selection Screen in Sap ABAP | PDF | Parameter (Computer Programming) -
Scribd, accessed on May 29, 2025,
https://www.scribd.com/document/421003081/Selection-Screen-in-Sap-ABAP
16. Basic Form of Parameters - SAP Help Portal, accessed on May 29, 2025,
https://help.sap.com/doc/saphelp_em900/9.0/en-US/4a/44b10797311cd4e10000
000a421937/content.htm
17. PARAMETERS - ABAP Keyword Documentation - SAP Help Portal, accessed on
May 29, 2025,
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapparameter
s.htm
18. ABAP Dictionary - SAP Help Portal, accessed on May 29, 2025,
https://help.sap.com/doc/saphelp_nw75/7.5.5/en-US/cf/21ea0b446011d1897000
00e8322d00/frameset.htm
19. Default Values for Parameters - SAP Help Portal, accessed on May 29, 2025,
https://help.sap.com/docs/SAP_NETWEAVER_700/a85596deeb19418982bee031d
1fd1427/4a44badb954c0453e10000000a421937.html
20. Default Values for Parameters - SAP Help Portal, accessed on May 29, 2025,
https://help.sap.com/doc/saphelp_nw73ehp1/7.31.19/en-US/4a/44badb954c0453
e10000000a421937/content.htm
21. { {[OBLIGATORY|NO-DISPLAY] [VISIBLE LENGTH vlen]} - ABAP Keyword
Documentation, accessed on May 29, 2025,
https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapparameters
_screen.htm
22. Selection Screen Events in SAP ABAP - Vidhi Chijwani's Blog, accessed on May 29,
2025, https://vidi.hashnode.dev/selection-screen-events-in-sap-abap
23. PARAMETERS, screen_options - ABAP Keyword Documentation - SAP Help
Portal, accessed on May 29, 2025,
https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/abapparamet
ers_screen.htm
24. Checking Input Values - SAP Help Portal, accessed on May 29, 2025,
https://help.sap.com/doc/saphelp_nw73ehp1/7.31.19/en-US/4a/439cbb5a503f04
e10000000a421937/content.htm
25. PARAMETERS - value_options - ABAP Keyword Documentation - SAP Help Portal,
accessed on May 29, 2025,
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapparameters
_value.htm
26. Parameters in the User Memory - ABAP Keyword Documentation - SAP Help
Portal, accessed on May 29, 2025,
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenmemory.ht
m
27. SPA/GPA Parameters as Default Values - SAP Help Portal, accessed on May 29,
2025,
https://help.sap.com/doc/saphelp_gbt10/1.0/en-US/4a/43c6fc5a503f04e100000
00a421937/content.htm
28. PARAMETERS - ABAP Keyword Documentation - SAP Help Portal, accessed on
May 29, 2025,
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapparameter
s_shortref.htm
29. Selection Screens, Display Properties for Parameters - ABAP Keyword
Documentation, accessed on May 29, 2025,
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abensel_screen_
param_screen_abexa.htm
30. Classic Objects in ABAP Dictionary - ABAP Keyword Documentation - SAP Help
Portal, accessed on May 29, 2025,
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenddic_classi
cal_objects.htm
31. Input Help from the ABAP Dictionary - SAP Help Portal, accessed on May 29,
2025,
https://help.sap.com/doc/saphelp_nw73ehp1/7.31.19/en-US/4a/439ebd5a503f04
e10000000a421937/content.htm
32. Check Table and Value Table - SAP Community, accessed on May 29, 2025,
https://community.sap.com/t5/application-development-and-automation-blog-
posts/check-table-and-value-table/ba-p/13479817
33. ABAP Index - ABAP Keyword Documentation - SAP Help Portal, accessed on May
29, 2025,
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenabap_index.
htm
34. SELECT-OPTIONS - ABAP Keyword Documentation - SAP Help Portal, accessed
on May 29, 2025, https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-
US/abapselect-options.htm
35. SELECT-OPTIONS - FOR - ABAP Keyword Documentation - SAP Help Portal,
accessed on May 29, 2025,
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapselect-
options_for.htm
36. SELECTION-SCREEN - ABAP Keyword Documentation, accessed on May 29,
2025,
https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/abapselectio
n-screen.htm
37. selection-screen - block - ABAP Keyword Documentation, accessed on May 29,
2025,
https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselection-
screen_block.htm
38. SELECTION-SCREEN - BLOCK - ABAP Keyword Documentation - SAP Help
Portal, accessed on May 29, 2025,
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapselection-
screen_block.htm
39. SELECTION-SCREEN - COMMENT - ABAP Keyword Documentation, accessed on
May 29, 2025,
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapselection-
screen_comment.htm
40. SELECTION-SCREEN - ULINE - ABAP Keyword Documentation, accessed on May
29, 2025,
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapselection-
screen_uline.htm
41. SELECTION-SCREEN - PUSHBUTTON - ABAP Keyword Documentation - SAP Help
Portal, accessed on May 29, 2025,
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapselection-
screen_pushbutton.htm
42. Abapselection screen pushbutton - ABAP docs, accessed on May 29, 2025,
https://eduardocopat.github.io/abap-docs/7.31/abapselection-
screen_pushbutton/
43. SELECTION-SCREEN - TABBED BLOCK - ABAP Keyword Documentation,
accessed on May 29, 2025,
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapselection-
screen_tabbed.htm
44. SELECTION-SCREEN, TABBED BLOCK - ABAP Keyword Documentation - SAP
Help Portal, accessed on May 29, 2025,
https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/abapselectio
n-screen_tabbed.htm
45. Selection Screens, Display Properties for Parameters - ABAP Keyword
Documentation - SAP Help Portal, accessed on May 29, 2025,
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abensel_screen_
param_screen_abexa.htm
46. Logical Databases - Selections - ABAP Keyword Documentation - SAP Help
Portal, accessed on May 29, 2025,
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenldb_selectio
ns.htm
47. Selection Screens and Logical Databases - SAP Help Portal, accessed on May 29,
2025,
https://help.sap.com/doc/saphelp_nw73ehp1/7.31.19/en-US/4a/43c3225a503f04e
10000000a421937/content.htm
48. Selection Screens as Subscreens - SAP Help Portal, accessed on May 29, 2025,
https://help.sap.com/doc/saphelp_nw73ehp1/7.31.19/en-US/4a/43c16a5a503f04e
10000000a421937/content.htm
49. SELECTION-SCREEN - AS SUBSCREEN - ABAP Keyword Documentation - SAP
Help Portal, accessed on May 29, 2025,
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapselection-
screen_subscreen.htm
50. Selection Screen Events in ABAP | SAP Help Portal, accessed on May 29, 2025,
https://help.sap.com/docs/SUPPORT_CONTENT/abap/3353526057.html
51. AT SELECTION-SCREEN - selscreen_event - ABAP Keyword Documentation -
SAP Help Portal, accessed on May 29, 2025,
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapat_selectio
n-screen_events.htm#!ABAP_ALTERNATIVE_7@7@
52. AT SELECTION-SCREEN - selscreen_event - ABAP Keyword Documentation,
accessed on May 29, 2025,
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapat_selectio
n-screen_events.htm#!ABAP_ALTERNATIVE_1@1@
53. AT SELECTION-SCREEN - ABAP Keyword Documentation - SAP Help Portal,
accessed on May 29, 2025,
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapat_selection
-screen_shortref.htm
54. help.sap.com, accessed on May 29, 2025,
https://help.sap.com/doc/saphelp_nw73ehp1/7.31.19/en-US/4a/44bb4a954c0453
e10000000a421937/content.htm
55. accessed on January 1, 1970,
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameters
_value.htm
56. Transporting Select Screen Variant - SAP Help Portal, accessed on May 29, 2025,
https://help.sap.com/docs/SUPPORT_CONTENT/abap/3353525770.html
57. Submit a report - AbapcadabrA, accessed on May 29, 2025,
http://abapcadabra.com/index.php/reporting/the-selection-screen/501-submit-
a-report
58. Report to Report Calling by Select Option - SAP ABAP 4 Tutorial, accessed on
May 29, 2025, http://sapabap-4.blogspot.com/2016/03/report-to-report-calling-
by-select.html
59. SUBMIT - ABAP Keyword Documentation - SAP Help Portal, accessed on May 29,
2025,
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapsubmit_sho
rtref.htm
60. SUBMIT, selscreen_parameters - ABAP Keyword Documentation - SAP Help
Portal, accessed on May 29, 2025,
https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/abapsubmit_
selscreen_parameters.htm#!ABAP_ADDITION_5@5@
61. accessed on January 1, 1970,
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapsubmit_sels
creen_parameters.htm