Selection Screen Creation and use ABAP
Objective
- Concepts associated with
- The creation and use of selection screens in ABAP reports
- The SELECT-OPTIONS statement
- Selection tables
- Formatting the selection screen
- Selection texts, lines, comments, frames,
- The PARAMETERS statement
- Radio button groups, check boxes
- Executing reports with variants
Selection Screens
- Used to allow the user to control the database selections of the report
- Allows interactive
- Assignment of values to variables
- With the PARAMETERS statement
- Determine selection criteria for database fields
- Single values, range of values, sets of values, ...
- With the SELECT-OPTIONS statement
Defining Selection Screen
There are 3 ABAP statements for defining selection screens:
- PARAMETERS for single fields
- SELECT-OPTIONS for complex selections
- SELECTION-SCREEN for formatting the selection screen and defining user-specific selection screens
Parameters
- Used to enable user to enter values for single fields on the selection screen
- Define variables in the program using PARAMETERS statement.
- Basic form of PARAMETERS statement:
- PARAMETERS <p>[(<length>)] [TYPE <type>|like <obj>] [DECIMALS <d>].
Parameters Variants
- PARAMETERS <p> ...... DEFAULT <f> ......
- PARAMETERS <p> ...... OBLIGATORY ......
- PARAMETERS <p> ...... LOWER CASE ......
- PARAMETERS <p> ...... AS CHECKBOX ......
- PARAMETERS <p> ...... RADIOBUTTON GROUP <radi>......
Parameters Keyword
PARAMETERS <field> TYPE <type> [DEFAULT <value>].
Select-Options
- Allow the user to easily handle complex selections
- Basic form of the SELECT-OPTIONS statement :
- SELECT-OPTIONS <seltab> for <f>.
- <F> is a column of a database table or an internal field in the program.
- Internally defines an internal table of standard table type with header line known as a selection table
Select-options Contd..
Structure of selection tables
SIGN – type C length 1
Values ‘I’ or ‘E’
OPTION – type c length 2
Values ‘EQ’, ‘NE’, ‘LT’, ‘BT’, etc.
LOW – data type same as of <f>
HIGH – data type same as of <f>
Select-Options Variants
- SELECT-OPTIONS <seltab> FOR <f> DEFAULT <g> [TO <h>]
- SELECT-OPTIONS <seltab> FOR <f> ... LOWERCASE
- SELECT-OPTIONS <selcrit> FOR <f> ... OBLIGATORY
- SELECT-OPTIONS <seltab> FOR <f> ..... NO-EXTENSION
- SELECT-OPTIONS <seltab> FOR <f> ..... NO INTERVALS
Selection-Screen
- SELECTION-SCREEN SKIP [<n>].
- SELECTION-SCREEN ULINE [[/]<pos(len)>]
- SELECTION-SCREEN COMMENT [/]<pos(len)> <comm> [FOR FIELD <f>]
Selection-screen – Elements on a Single Line
Several Elements in a Single line
SELECTION-SCREEN BEGIN OF LINE.
...
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN POSITION <pos>.
Example:
- SELECTION-SCREEN BEGIN OF LINE.
- SELECTION-SCREEN COMMENT 1(10) TEXT-001. PARAMETERS: P1(3), P2(5), P3(1).
- SELECTION-SCREEN END OF LINE.
Selection-Screen – Blocks of Elements
Create logical block of elements on selection screen
SELECTION-SCREEN BEGIN OF BLOCK <block>
[WITH FRAME [TITLE <title>]]
[NO INTERVALS].
...
Selection-screen end of block <block>.
Example
Selection-screen begin of block rad1 with frame title text-002.
- Parameters r1 RADIOBUTTON group gr1.
- Parameters r2 RADIOBUTTON group gr1.
- Parameters r3 RADIOBUTTON group gr1.
Selection-screen end of block rad1
Calling Selection Screen
Standard selection screen
- Called automatically between the INITIALIZATION and START-OF- SELECTION events.
User-defined selection screen
- CALL SELECTION-SCREEN <numb> [STARTING AT <x1> <y 1>] [ENDING AT <x2> <y 2>].