-
Notifications
You must be signed in to change notification settings - Fork 53
Get an error when query to ABAP CDS contains read by association #133
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Hi Kronrir, thanks for opening this issue! Actually this error is just about the colon ":" inside the brackets With such a colon, you could do things like this: CONSTANTS lc_id1 TYPE s_conn_id VALUE '1234'.
CONSTANTS lc_id2 TYPE s_conn_id VALUE '5678'.
SELECT \_spfli[ (1) INNER WHERE :
connid > @lc_id1 ]-connid AS connid FROM demo_cds_assoc_scarr AS scarr INTO @DATA(result1),
connid < @lc_id2 ]-connid AS connid FROM demo_cds_assoc_scarr AS scarr INTO @DATA(result2).
" do something with result1 and result2
ENDSELECT.
ENDSELECT. So you'd have one opening However, strictly speaking, in this case, the colon doesn't harm so much, because there is no comma, therefore it is just a "chain with one element" and the opening bracket is only closed once. I shall adjust ABAP cleaner to accept these cases. Nevertheless, I think there is no reason to have this colon here. Kind regards, |
Ok, agree with you in this case I reworked query and read data directly from CDS which is associated from root CDS, that was not a problem. |
Hi Kronir, I am not sure whether I understand you point: How does removing the chain colon change the way how data is read here? From what I see in the ABAP documentation on attributes in Path Expressions, there is no need to put a colon between INNER and WHERE. Kind regards, |
Hi, Jörg-Michael |
Hi Kronrir, thanks again for bringing this up – in version 1.7.0, which was just released, ABAP cleaner now "tolerates" chain colons inside of parentheses and brackets if no comma is found (i.e. in "chain of one" cases), so your example above wouldn't trigger a "parse error" anymore. Kind regards, |
Hello!

I've used ABAPCleaner for last 3 months and that is super cool tool thank you a lot!
I found one bug when I tried to clean/format piece of code which contains select by association in ABAP CDS view.
Error you can see at the screenshot
I can't refactor this command it is usual read by association for me.
Maybe somebody can suggest how to refactor such code, but I think that is a bug.
The text was updated successfully, but these errors were encountered: