abap-cleaner icon indicating copy to clipboard operation
abap-cleaner copied to clipboard

Name of a function-module with mixed upper-/lower-case

Open VladGhitulescu opened this issue 2 years ago • 7 comments

Hey,

it looks like the ABAP Cleaner doesn't interfere when changing a part of the function-module-name

CleanShot 2023-11-11 at 12 36 42

I expected that "_gis_korr" would be capitalize by ABAP Cleaner.

Regards, Vlad

VladGhitulescu avatar Nov 11 '23 11:11 VladGhitulescu

CALL FUNCTION only works with upper-case names. Lower-case or mixed-case names will cause a runtime error, so your code actually doesn't work right now. If the ABAP Cleaner corrects the name, then this would change the outcome.

I could imagine this as a rule though. I find it highly unlikely that someone would use lower case letters on purpose, so I would be alright with having the ABAP Cleaner fix this. 😄

ConjuringCoffee avatar Nov 13 '23 13:11 ConjuringCoffee

I expected this actually - that's why I didn't correct it myself due to the fact that I start ABAP Cleaner before activating (both in a macro).

VladGhitulescu avatar Nov 13 '23 14:11 VladGhitulescu

Hi Vlad and ConjuringCoffee,

interesting finding! I think this could be a new option to the "Convert upper and lower case" rule (but maybe default off, because this would indeed change the functionality? On the other hand I agree, it is highly unlikely that this could be on purpose).

However, I wonder why PrettyPrinter doesn't do this: There doesn't seem to be a valid case for lower-case characters here, and my attempts to create a function module with a lower-case character in the name all failed – or do we overlook something?

CALL METHOD ('METHOD_NAME_literal'). seems to be the same: any lower-case letter provokes a dump, even if the specified literal is all lower-case and the method is defined in lower-case chars.

Kind regards, Jörg-Michael

jmgrassau avatar Nov 13 '23 18:11 jmgrassau

Hi Vlad,

sorry, I entered a wrong issue number in the titles of the above commits – they belong to issue #197!

Kind regards, Jörg-Michael

jmgrassau avatar Nov 13 '23 21:11 jmgrassau

Overlook something: Just maybe you can write a CPI-C compatible function outside the ABAP stack with a non all uppercase name and call it over RFC?

fabianlupa avatar Nov 13 '23 21:11 fabianlupa

Hi Fabian,

in that case, just to be on the safe side,

  • the RFC - CALL FUNCTION variants (… DESTINATION, … STARTING NEW TASK, … IN BACKGROUND UNIT) should better be excluded from this. Interestingly, the ABAP documentation does NOT seem to mention upper case here for the function name, while
  • in the general CALL FUNCTION and CALL FUNCTION, IN UPDATE TASK, upper case is explicitly mentioned.

Kind regards, Jörg-Michael

jmgrassau avatar Nov 13 '23 21:11 jmgrassau

I wonder if the pretty printer simply ignores strings just for the sake of convenience or performance. If you check the implementation of the pretty printer, it is set up to simply ignore any string (both ' and `).

ConjuringCoffee avatar Mar 15 '24 12:03 ConjuringCoffee