‎2017 Mar 03 12:55 PM
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 ).
‎2017 Mar 03 1: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 ).
‎2017 Mar 07 3:23 PM
Sorry Horst, I forgot to remove the important part... :]
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 #( (|AA|) (|AZ|) ) WHERE carrid =table_line ).I was trying this:
IN VALUE #( (|AA|) (|AZ|) )and had no idea why this is not working...
‎2017 Mar 07 4:11 PM
Hi Enno,
How should it work?
# stands for a given operand type, the compiler must be capable to infer from the operand position.
What's the given type you would expect here?
Horst