2016 Mar 08 6:43 AM
Hello folks,
I really like the new expressions in ABAP. Especially the "FILTER" Statement. But unfortunatly, it doesn't work everytime. If you start this code here, it will result in an endless loop at the filter statement.
TYPES: BEGIN OF ty_s_itab,
artgrp TYPE char4,
datum_von TYPE dats,
datum_bis TYPE dats,
END OF ty_s_itab,
ty_t_itab TYPE SORTED TABLE OF ty_s_itab
WITH UNIQUE KEY artgrp datum_von datum_bis
.
DATA: lv_datum TYPE dats VALUE '20160304'.
DATA(lt_data) = VALUE ty_t_itab( ( artgrp = 'EC '
datum_von = '20160304'
datum_bis = '20160501 ')
( artgrp = 'EC '
datum_von = '20160101'
datum_bis = '20160301 ')
).
DATA(lt_filter) = FILTER #( lt_data WHERE artgrp = 'EC '
AND datum_von <= lv_datum
AND datum_bis >= lv_datum ).
LOOP AT lt_filter INTO DATA(ls_filter).
WRITE: ls_filter-artgrp, ls_filter-datum_von.
ENDLOOP.
Could someone verify this or, even better, have an explanation for it? I don't understand it...
Kind regards
Bastian Stritt
2016 Mar 08 4:19 PM
I can confirm this, endless loop at the filter statement. I have no explanations but a bug in the filter implementation.
I played around a bit:
- change second condition to "AND datum_von < lv_datum" (removing the 😃 -> code executes
- remove third condition -> code executes
- only remove "=" in third condition -> still broken.
- change lv_datum to a variable with another value for the third condition -> code executes.
No idea what exactly the problem is.
regards,
Thomas
2016 Mar 09 10:47 AM
quite interesting.
Maybe Horst Keller can bring some light into the dark
2016 Mar 09 12:30 PM
In a 7.50 system, the process is hanging.
In a 7.51 system I get the runtime error ABAP_ASSERT.
-> Clearly a bug in the FILTER expression, Forwarded to development.
2016 Mar 11 9:48 AM
Indeed, it is a bug that will be corrected in an upcoming kernel patch.
Thanks for notifying!