Print7 PDF
Print7 PDF
Selection screen
Selection criteria
Parameters
SAP AG
Chapter 07 Objectives
SAP AG
Generating the Selection Screen
SAP AG
You can generate a selection screen for a report where the user can enter selections. The resulting
output list contains only data which corresponds to the selected values.
SELECT-OPTIONS
SELECT-OPTIONS <selection nam e> FOR <field>
REPORT RSDEMO00.
TABLES SPFLI.
SELECT-OPTIONS SCARR FOR SPFLI-CARRID
DEFAULT 'DL' TO 'LH'.
SCARR
internal SIGN OPTION LOW HIGH
table I BT DL LH
...
SCARR to
SAP AG
You define selection criteria with the SELECT-OPTIONS statement. For each selection criterion, the
selection screen displays a line which starts with a text (by default the name of the selection criterion)
and ends with the possible entries for the particular selection at the end.
The name of the selection criterion can consist of no more than eight characters.
After the FOR parameter, you must specify the field whose contents you want to check against the
input.
For each selection, ABAP/4 creates an internal table with a standard structure. This table is filled
with the entries on the selection screen.
You can use the SELECT statement to read from a database table all the records which correspond to
the selections defined by the internal table (see Chapter 8).
Table Structure
I EQ ____
E NE ____
LT ____
GT ____
LE ____
GE ____
BT ____ ____
NB ____ ____
CP ____
NP ____
SAP AG
The internal table always consists of four fields with the fixed names SIGN, OPTION, LOW and
HIGH. Each line of this table formulates a condition with a comparison operator.
These operators have the following meaning:
I Include E Exclude,
Selection
Selection options
options
Single value
Not equal
Less than
Greater than . . .
SAP AG
On the selection screen itself, you can only enter a single value or a range.
By double-clicking on the input field or by pressing the Selection options pushbutton, you go into a
dialog box where you can specify other relational operators. The options available here depend on the
values you have entered in the From and To fields.
By double-clicking on an empty selection options line, you can select by initial value. To delete this,
press the appropriate pushbutton.
Value Sets
...
Ranges
+ DL to LH
+ to ABAP/4
SA SR
SCARR
SIGN OPTION LOW H IGH
I BT DL LH
I BT SA SR
I EQ AA
SAP AG
Unless otherwise defined, each selection criterion has a pushbutton which allows the user to enter a
number of single values and ranges. The values are stored in the assigned internal table.
Selection Texts
REPORT RSDEMO00.
TABLES SPFLI.
SELECT-OPTIONS:
SCARR FOR SPFLI-CARRID. Textelem
Textelemente
ente
.
.
.
Program nam e RSDEMO00 Language D
Nam e Text
SAP AG
By default, the name of the selection criterion is displayed on the selection screen as the text.
You should store a text line for each selection criterion by choosing Text elements in the ABAP/4
Editor and then Selection texts. You can maintain these texts in several languages. They then appear
in the current logon language instead of the name of the selection criterion.
Declaring Fields with PARAMETERS
PARAMETERS <field>.
REPORT RSDEMO00.
TABLES SPFLI.
SELECT-OPTIONS SCARR FOR SPFLI-CARRID.
PARAMETERS:
CITY_FR LIKE SPFLI-CITYFROM.
...
Airline carrier to
Departure city
SAP AG
You can include parameters on the selection screen as well as selection options. Unlike selection
options, you can only specify single values with parameters, but not ranges.
You should store a text line for each field created with PARAMETERS by choosing Text elements in
the ABAP/4 Editor and then Selection texts.
Chapter 07 Summ ary
SAP AG BC400 / 7 - 1