0% found this document useful (0 votes)
59 views10 pages

Print7 PDF

The document discusses how to design selection screens in ABAP using the SELECT-OPTIONS and PARAMETERS statements. SELECT-OPTIONS allows you to define selection criteria that can include ranges, relational operators, and value sets. PARAMETERS is used to declare additional fields on the selection screen that only allow single values. Text elements can be added to provide labels for the selection criteria and parameters on the screen.

Uploaded by

Dr. Amresh Nikam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views10 pages

Print7 PDF

The document discusses how to design selection screens in ABAP using the SELECT-OPTIONS and PARAMETERS statements. SELECT-OPTIONS allows you to define selection criteria that can include ranges, relational operators, and value sets. PARAMETERS is used to declare additional fields on the selection screen that only allow single values. Text elements can be added to provide labels for the selection criteria and parameters on the screen.

Uploaded by

Dr. Amresh Nikam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Chapter 07 Selection Screen

Selection screen
Selection criteria
Parameters

SAP AG
Chapter 07 Objectives

Options for designing the selection screen with


the key words 'SELECT-OPTIONS' and
'PARAMETERS'

SAP AG
Generating the Selection Screen

Airline carrier DL bis LH ...

Departure city SAN FRANCISCO

DEMO/CHAP 07.A: Selection sreen 1


Car. ID From To Depart Arrive
DL 1984 SAN FRANCISCO NEW YORK 10:00:00 18:25:00
LH 0455 SAN FRANCISCO FRANKFURT 15:00:00 10:30:00

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

SIGN OPTION LOW HIGH

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,

EQ EQual NE Not Equal,


LE Less than or Equal LT Less Than,
GE Greater than or Equal GT Greater Than,
BT BeTween NB Not Between (only for ranges),
CP Contains Pattern NP No Pattern (only for templates such as LIKE).
The selection set S comprises all includes (I1,..., In) without the excludes (E1, ..., Em). If the table is
empty, the selection is made from the whole set.
Other Relational Operators

Selection
Selection options
options

Single value

Greater than or equal

Less than or equal

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
...

Single value selections


AA
+
+

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

Airline carrier ...


to

REPORT RSDEMO00.
TABLES SPFLI.
SELECT-OPTIONS:
SCARR FOR SPFLI-CARRID. Textelem
Textelemente
ente
.
.
.
Program nam e RSDEMO00 Language D

Nam e Text

SCARR Airline carrier

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

To design the selection screen, you can use the


'SELECT-OPTIONS' and 'PARAM ETERS' statem ents.
'SELECT-OPTIONS' allows you to specify ranges as well as
other options, while 'PARAMETERS' is intended for single
elem ents.

SAP AG BC400 / 7 - 1

You might also like