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
I'd like to see this rule extended to work also for TYPES. Ideally we should unchain these just like constants, variables, methods, etc.
Before:
TYPES: BEGIN OF type1,
field1 TYPE data,
END OF type1,
type2 TYPE STANDARD TABLE OF type1.
BEGIN OF type3,
field3 TYPE data,
END OF type3.
type3 TYPE STANDARD TABLE OF type3,
After:
TYPES:
BEGIN OF type1,
field1 TYPE data,
END OF type1.
TYPES type2 TYPE STANDARD TABLE OF type1.
TYPES:
BEGIN OF type3,
field3 TYPE data,
END OF type3.
TYPES type3 TYPE STANDARD TABLE OF type3.
Reacted by ConjuringCoffee, Mehmet Dağnilak and Jan Ježek
yes, that absolutely makes sense, and guess which comment I found inside the ChainRule code:
// TODO: chains that just *contain* a BEGIN OF ... END OF section may nevertheless be partly unchained ...if (command.getFirstToken().matchesOnSiblings(true, TokenSearch.ASTERISK, "BEGIN OF"))
returnfalse;
So, currently, the rule skips any TYPES command that contains BEGIN OF anywhere, but it would be nice to unchain those, while keeping BEGIN OF ... END OF blocks together where possible (unless they are anyway interrupted by an annoying INCLUDE…)
Hi,
I must admit I prefer chaining structure and table declaration. The finest result would be to have an option for the following result
TYPES: BEGIN OF ty_type1,
field1 TYPEdata,
END OF ty_type1,
tty_type1 TYPE STANDARD TABLE OF ty_type1.
TYPES: BEGIN OF ty_type2,
field3 TYPEdata,
END OF ty_type2,
tty_type2 TYPE STANDARD TABLE OF ty_type2.
thanks for bringing this up! With the next release, "Unchain into multiple statements" will now also work on TYPES chains that contain BEGIN OF … END OF definitions, if they are not interrupted by an INCLUDE (sorry, that case would really complicate things too much, but I think most cases are simple cases):
@AlexandreHT: Nice point! For this, I added the following option, which is activated by default:
Activity
jmgrassau commentedon Sep 2, 2023
Hi Josh,
yes, that absolutely makes sense, and guess which comment I found inside the ChainRule code:
So, currently, the rule skips any
TYPEScommand that containsBEGIN OFanywhere, but it would be nice to unchain those, while keepingBEGIN OF ... END OFblocks together where possible (unless they are anyway interrupted by an annoyingINCLUDE…)Kind regards,
Jörg-Michael
AlexandreHT commentedon Sep 29, 2023
Hi,
I must admit I prefer chaining structure and table declaration. The finest result would be to have an option for the following result
but I agree it complicates a bit the rule.
jmgrassau commentedon Nov 3, 2023
Hi Josh,
thanks for bringing this up! With the next release, "Unchain into multiple statements" will now also work on TYPES chains that contain BEGIN OF … END OF definitions, if they are not interrupted by an INCLUDE (sorry, that case would really complicate things too much, but I think most cases are simple cases):
@AlexandreHT: Nice point! For this, I added the following option, which is activated by default:

With that, you get:
Kind regards,
Jörg-Michael
enhance ChainRule for TYPES: BEGIN OF and related table types (SAP#94)
enhance ChainRule for TYPES: BEGIN OF and related table types (#94)
jmgrassau commentedon Nov 6, 2023
Hi Josh,
thanks for pointing this out – the enhancement (as described above) is now available in version 1.11.0 which was just released!
Kind regards,
Jörg-Michael