-
Notifications
You must be signed in to change notification settings - Fork 53
Rearrange local declarations leading to syntax error #64
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 Marc, thanks a lot for reporting this! The rule already tries to consider METHOD any_method.
DATA: BEGIN OF ls_struc,
comp TYPE i,
END OF ls_struc,
lt_table TYPE STANDARD TABLE OF ty_s_any WITH DEFAULT KEY.
FIELD-SYMBOLS <ls_any> LIKE LINE OF lt_table.
rv_result = ls_struc-comp + lines( lt_table ) + <ls_any>-comp.
ENDMETHOD. Will fix this, of course! Kind regards, |
Hi Marc, thanks again for this finding! This will be fixed in the next release – the rule now double-checks that a declaration is not moved in front of the declaration it refers to with Kind regards, |
Thanks as always for the quick solution! |
Hi Marc, version 1.4.1 was just released and should fix this! Kind regards, |
Settings: Default

I was working on changes to AbapOpenCheck 06 (https://github.com/larshp/abapOpenChecks/blob/main/src/checks/zcl_aoc_check_06.clas.abap) and noticed a syntax error after AbapCleaner re-ordered the local declarations.
Here's an example with the basic structure before:

And after Cleanup:

Notice the field symbol declaration is now before the data statement it references.
Maybe there needs to be an additional check on usages of LIKE LINE OF.
The text was updated successfully, but these errors were encountered: