Ansicht
Dokumentation
ABENCONSTRUCTOR_EXPR_FILTER_BASIC - CONSTRUCTOR EXPR FILTER BASIC
Fill RESBD Structure from EBP Component Structure BAL_S_LOG - Application Log: Log header dataThis documentation is copyright by SAP AG.
FILTER, Basic Form
... FILTER type( itab $[EXCEPT$] $[USING KEY keyname$]
WHERE c1 op f1 $[AND c2 op f2 $[...$]$] ) ...
Additions
1. ... USING KEY keyname
2. ... WHERE c1 op v1 $[AND c2 op v2 $[...$]$]
Effect
This variant of the filter operator FILTER filters itab using single values. The columns of a table key of itab are compared with single values in the WHERE condition. Those lines of itab are used that meet the WHERE condition or do not meet it when EXCEPT is specified.
Here, the internal table itab must have at least one sorted key or one hash key used for access. This can be
- either the primary table key used without specifying USING KEY or by specifying its name primary_key after USING KEY,
- or a secondary table key used by specifying its name after USING KEY.
This variant of the filter operator is not possible for an internal table itab without a sorted key or hash key.
Example
Filtering of the messages of a work area from the database table T100 by language.
Addition 1
... USING KEY keyname
Effect
Specifies the table key keyname with which
the WHERE condition is evaluated. A sorted key or a hash key of the table itab can be
specified. If the primary key of itab is not a sorted key or hash key, itab must have a secondary key of this type and it must be specified using USING KEY.
Example
Like the preceding example, but here a secondary table key must be specified explicitly since the internal table messages is a standard table without a primary key.
Addition 2
... WHERE c1 op f1 $[AND c2 op f2 $[...$]$]
Effect
A condition for the table key used in the FILTER expression must be specified after WHERE:
- In the case of a hash key, exactly one comparison expression c op f for each key component. The only comparison operator allowed for op is =.
- In the case of a sorted key, an initial part of the key must be covered by comparison expressions c op f. op can be any binary comparison operator.
Multiple comparisons can be combined using AND only. There can be no further comparisons apart from those mentioned for key components. In the basic form, key components of the internal table itab must be specified for the left operands c1, c2, ... On the right side, data objects f1, f2, ... must be specified that are compatible with the left side. f1, f2, ... are general expression positions.
Notes
- The obsolete comparison operators cannot be used in the WHERE condition.
Table Filtering, Single Values
CL_GUI_FRONTEND_SERVICES - Frontend Services CL_GUI_FRONTEND_SERVICES - Frontend Services
This documentation is copyright by SAP AG.
Length: 5286 Date: 20240418 Time: 052202 sap01-206 ( 74 ms )