ABAP Report Events: Selection Screen Events

by | Jan 14, 2019 | ABAP Beginner

Preface – This post is part of the ABAP Beginner series.

In this article, we have discussed a type of ABAP Report Events i.e. Selection Screen Events. To learn all about ABAP Report Events click here.

Introduction

In ABAP Report Events after ABAP Reporting Events of ABAP, we have Selection Screen Events which occur in a predefined manner. These events are called in similar a way of Dynpro sequence (PBO and PAI). These events are processed during selection screen processing.

In simple words, selection screen events are the events that are called after a selection screen block is opened and it is used to manipulate the selection screen block based on user interaction at runtime.

Basic Dynpro Events

Before we discuss Selection screen events, let us learn basic Dynpro events first:

PBO: Process Before Output

This event is triggered before a screen is sent to presentation layer (output screen).

PAI: Process After Input

This event is triggered by a user action on ABAP GUI.

POH: Process On Help Request

This event is triggered when F1 (Field Help) of an input field on the screen is requested.

POV: Process On Value Request

This event is triggered when F4 (Input Help) of an input field on the screen is requested.

Types of Selection Screen Events

Following are the types of Selection Screen Events:

Event

Description

·         AT SELECTION-SCREEN OUTPUT·         It is raised by PBO event. Thus anything that needs to be changed dynamically on screen uses this event.

·         This event is also useful in case we need to initialize something every time the selection screen code of a program is called because INITIALIZATION is loaded only once but AT SELECTION-SCREEN OUTPUT is loaded every time.

·         MODIFY SCREEN can be used to manipulate screens during AT SELECTION-SCREEN OUTPUT event.

·         AT SELECTION-SCREEN ON { Parameter | Selection Criteria }·         It is raised by PAI event. This event is triggered if content of Parameter or Selection Criteria is passed to ABAP program.

·         A selection criterion (selection table) is generated using SELECT-OPTIONS. And for each line of selection table, different calls are made to AT SELECTION-SCREEN ON {Parameter | Selection Criteria} is made.

·         If a warning or an error message is raised, the input parameters of this event blocks become ready for input again.

AT SELECTION-SCREEN ON END OF selcrit·         Unlike above event, call to this event is made with entire selection table.

·         It is mainly used to mark the end of Selection Screen event calls.

AT SELECTION-SCREEN ON BLOCK block·         It is raised by PAI event. This event is triggered when all the inputs of a block is passed to the ABAP program.

·         If a warning or an error message is raised, the input parameters of this event blocks become ready for input again.

AT SELECTION-SCREEN ON RADIOBUTTON GROUP group·         It is raised by PAI event. This event is triggered when all the inputs of a block is passed to the ABAP program.

·         If a warning or an error message is raised, the input parameters of this event blocks become ready for input again.

AT SELECTION-SCREEN·         This is the last event raised in selection screen processing

·         All input values are passed to this event; hence we can perform all types of validations here.

·         If a warning or an error message is raised, the input parameters of this event blocks become ready for input again.

AT SELECTION-SCREEN ON HELP-REQUEST|VALUE-REQUEST FOR {para|selcrit-low|selcrit-high} }·         This event is triggered on F1 or F4 Help request from screen.

·         It is raised by POH and POV event.

AT SELECTION-SCREEN ON EXIT-COMMAND·         This event is triggered if any of the following actions are called on the screen: Back, Exit, or Cancel.

·         Any cleanup activities can be taken care here.

 

Examples

AT SELECTION-SCREEN OUTPUT

In given example, if in Parameter ‘EXIT’ is passed, then the whole screen is hidden.

PARAMETERS: EXIT (10) TYPE c.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN INTO DATA (wa_screen).

IF wa_screen -name = ‘ EXIT ‘.

wa-invisible = ‘1’.

MODIFY screen FROM wa_screen.

ENDIF.

ENDLOOP.

*** Note: We will update examples for other events very soon.

Author

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.