Skip to content

Ranges cause syntaxerror after cleanup if used as type for other variables #439

Closed

Description

@LechnerClemens

If a range is used as a type in a different variable, the order in which the cleaner sorts is important. As far as i can tell ABAP-Cleaner always puts ranges after the data declarations but that does not always work:

Before Cleaner:

form test.

ranges r_matnr for mara-matnr.

data ls_matnr like line of r_matnr.

data(test1) = r_matnr.
data(test2) = ls_matnr.

endform.

After Cleaner:

form test.
  data ls_matnr like line of r_matnr.

  ranges r_matnr for mara-matnr.

  data(test1) = r_matnr.
  data(test2) = ls_matnr.

endform.
Image

A lot of our legacy code is programmed in this way and this causes a lot of issues with ABAP-Cleaner

Activity

  1. self-assigned this
    on Sep 10, 2025
  2. jmgrassau commented on Sep 10, 2025

    @jmgrassau
    Member

    Hi Clemens,

    thanks a lot for reporting this! RANGES is an obsolete declaration statement, but nevertheless, ABAP cleaner shouldn't introduce syntax errors, of course. This bug should be fixed with the next release:

    Image

    Kind regards,
    Jörg-Michael

  3. jmgrassau commented on Sep 11, 2025

    @jmgrassau
    Member

    Hi Clemens,

    this should now be fixed in version 1.21.3, which was just released – thanks again for opening this issue!

    Kind regards,
    Jörg-Michael

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