Skip to content

Syntax Error after cleanup at token '=' #226

Closed

Description

@this-yash

Hi,

I've been facing an issue if I use FOR expression with GROUP BY clause. If I comment it, the ABAP Cleaner works fine.
Screenshots are attached below for both the sample code and the issue. Please, share if it can be fixable from my side else check if it is fixable from your side.
Also, thanks for the awesome tool. It's a game changer!

image
image

Activity

  1. jmgrassau commented on Jan 4, 2024

    @jmgrassau
    Member

    Hi Yash,

    thanks a lot for reporting this issue! This seems to be a bug in the cleanup rule "Shorten VALUE statements", which mistakes the group key for a table row. A minimal example to trigger the error would be this:

    itab = VALUE #( FOR GROUPS OF <fs> IN itab GROUP BY 
                    ( plant = <fs>-plant )
                    ( plant = <fs>-plant
                      l1    = <fs>-l1 ) ).

    Here, the cleanup rule erroneously identifies plant = <fs>-plant as a common assignment and therefore extracts it from both inner parentheses …

    itab = VALUE #( FOR GROUPS OF <fs> IN itab GROUP BY 
                    plant = <fs>-plant
                    ( )
                    ( l1    = <fs>-l1 ) ).

    … which is a syntax error. Will fix this asap!

    Kind regards,
    Jörg-Michael

  2. self-assigned this
    on Jan 4, 2024
  3. jmgrassau commented on Jan 4, 2024

    @jmgrassau
    Member

    Hi Yash,

    this bug is now fixed for the next release.

    Kind regards,
    Jörg-Michael

  4. this-yash commented on Jan 5, 2024

    @this-yash
    Author

    Hi,

    Thank you very much. Will wait for the next release.

  5. jmgrassau commented on Jan 5, 2024

    @jmgrassau
    Member

    Hi Yash,

    thanks again for this bug report – this error should now be fixed with version 1.13.0, which was just released!

    Kind regards,
    Jörg-Michael

  6. ConjuringCoffee commented on Jan 8, 2024

    @ConjuringCoffee
    Contributor

    I love learning about syntax possibilities from ABAP Cleaner bug reports 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions