2017 Mar 21 12:39 PM
Hi,
we expected that the following code always results with a table size of 1. But the filter for "my_tab_f2" returns an empty table.
Something i am missing here? Or is this some kind of bug?
TYPES:
BEGIN OF ty_my_struct,
k1 TYPE char1,
k2 TYPE char1,
f1 TYPE char1,
END OF ty_my_struct,
ty_my_tab1 TYPE STANDARD TABLE OF ty_my_struct WITH DEFAULT KEY
WITH NON-UNIQUE SORTED KEY k1 COMPONENTS k1 k2 f1
WITH NON-UNIQUE SORTED KEY k2 COMPONENTS table_line.
DATA(my_tab1) = VALUE ty_my_tab1(
( k1 = 'a' k2 = 'a' f1 = 'a' )
( k1 = 'b' k2 = 'b' f1 = 'b' )
).
DATA(my_tab2) = VALUE ty_my_tab1(
( k1 = 'a' k2 = 'a' f1 = 'a' )
).
DATA(my_tab_f1) = FILTER #(
my_tab1 IN my_tab2 USING KEY k1
WHERE k1 = k1 AND k2 = k2 AND f1 = f1 ).
DATA(my_tab_f2) = FILTER #(
my_tab1 IN my_tab2 USING KEY k2
WHERE k1 = k1 AND k2 = k2 AND f1 = f1 ).
DATA(my_tab_f3) = FILTER #(
my_tab1 IN my_tab2 USING KEY k2
WHERE table_line = table_line ).
WRITE: / lines( my_tab_f1 ). " Result: 1
WRITE: / lines( my_tab_f2 ). " Result: 0
WRITE: / lines( my_tab_f3 ). " Result: 1
2017 Mar 21 12:56 PM
Lo and behold!
I even get an
ABAP_ASSERT
Internal error: Unexpected state in ABAP runtime environment
for that expression in my 7.52 development system.
That promptly goes to DEV ...
Thanks for the quick check!
Do you assume that other statements or combinations with "table_line" are affected?
2017 Mar 21 12:56 PM
Lo and behold!
I even get an
ABAP_ASSERT
Internal error: Unexpected state in ABAP runtime environment
for that expression in my 7.52 development system.
That promptly goes to DEV ...
2017 Mar 21 1:02 PM
Thanks for the quick check!
Do you assume that other statements or combinations with "table_line" are affected?
2017 Mar 21 1:33 PM
I see the behavior described by you in release 7.51 too. Until convinced otherwise I'd say it's a bug (especially since the syntax warning says that the keys k1 and k2 are identical).
There have been issues with FILTER and table_line before, but I hope there aren't many any more.
2017 Apr 03 4:52 PM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |