When database tables are read using logical databases, you can use a special variant of the CHECK statement in the event blocks for GET events.
The statement checks if the contents of the interface work area that has been filled by the logical database for the current GET event, meets the conditions in all selection tables that are linked to the database table read.
This variant of the CHECK statement only works in conjunction with selection criteria that are linked to database tables, and should only be used for GET events.
Since the CHECK statement cannot be used until after a row has been read by the logical database, you should use this variant only if the selections provided by the logical database are not sufficient to meet your requirements, and the relevant table is not designated for dynamic selections.
The following program is linked to logical database F1S.
SELECT-OPTIONS: max FOR
occ FOR sflight-seatsocc.
WRITE: / spfli-carrid, spfli-connid.
WRITE: sflight-seatsmax, sflight-seatsocc.
After the program has been started, the selection screen appears, which the user might fill in as follows:
The list output appears as follows:
The system reads all rows from SFLIGHT that meet the selection criteria of the logical database. If these contents do not meet the selection criteria max and occ defined in the program, the system leaves the GET event before writing the contents of seatsmax and seatsocc onto the screen.