27
Introduction to ABAP Selection Screens

Introduction to ABAP Selection Screens. Slide 2 Screens (Types) There are three types of screens Selection screens get parameter input for reports List

Embed Size (px)

Citation preview

Page 1: Introduction to ABAP Selection Screens. Slide 2 Screens (Types) There are three types of screens Selection screens get parameter input for reports List

Introduction to ABAP Selection Screens

Page 2: Introduction to ABAP Selection Screens. Slide 2 Screens (Types) There are three types of screens Selection screens get parameter input for reports List

Slide 2

Screens (Types) There are three types of screens

Selection screens get parameter input for reports

List outputs, which appear at the end of a report

Classic ABAP Dynpros are the transaction codes with which you are familiar

All of these are components of programs We will talk about selection screens here

Page 3: Introduction to ABAP Selection Screens. Slide 2 Screens (Types) There are three types of screens Selection screens get parameter input for reports List

Slide 3

Selection Screens (Introduction) They can be housed in various types of

programs Executable programs, function groups,

and module pools Selection screens are triggered by

events Unlike VB, the order of selection screen

events is predefined by ABAP The order that they (event procedures)

appear in the program does not matter

Page 4: Introduction to ABAP Selection Screens. Slide 2 Screens (Types) There are three types of screens Selection screens get parameter input for reports List

Slide 4

ABAP Events (1) LOAD-OF-PROGRAM fires immediately

after the program loads It’s typically used to initialize global data In OOP terms, this is really a constructor

Page 5: Introduction to ABAP Selection Screens. Slide 2 Screens (Types) There are three types of screens Selection screens get parameter input for reports List

Slide 5

ABAP Events (2) INITIALIZATION fires after LOAD-OF-

PROGRAM but BEFORE selection screen processing Use this event to initialize input fields for

the selection screen

Page 6: Introduction to ABAP Selection Screens. Slide 2 Screens (Types) There are three types of screens Selection screens get parameter input for reports List

Slide 6

ABAP Events (3) AT SELECTION-SCREEN fires after the

user sees and fills out the selection screen Perform error checking here

START-OF-SELECTION fires and control passes back to the ABAP process This event is implicit if no events are listed So your previous programs have belonged

to START-OF-SELECTION

Page 7: Introduction to ABAP Selection Screens. Slide 2 Screens (Types) There are three types of screens Selection screens get parameter input for reports List

Slide 7

Creating Selection Screen Parameters Instead of using the DATA statement use

the PARAMETERS statement The syntax is the same as the DATA

statement but parameter names (variables) are limited to 8 characters in length

Each parameter is displayed on the selection screen in the order it is listed

Parameter types can be ABAP dictionary types too

Page 8: Introduction to ABAP Selection Screens. Slide 2 Screens (Types) There are three types of screens Selection screens get parameter input for reports List

Slide 8

PARAMETERS (First Example)

Page 9: Introduction to ABAP Selection Screens. Slide 2 Screens (Types) There are three types of screens Selection screens get parameter input for reports List

Slide 9

PARAMETERS (Customizing) Add a default value using the DEFAULT

keywordPARAMETERS INPUT TYPE i DEFAULT 10 Mark a field as required using the OBILGATORY keyword

Use VALUE CHECK to verify that the values are in the valid list for the data type

Page 10: Introduction to ABAP Selection Screens. Slide 2 Screens (Types) There are three types of screens Selection screens get parameter input for reports List

Slide 10

PARAMETERS (CHECKBOX) To complete boolean parameters, use

the CHECKBOX type

Page 11: Introduction to ABAP Selection Screens. Slide 2 Screens (Types) There are three types of screens Selection screens get parameter input for reports List

Slide 11

PARAMETERS (RADIO BUTTON) The PARAMETER type is RADIOBUTTON Make sure that each button belongs to

the same group

Page 12: Introduction to ABAP Selection Screens. Slide 2 Screens (Types) There are three types of screens Selection screens get parameter input for reports List

Slide 12

