Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Obsolete Language Elements →  Obsolete User Dialogs →  Obsolete statements of the screen flow logic 

FIELD - VALUES, SELECT

Other versions: 7.31 | 7.40 | 7.54

Obsolete Syntax

Variants

1. FIELD f VALUES ([[NOT] val1], [[NOT] val2], ...
                  [[NOT] BETWEEN vali AND valj], ...).

2. FIELD f SELECT *
            FROM dbtab
            WHERE col1 = f1 AND col2 = f2 ...
            [INTO wa]
            WHENEVER [NOT] FOUND
               SEND {ERRORMESSAGE|WARNING} [num [WITH p1 ... p4]].

Effect

These variants of the statement FIELD are possible in the results block for PAI of the screen flow logic. They compare the content of screen field f either with entries in a value list or with the results of a database access.

These types of input checks in the dynpro flow logic are executed after the automatic input checks and before the self-programmed input checks in the ABAP program. The specified value list or the resulting set of the database accesses overrule the automatic input help of the ABAP Dictionary. They are themselves overruled by the events POH and POV. The additions VALUES and SELECT have no influence on the effect of the FIELDS statement on the data transport from the screen to the ABAP program.


Note

These variants are supported only for reasons of compatibility. You should replace them by checks within the ABAP program.

Variant 1

FIELD f VALUES ([[NOT] val1], [[NOT] val2], ...
                [[NOT] BETWEEN vali AND valj], ...).

Effect

A value list is specified by entries after the addition VALUES, which must be in parentheses and separated by commas.

The content of screen field f can be compared with single values val1,val2 ... and with value ranges [vali,valj]. You can negate the result of each of the comparisons using the NOT operator. The comparison fields val must be included in inverted commas and specified in uppercase. The content must be part of the value ranges of the data types CHAR or NUMC of the ABAP Dictionary.

If a comparison is not true, an error message appears in the status bar of the current window and the corresponding input field is input-enabled again.


Example

Check the input field for an airline carrier.

PROCESS AFTER INPUT. 
  FIELD carrier 
        VALUES ('AA', NOT 'BA', BETWEEN 'QF' AND 'UA'). 

Variant 2

FIELD f SELECT *
          FROM dbtab

          WHERE col1 = f1 AND col2 = f2 ...
          [INTO wa]
         WHENEVER [NOT] FOUND
            SEND {ERRORMESSAGE|WARNING} [num [WITH p1 ... p4]].

Effect

During execution of the FIELD statement, the addition SELECT looks for a row of database table dbtab, whose primary key fields col1 col2 ... match the contents of the screen fields f1 f2 .... The database table dbtab must be defined in the ABAP Dictionary. In the WHERE condition, all primary key fields of the database table that are specified in AND comparisons must be specified with an equal sign (=).

Depending on whether the addition NOT is specified or not, an error or warning message is sent if no or one entry was found in the database table. In both cases, the input field for screen field f is again input-enabled. The message class of the message to be sent must be two characters long and is taken from the first two places of the value specified after the addition MESSAGE-ID of the program-introducing statement of the respective ABAP program. If no message class is specified there, a standard message is sent. The message number can be specified as number literal num. If the message contains placeholders, they can be filled with up to four values p1 to p4 as in the MESSAGE statement with WITH addition: The placeholders can be specified either as text literals or as screen fields.

If a row is found, its content can be assigned to a table work area wa whose structure must match the row type of dbtab. Such a table area is declared in the dynpro by copying screen fields from the ABAP Dictionary.


Note

Without the addition INTO, you can compare the addition SELECT to a subquery in Open SQL. When you specify addition INTO, you can also use the above SELECT syntax as a stand-alone statement in the dynpro flow logic, that is, without the FIELD statement. However, using a SELECT dynpro statement, is obsolete. Replace it by the respective Open-SQL statement in the ABAP program.


Example

Check whether for the screen fields carrier and connect a row with identical primary key exists in the database table spfli. The corresponding ABAP program must contain an appropriate MESSAGE-ID addition in the program-introducing statement.

PROCESS AFTER INPUT. 
  FIELD connect 
    SELECT * 
           FROM spfli 
           WHERE carrid = carrier AND connid = connect 
           WHENEVER NOT FOUND SEND ERRORMESSAGE 107 
             WITH carrier connect.