abap 750 ffilter eample code example
Example: abap 750 filter example
DATA: lt_flights_all TYPE STANDARD TABLE OF spfli
WITH NON-UNIQUE SORTED KEY carrid
COMPONENTS carrid,
lt_flight_final TYPE STANDARD TABLE OF spfli.
SELECT * FROM spfli
INTO TABLE @lt_flights_all.
DATA filter_tab TYPE SORTED TABLE OF scarr-carrid
WITH UNIQUE KEY table_line.
filter_tab = VALUE #( ( 'AA ' ) ( 'LH ' ) ).
lt_flight_final = FILTER #( lt_flights_all IN filter_tab
WHERE carrid = table_line ).
cl_demo_output=>write_data( lt_flights_all ).
cl_demo_output=>write_data( lt_flight_final ).
cl_demo_output=>display( ).