SAP FILTER TABLE CONDITION ABEXA



Get Example source ABAP code based on a different SAP table
  



FILTER, Filterings with Table Filter
This example demonstrates various types of table filtering using a filter table.

ABAP_SOURCE_CODE
DEMO CL_DEMO_FILTER_TABLE_CONDITION

ABAP_DESCRIPTION
A table itab contains five random numbers between 1 and 7, a table ftab contains five random numbers between 3 and 10. Different types of table filters for itab are performed using the table ftab as a filter table:
The first filtering creates a table of all lines from itab for which there is at least one line with the same value in ftab.
The second filtering creates a table of all lines from itab for which there is no line with the same value in ftab.
The third filtering creates a table of all lines from itab for which there is at least one line with a lesser value in ftab.
The fourth filtering creates a table of all lines from itab for which there is at least one line with a non-equal value in ftab.
The fifth filtering creates a table of all lines from itab for which there is at least one line with a greater or lesser value in ftab.
When merged, the results from the first and second filtering are all lines from itab. The first filtering creates the union and the second filtering the difference of the two tables itab and ftab.
The fourth filtering does not produce the same result as the second filtering. The fifth filtering does not produce the lines from itab that remain after the third filtering.