Ansicht
Dokumentation

ABENCONSTRUCTOR_EXPRESSION_FILTER - CONSTRUCTOR EXPRESSION FILTER

ABENCONSTRUCTOR_EXPRESSION_FILTER - CONSTRUCTOR EXPRESSION FILTER

Vendor Master (General Section)   PERFORM Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book

FILTER, Filter Operator

Basic form

1. ... FILTER type( itab $[EXCEPT$] $[USING KEY keyname$]
                        WHERE c1 op f1 $[AND c2 op f2 $[...$]$] ) ...


Filter table

2. ... FILTER type( itab $[EXCEPT$] IN ftab $[USING KEY keyname$]
                        WHERE c1 op f1 $[AND c2 op f2 $[...$]$] ) ...


Addition:

... EXCEPT

Effect

A constructor expression with the component operator FILTER creates a result of a table type specified using type. The lines are taken from an existing internal table itab in accordance with the condition after WHERE, converted to the line type of type, and inserted into the target table in accordance with the rules of INSERT ... INTO TABLE. The order in which the lines are taken from itab depends on its table category and the addition USING KEY and is the same as for LOOP AT itab

  • In the basic form, the condition is created with single values.
  • When using a filter table, the condition is created with values from the filter table ftab.

The following can be specified for type:

  • The # character as a symbol for the operand type. If the data type required in an operand position is not unique and not known completely, the type of itab is used if known.

itab is a functional operand position. The line type of itab must be convertible to the line type of the target type type. USING KEY can or must be used to specify a table key for evaluating itab or ftab, depending on the variant.

Notes

  • A table filter constructs the result line by line. If the result contains almost all lines in the source table, this method can be slower than copying the source table and deleting the surplus lines from the target table.

Addition

... EXCEPT

Effect

If EXCEPT is not specified, those lines from itab are used that meet the WHERE condition. If EXCEPT is specified, those lines from itab are used that do not meet the WHERE condition.

Note

The addition EXCEPT is not the same as a negation of the WHERE condition, particularly in the variant with a filter table.

Example

Use of the addition EXCEPT in the basic form of the FILTER operator.






General Data in Customer Master   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.

Length: 5343 Date: 20240329 Time: 133453     sap01-206 ( 75 ms )