Skip to Content

Question about filter table (ABAP 740 features)

    DATA(my_airlines) = FILTER ty_airlines(
                        VALUE ty_airlines(
                          FOR GROUPS carrid OF flight IN flights
                              GROUP BY flight-carrid
                                ( carrid = carrid
                                  carrnm = get_carrid_name( carrid ) )
                                )
                             IN VALUE ty_carrid_t(
                                       ( |AA| )
                                       ( |AZ| ) )
                             WHERE carrid = table_line ).

It's about the new ABAP 740 features...

Does anyone know if its' possible to have the filter table defined inline?

The above code does not work because "For operator "VALUE" the type cannot be derived from context.

Only the following works:

DATA ty_carrid_t TYPE SORTED TABLE OF s_carr_id WITH UNIQUE DEFAULT KEY.
[...]
IN VALUE ty_carrid_t(
          ( |AA| )
          ( |AZ| ) )
WHERE carrid = table_line ).
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Mar 03, 2017 at 01:15 PM

    Hi Enno,

    I don't understand your question.

    Your first example works:

    TYPES ty_airlines TYPE TABLE OF scarr WITH EMPTY KEY.
    TYPES ty_carrid_t TYPE SORTED TABLE OF s_carr_id WITH UNIQUE DEFAULT KEY.
    DATA flights TYPE TABLE OF spfli.
    
    DATA(my_airlines) = FILTER ty_airlines(
                            VALUE ty_airlines(
                              FOR GROUPS carrid OF flight IN flights
                                  GROUP BY flight-carrid
                                    ( carrid = carrid
                                      carrname = 'get_carrid_name( carrid )' )
                                    )
                                 IN VALUE ty_carrid_t(
                                           ( |AA| )
                                           ( |AZ| ) )
                                 WHERE carrid = table_line ).
    
    Add comment
    10|10000 characters needed characters exceeded