Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
VladGhitulescu opened this issue Nov 11, 2023 · 7 comments
Open

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

VladGhitulescu opened this issue Nov 11, 2023 · 7 comments

Comments

@VladGhitulescu
Copy link

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

@ConjuringCoffee
Copy link
Contributor

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. 😄

@VladGhitulescu
Copy link
Author

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).

@jmgrassau
Copy link
Member

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 added a commit to jmgrassau/abap-cleaner that referenced this issue Nov 13, 2023
@jmgrassau
Copy link
Member

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

@fabianlupa
Copy link

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?

@jmgrassau
Copy link
Member

jmgrassau commented Nov 13, 2023

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

@ConjuringCoffee
Copy link
Contributor

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 `).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants