You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enforcing DATA before TYPES leads to compiler-errors #516
could you provide a concrete example where this happens? Actually it's the other way round, i.e. the cleanup rule "Rearrange local declarations" tries to put TYPES first (then CONSTANTS, then STATICS, then DATA, then FIELD-SYMBOLS).
There are only some special cases where that's not possible, e.g. if the component of a structure definition (TYPES: BEGIN OF) refers to a previous DATA declaration with LIKE:
METHODany_method.
DATA lv_any TYPE ty_any.
TYPES: BEGIN OF ty_s_other,
comp LIKE lv_any,
END OF ty_s_other.
...
ENDMETHOD.
Hi, Jörg-Michael!
Sure, here it is:
<img width="1381" height="593" alt="Image" src="https://github.com/user-attachments/assets/a8fd7ad4-09aa-4a2c-86a2-51e756fbb540" />
The TYPES-declaration was initially ABOVE DATA.
ABAP Cleaner put this every single time 🙃 into the wrong place - see also the red-tick in Eclipse’s gutter on line 3462.
And it is not the only exception, I have another similar one as well.
Regards,
Vlad
ah, I see, thanks for these examples! It seems to be the combination of declaring the table type (which uses the structure definition) and defining the table (which uses the table type). Will look into it!
On 1 Jun 2026, at 20:24, Jörg-Michael Grassau wrote:
jmgrassau left a comment (SAP/abap-cleaner#516)
Hi Vlad and Marius,
thanks again for reporting this! This bug should now be fixed with
version 1.26.0, which was just released!
Kind regards,
Jörg-Michael
--
Reply to this email directly or view it on GitHub:
#516 (comment)
You are receiving this because you authored the thread.
Message ID: ***@***.***>
Activity
jmgrassau commentedon Jun 1, 2026
Hi Vlad,
could you provide a concrete example where this happens? Actually it's the other way round, i.e. the cleanup rule "Rearrange local declarations" tries to put TYPES first (then CONSTANTS, then STATICS, then DATA, then FIELD-SYMBOLS).
There are only some special cases where that's not possible, e.g. if the component of a structure definition (TYPES: BEGIN OF) refers to a previous DATA declaration with LIKE:
Kind regards,
Jörg-Michael
VladGhitulescu commentedon Jun 1, 2026
mraht commentedon Jun 1, 2026
..another example referring to the limitation mentioned:
jmgrassau commentedon Jun 1, 2026
Hi Vlad and Marius,
ah, I see, thanks for these examples! It seems to be the combination of declaring the table type (which uses the structure definition) and defining the table (which uses the table type). Will look into it!
Kind regards,
Jörg-Michael
fix LocalDeclarationOrderRule for TYPES with structure and table (#516)
jmgrassau commentedon Jun 1, 2026
Hi Vlad and Marius,
thanks again for reporting this! This bug should now be fixed with version 1.26.0, which was just released!
Kind regards,
Jörg-Michael
VladGhitulescu commentedon Jun 1, 2026