SAP / abap-cleaner

ABAP cleaner applies 95+ cleanup rules to ABAP code at a single keystroke
Apache License 2.0
447 stars 47 forks source link

Store the ABAP release in custom profile #304

Open aaalbe opened 5 months ago

aaalbe commented 5 months ago

I would like to use the ABAP Cleaner for a modern S4Hana system, but also for some older legacy ECC systems from the same ADT install. I created a custom profile for ECC and one for S4Hana, but when switching between profiles the ABAP syntax version needs to be selected manually every time. It would be great to be able to store the ABAP syntax version together with the profile and switch them together.

Best regards,

Arjan

ConjuringCoffee commented 5 months ago

Since last month the ABAP Cleaner has workspace-specific settings. You could have one workspace for S/4 and one for ECC systems. The setting for the ABAP release can then be set once for each workspace.

Check out this comment for more details: https://github.com/SAP/abap-cleaner/issues/211#issuecomment-2043139858

Hopefully that helps you already, Arjan 😉

aaalbe commented 5 months ago

Nice! Thanks for the response. I will play around with switching workspaces as you suggested.

jmgrassau commented 5 months ago

Hi Aarjan,

please also note that if you use ABAP cleaner from ADT, the setting on the ABAP cleaner UI ("Restrict rules to syntax of …") is just an additional restriction: ABAP cleaner also automatically gets the ABAP release of the system in which the incoming source code is stored …

image

… and then uses the lower one of those two releases to restrict the syntax. The restriction on the UI is usually just needed if you want to downport you code to even older releases at a later point (or in the standalone version, where ABAP cleaner doesn't know the system's ABAP release).

Kind regards, Jörg-Michael

ConjuringCoffee commented 5 months ago

Oh, I didn't know that the ABAP Cleaner automatically detects the system's version... in this case, switching the workspace isn't necessary after all!

The UI doesn't make that quite clear in my opinion. Maybe it would be useful to display the automatically determined release right there in the settings? Check out my crude mock-up:

image