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
Leave empty lines after Function Module declaration #106
In SE37 editor, if I leave an empty line after function module declaration, SE37 and Abap debugger shows it with 1 empty line, and ADT shows with 4 empty lines at the start.
I have configured the "Standardize empty lines within methods" rule to leave 1 empty line at method start. When I run the cleaner on this function module, it leaves only 1 line as supposed. But when the function is activated, the backend removes all the empty lines and it looks like there are no empty lines in SAP GUI (SE37 or debugger). When I edit the function in ADT, I see 3 empty lines.
After cleaning, before activation:
After activation:
I believe Cleaner should leave 4 empty lines after function module declarations (3+configured value), as only then we can see the 1 line in GUI.
This also causes another issue; notice the line numbers change between "before activation" and "after activation" after the cleanup. The first line of code appears on 5th line, then it goes to 7th line when activated.
I guess the reasoning behind this is that both ADT and SE37 users can refer to the same line of code by its line number. Though this does look terrible in ADT :(
I guess I can consider myself lucky to usually be working with OO code, so I didn't come across this … well … phenomenon myself yet!
From what I observed, ADT always ensures 3 empty lines if the function module has parameters, and 1 empty line if it doesn't. So, like you suggested, ABAP cleaner should do the same, meaning (3+configured value) empty lines in case of parameters. This will be fixed in the next release!
With that, if 4 empty lines are found, only 1 will be removed here:
With your settings, none would be removed anymore:
Also, some documentation was added:
And yes, this does look terrible… but it's probably the best solution while function modules are still around.
Kind regards,
Jörg-Michael
Reacted by ConjuringCoffee, Mehmet Dağnilak and JoachimRees
Activity
MDagni commentedon Sep 15, 2023
This also causes another issue; notice the line numbers change between "before activation" and "after activation" after the cleanup. The first line of code appears on 5th line, then it goes to 7th line when activated.
fabianlupa commentedon Sep 15, 2023
I guess the reasoning behind this is that both ADT and SE37 users can refer to the same line of code by its line number. Though this does look terrible in ADT :(
jmgrassau commentedon Sep 22, 2023
Hi Mehmet,
I guess I can consider myself lucky to usually be working with OO code, so I didn't come across this … well … phenomenon myself yet!
From what I observed, ADT always ensures 3 empty lines if the function module has parameters, and 1 empty line if it doesn't. So, like you suggested, ABAP cleaner should do the same, meaning (3+configured value) empty lines in case of parameters. This will be fixed in the next release!
With that, if 4 empty lines are found, only 1 will be removed here:


With your settings, none would be removed anymore:


Also, some documentation was added:

And yes, this does look terrible… but it's probably the best solution while function modules are still around.
Kind regards,
Jörg-Michael
MDagni commentedon Sep 22, 2023
Thank you @jmgrassau , this is what I was expecting.
fix EmptyLinesWithinMethodsRule for function modules (SAP#106)
fix EmptyLinesWithinMethodsRule for function modules (#106)
jmgrassau commentedon Sep 22, 2023
Hi Mehmet,
thanks again for this issue – this is now fixed in version 1.5.4 which was just released!
Kind regards,
Jörg-Michael