Default Values for Selection Criteria 

To assign default values to a selection criterion, you use the following syntax:

SELECT-OPTIONS <seltab> FOR <f> DEFAULT <g> [TO <h>] ....

Default values <g> and <h> can be literals or field names. You can only use fields that contain a value when the program is started. These fields include several predefined data objects.

For each SELECT-OPTIONS statement, you can specify only one DEFAULT addition. This means that you can fill only the first row of selection table <seltab> with default values. To fill more rows with default values, the selection table must be processed before the selection screen is called, for example, during the AT SELECTION-SCREEN -OUTPUT event.

You use the DEFAULT addition as follows to address the individual components of the first row:

........DEFAULT <g>.

........DEFAULT <g> TO <h>.

........DEFAULT <g> [to <h>] OPTION <op>.

For single field comparisons, <op> can be EQ, NE, GE, GT, LE, LT, CP, or NP. The default value is EQ. For range selections, <op> can be BT or NB. The default value is BT.

........DEFAULT <g> [to <h>] [OPTION <op>] SIGN <s>.

The value of <s> can be I or E. The default value is I.

The input fields of the selection criterion are filled with the default values. The user can accept or change these values.

REPORT DEMO.

DATA WA_SPFLI TYPE SPFLI.

SELECT-OPTIONS AIRLINE FOR WA_SPFLI-CARRID
               DEFAULT 'AA'
                    TO 'LH'
                OPTION  NB
                  SIGN  I.

The following standard selection screen appears:

The symbol before the first field FROM shows that the AIRLINE-OPTION field contains operator NB. This symbol is green to show that the AIRLINE-SIGN field contains value I. The arrow on the right pushbutton is not green since only one row of the selection table is filled.