Skip to content
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

Feature request: Custom CDS names for rule "Use CamelCase for known CDS names" #281

Open
ConjuringCoffee opened this issue Mar 25, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@ConjuringCoffee
Copy link
Contributor

Hi Jörg-Michael, would it be possible to somehow provide a list of custom CDS names to the rule "Use CamelCase for known CDS names"? Maybe an additional file that can be handled independently from the profile? 😉

@ConjuringCoffee ConjuringCoffee changed the title Add custom CDS names for rule "Use CamelCase for known CDS names" Feature request: Custom CDS names for rule "Use CamelCase for known CDS names" Mar 25, 2024
@jmgrassau jmgrassau added the enhancement New feature or request label Mar 25, 2024
@jmgrassau
Copy link
Member

jmgrassau commented Mar 25, 2024

Hi ConjuringCoffee,

haha, I was literally waiting for this suggestion to come up, and you did it within less than 1 hour after the release!

Yes, this should be doable, and I already tried to consider this as a possible enhancement while implementing the current functionality.

My idea would be to

  • specify a subfolder of the "profiles" folder (so it can be synchronized as part of team profiles), along with file prefixes for one or multiple text files containing custom view names or field names, respectively (e.g. "profiles/CamelCase/ViewNames*.txt" and "profiles/CamelCase/FieldNames*.txt")

  • specify a format for these text files – probably simply "MyCustomFieldName<linefeed>"

  • allow each profile to activate or deactivate custom CDS names (but always using the same text files)

  • prioritize these custom names between the "approved" ones and the "known" ones from SAP. So, if you have

    • "CompanyCode" approved at SAP
    • "Companycode" and "AnyFieldname" in your custom files
    • "AnyFieldName" known (but not approved) at SAP,

    then "CompanyCode" (from SAP) and "AnyFieldname" (from custom files) would override the other variants.

  • maybe even provide some sample ABAP code for downloading this information from your SAP system (tables DD02B and DD03ND)

Would that make sense? Some open question include

  • whether custom names should be checked against naming rules and filtered out if they violate them (e.g. with respect to allowed prefixes and suffixes, or if they start with a lower case letter like "anyFieldName"),
  • what to do if custom files contain contradictory names (e.g. both "AnyFieldname" and "Anyfieldname")
  • whether to prioritize personal custom files in %APPDATA% higher or lower than synchronized team custom files.

Kind regards,
Jörg-Michael

@ConjuringCoffee
Copy link
Contributor Author

Thank you for the quick and elaborate response! Your basic idea is sound, but to me it would be important to be able to have the settings independently from the profile. Imagine one of the following scenarios:

@jmgrassau
Copy link
Member

Hi ConjuringCoffee,

just to be sure that I understand you correctly: Where and how would a user then configure the location of their fiels with custom CDS names? And once configured, they would always be valid, regardless of the selected profile?

Kind regards,
Jörg-Michael

@ConjuringCoffee
Copy link
Contributor Author

Hi Jörg-Michael, here's how I'd imagine it:

  • I want to set up a combination of a profile and a CDS naming file for each of my ABAP projects.
  • For each open-source project that works with different settings, I'd create a new ABAP project.
  • Only a single CDS naming file would need to be "active" for each ABAP project.
  • While profiles are typically shared as read-only files, the CDS naming files should be editable by everyone. It would be enhanced frequently by various new developments, so I can't imagine that to be handled by a central instance. I'd imagine some kind of command on a CDS view to "add all names to the CDS naming file".

Does that make sense? 😄

The whole thing relies on the possibility to have settings related to each ABAP project. Is that feasible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants