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
"Align parameters and components": Align assignments across multiple parenthesis in one VALUE #54
Hi Jörg-Michael, I'm sorry to open another issue for rule "Align parameters and components" - I hope I don't annoy with this... 😅
This issue is about the option "Align assignments" in a VALUE statement to create an internal table. Example:
METHODexample.
TYPES: BEGIN OF ly_type,
short TYPE i,
medium TYPE i,
longer_name TYPE i,
END OF ly_type.
DATA lt_example TYPE TABLE OF ly_type WITHEMPTY KEY.
lt_example =VALUE #( ( short =1
medium =1
longer_name =3 )
( short =2
medium =2 )
( short =3
longer_name =3 ) ).
ENDMETHOD.
The second table line is aligned based on its longest component name medium. Instead, I'd like it to be aligned to the longest component used (in this case longer_name):
METHODexample.
TYPES: BEGIN OF ly_type,
short TYPE i,
medium TYPE i,
longer_name TYPE i,
END OF ly_type.
DATA lt_example TYPE TABLE OF ly_type WITHEMPTY KEY.
lt_example =VALUE #( ( short =1
medium =1
longer_name =3 )
( short =2
medium =2 )
( short =3
longer_name =3 ) ).
lt_example[ 1 ]-longer_name =1.
ENDMETHOD.
changed the title [-]"Align parameters and components": Align assignments across multiple VALUE lines[/-][+]"Align parameters and components": Align assignments across multiple VALUE table rows[/+]on Jun 9, 2023
changed the title [-]"Align parameters and components": Align assignments across multiple VALUE table rows[/-][+]"Align parameters and components": Align assignments across multiple parenthesis in one VALUE[/+]on Jun 9, 2023
Activity
[-]"Align parameters and components": Align assignments across multiple VALUE lines[/-][+]"Align parameters and components": Align assignments across multiple VALUE table rows[/+][-]"Align parameters and components": Align assignments across multiple VALUE table rows[/-][+]"Align parameters and components": Align assignments across multiple parenthesis in one VALUE[/+]jmgrassau commentedon Jun 9, 2023
Hi ConjuringCoffee,
another issue on "Align parameters and components" is not a surprise, given that it is a rather complex rule!
And you're completely right, alignment should work (at least by default) across these table rows; that has actually already been on my list…
Kind regards,
Jörg-Michael
jmgrassau commentedon Jun 10, 2023
Hi ConjuringCoffee,
this should work now :-) If I enter
activating the new option

the "Align parameters and components" rule produces:
Deactivating the option leads to the previous behavior:
Kind regards,
Jörg-Michael
enhance AlignParametersRule with option to 'Align ... across rows' (S…
enhance AlignParametersRule with option to 'Align ... across rows' (#54)
jmgrassau commentedon Jun 12, 2023
Hi ConjuringCoffee,
thanks for the "hooray emoji(s)" :-) And again, very good point, this has now really improved the optics of such VALUE statements.
Kind regards,
Jörg-Michael