ClassBook-Lessons-ABAP Part I Lesson4
ClassBook-Lessons-ABAP Part I Lesson4
The following code is the syntax for defining a variable using the
parameters statement.
parameters p1[ (l) ] [type t] [decimals d]
Or
parameters p1 like v1
[default ‘xxx’] [obligatory] [lower case] [as check box]
[radiobutton group g]
AGE(2) TYPE P.
You assign the initial value of a parameter using the parameter DEFAULT.
The parameters statement can not be used for type f .
Addition Use
obligatory The user must enter a value into the field before the
program will execute
lower case Prevents values from being translated to uppercase
Radio button group g Displays the input field as a radio button belonging to group
g
The SELECTION-SCREEN statement has its own formatting options that you
can use to define the layout for selection screens.
You can define the layout of parameters and selection criteria and display
comments and underlines on the selection screen.
In addition, you can place pushbuttons in the application toolbar and on the
screen itself
User-defined selection screens
▪ Defined Using :
SELECTION-SCREEN BEGIN OF SCREEN numb [TITLE tit] [AS WINDOW].
...
SELECTION-SCREEN END OF SCREEN numb
▪ AS WINDOW
• User-defined selection screen is called as a modal dialog box
Formatting Selection Screen
A standard layout is defined for the selection screen when defined using the
PARAMETERS or SELECT-OPTIONS statements
Changing Standard layout
▪ use SELECTION-SCREEN statement
• Has its own formatting options
Blank Lines, Underlines, and Comments
Blank Lines
▪ To place blank lines on the Selection screen, use
SELECTION-SCREEN SKIP [n]
Underlines
▪ To place underlines on the Selection screen, use
SELECTION-SCREEN ULINE [[/]pos(len)] [MODIF ID key]
Comments
▪ To place comments on the Selection screen, use
SELECTION-SCREEN COMMENT [/]pos(len) comm [FOR FIELD f]
[MODIF ID key]
Example
Comments in
Selection Screen
Several Elements in a Single Line
– Example
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(10) text-001.
PARAMETERS: p1(3) TYPE c, p2(5) TYPE c, p3(1) TYPE c.
SELECTION-SCREEN END OF LINE.
Parameters :P1, P2
and P3 in single line
Blocks of Elements
Radio buttons in a
block
Calling User-Defined Selection Screens
AT SELECTION-SCREEN event is
▪ the basics of Selection Screen events
▪ Occurs after all the input data is passed to the underlying ABAP program from
selection screen
Overview of Selection Screen Events
On passing the input data from Selection Screen to ABAP Program by the
runtime environment, AT SELECTION-SCREEN event is triggered
To modify the Selection Screen elements before display, AT SELECTION-
SCREEN OUTPUT event is used
Demo