AT - Events on selection screens syntax for sap abap

Basic form

AT SELECTION-SCREEN.

Additions

1. ... ON psel
2. ... ON END OF sel
3. ... ON VALUE-REQUEST FOR psel_low_high .
4. ... ON HELP-REQUEST FOR psel_low_high
5. ... ON RADIOBUTTON GROUP radi
6. ... ON BLOCK block
7. ... OUTPUT

Effect

This event only makes sense in reports, i.e. in programs set to type 1 in the attributes. Type 1 programs are started via a logical database and always have a selection screen where the user can specify the database selections.
The event is processed when the selection screen has been
processed (at the end of PAI ).
If an error message ( MESSAGE Emnr ) is sent during the event, all fields on the selection screen become ready for input.
After further user input, AT SELECTION-SCREEN is executed again.
You should only perform very expensive checks with AT SELECTION-SCREEN if the program is then started (not every time the user presses ENTER). Here, you can read the system field SSCRFIELDS-UCOMM (provided a statement TABLES SSCRFIELDS exists). If the field has one of the values 'ONLI' (= Execute) or 'PRIN' (= Execute and Print), the report is then started, i.e. the selection screen is closed and the processing continues with START OF SELECTION . Remember that the selection screen (and thus also AT SELECTION-SCREE N ) is also processed in variant maintenance and with SUBMIT VIA JOB . You can determine which of these applies by calling the function module RS_SUBMIT_INFO .

Addition 1

... ON psel

Effect

This event is assigned to the selection screen fields corresponding to the report parameter or selection criterion psel .
If the report starts an error dialog at this point, precisely these fields become ready for input.

Addition 2

... ON END OF sel

Effect

For each selection criterion sel on the selection screen, you can call a further screen by pressing a pushbutton. On this screen, you can enter any number of single values and ranges for the selection criterion sel .
When this screen has been processed (i.e. at the end of PAI for this screen), the event AT SELECTION-SCREEN ON END OF sel is executed.
At this point, all the values entered are available in the internal table sel .

Addition 3

... ON VALUE-REQUEST FOR psel_low_high

Effect

With this addition, the field psel_low_high is either the name of a report parameter or of the form sel-LOW or sel-HIGH , where sel is the name of a selection criterion. The effect of this is twofold:

The pushbutton for F4 (Possible entries) appears beside the appropriate field.

When the user selects this pushbutton or presses F4 for the field, the event is executed. You can thus implement a self-programmed possible entries routine for the input/output fields of the selection screen. If the program contains such an event and the user presses F4 , the system processes this rather than displaying the check table or the fixed values of the Dictionary field - even if the report parameter or the selection option with LIKE or FOR points to a Dictionary field. You can, for example, use the CALL SCREEN statement to display a selection list of possible values. The contents of the field psel_low_high at the end of this processing block are copied to the appropriate input/output field.

This addition is only allowed with report-specific parameters (PARAMETERS ) or selection options ( SELECT OPTIONS ). For database-specific parameters or selection options, you can achieve the same effect by using the addition VALUE-REQUEST FOR ... with the key word PARAMETERS or SELECT-OPTIONS in the include DBxyzSEL (where xyz = name of logical database). In this case, you must program the value help in the database program SAPDBxyz .

Addition 4

... ON HELP-REQUEST FOR psel_low_high

Effect

As with the addition ON VALUE-REQUEST the field psel_low_high is either the name of a report parameter or of the form sel-LOW or sel-HIGH , where sel is the name of a selection criterion. When the user presses F1 on the relevant field, the subsequent processing block is executed. You can thus implement a self-programmed help for the input/output fields of the selection screen. If the program contains such an event and the user presses F1 , the system processes this rather than displaying the documentation of the Dictionary field - even if the report parameter or the selection option with LIKE or FOR points to a Dictionary field.
This addition is only allowed with report-specific parameters (PARAMETERS ) or selection options (SELECT-OPTIONS ). For database-specific parameters or selection options, you can achieve the same effect by using the addition HELP-REQUEST FOR ... with the key word PARAMETERS or SELECT-OPTIONS in the include DBxyzSEL (where xyz = name of logical database). In this case, you must program the help in the database program SAPDBxyz .

Addition 5

... ON RADIOBUTTON GROUP radi

Effect

This event is assigned to the radio button groups on the selection screen defined by PARAMETERS PAR RADIO BUTTON GROUP RADI.
If the report starts an error dialog at this point, precisely these fields of the radio button group radi become ready for input again.

Addition 6

... ON BLOCK block

Effect

This event is assigned to the blocks on the selection screen defined by BEGIN/END OF SELECTION SCREEN.
If the report starts an error dialog at this point, precisely these fields of the block block become ready for input again.

RELATED POST

No comments :

Post a Comment