PARAMETERS (Selection Ranges) You have seen selection ranges in many

screens

Page 13: Introduction to ABAP Selection Screens. Slide 2 Screens (Types) There are three types of screens Selection screens get parameter input for reports List

Slide 13

PARAMETERS (Selection Ranges) Create an internal SELECTION table as

follows:

Page 14: Introduction to ABAP Selection Screens. Slide 2 Screens (Types) There are three types of screens Selection screens get parameter input for reports List

Slide 14

PARAMETERS (Selection Ranges) (Screen Options) OBILIGAOTRY make the option required VISIBLE LENGTH defines the number of

visible characters NO-EXTENSION prohibits multiple

selection

Page 15: Introduction to ABAP Selection Screens. Slide 2 Screens (Types) There are three types of screens Selection screens get parameter input for reports List

Slide 15

PARAMETERS (Selection Ranges) (Value Options)

Requires value to be between val1 and val2

SIGN contains the logical operand

Page 16: Introduction to ABAP Selection Screens. Slide 2 Screens (Types) There are three types of screens Selection screens get parameter input for reports List

Slide 16

Selection Texts (1) Selection texts are more than just

textual prompts They provide a language independent

way of displaying text Note that the program must be

activated for this to all work correctly

Page 17: Introduction to ABAP Selection Screens. Slide 2 Screens (Types) There are three types of screens Selection screens get parameter input for reports List

Slide 17

Selection Texts (2) There are three types of text elements

List Headings are used to build list headers

Selection Texts appear in selection screens in place of parameter names and selection tables

Text Symbols replace hard-coded literal values

Page 18: Introduction to ABAP Selection Screens. Slide 2 Screens (Types) There are three types of screens Selection screens get parameter input for reports List

Slide 18

Selection Texts (Illustration)

Page 19: Introduction to ABAP Selection Screens. Slide 2 Screens (Types) There are three types of screens Selection screens get parameter input for reports List

Slide 19

Selection Texts (Text Symbols) Here you can avoid using literal values

and replace them with text symbols As usual, there is a bit of SAP magic

here Symbols are numbered 001, 002, 003,…

Page 20: Introduction to ABAP Selection Screens. Slide 2 Screens (Types) There are three types of screens Selection screens get parameter input for reports List

Slide 20

Selection Texts (Text Symbols) The selection text variable is named

text-xxx where xxx is the number of the selection text

Page 21: Introduction to ABAP Selection Screens. Slide 2 Screens (Types) There are three types of screens Selection screens get parameter input for reports List

Slide 21

Messages Unlike text elements, messages are not

part of the report Instead, they are stored in a system

table T100 is the table name

Message can be between 1 and 72 characters

Messages must be activated too Use transaction code SE91 to create

Page 22: Introduction to ABAP Selection Screens. Slide 2 Screens (Types) There are three types of screens Selection screens get parameter input for reports List

Slide 22

Table T100

Page 23: Introduction to ABAP Selection Screens. Slide 2 Screens (Types) There are three types of screens Selection screens get parameter input for reports List

Slide 23

Table T100 (Data)

Page 24: Introduction to ABAP Selection Screens. Slide 2 Screens (Types) There are three types of screens Selection screens get parameter input for reports List

Slide 24

Message (Creating) First, create the Message class

Naming rules (Z) apply

Page 25: Introduction to ABAP Selection Screens. Slide 2 Screens (Types) There are three types of screens Selection screens get parameter input for reports List

Slide 25

Message (Creating) Then create the messages

Page 26: Introduction to ABAP Selection Screens. Slide 2 Screens (Types) There are three types of screens Selection screens get parameter input for reports List

Slide 26

Displaying the Message Call the MESSAGE function

First character is e Followed by the message number Followed by the class you created

Page 27: Introduction to ABAP Selection Screens. Slide 2 Screens (Types) There are three types of screens Selection screens get parameter input for reports List

Slide 27

Selection Screen Layout You have limited layout capabilities for

selection screens You can position line elements You cannot do much with fonts and

typefaces