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

Intended scope for "Use CamelCase for known CDS names" not clear / "replace ALL" option #386

Open
vonglan opened this issue Dec 16, 2024 · 0 comments

Comments

@vonglan
Copy link

vonglan commented Dec 16, 2024

Hi,

I just noticed this great feature now.
Here are some examples from my code where I would have wanted the rule to act.

Best regards,
Edo

    TYPES tp_line              TYPE zvo3_c_sdopenorderschedline. " SD is the template also for MM
    TYPES ttp_lines            TYPE STANDARD TABLE OF tp_line WITH KEY zDocumentCategory zdocument zitem scheduleline.

ABAPCleaner should change zdocument etc. in the second line to zDocument etc, because it is a CDS field name (as is also implied from the previous line). (The first line is adapted by ABAPCleaner as expected)

    TYPES:
      BEGIN OF tp_key_fields,
        zDocumentCategory TYPE zv_zvoov_type,
        zdocument         TYPE zv_document,
        zitem             TYPE zv_item,
        scheduleline      TYPE etenr,
      END OF tp_key_fields.

Here, it is not evident from context that zdocument is also a CDS field name. Still, for the coding style that I tried in this program, I would like the CDS field name "camelization" to be applied.
I suppose you have intentionally not provided this logic so far.
It would be nice to have it, at least as a non-default, "one-time" option "replace ALL name matches".

TYPES ty_range_incomplete TYPE RANGE OF zvo3_c_sdopenorderschedline-zorderincomplete.
Another example where it is clear from context that it is a CDS field.

      ASSERT ID zlog FIELDS c_line->zDocumentCategory c_line->zdocument c_line->zitem CONDITION     c_line->zTotalRequiredQuantityForMat IS INITIAL
                                                                                                AND c_line->zunconfirmedptpstoquantity   IS INITIAL.

One last example. It should be clear from the type of c_line that these are CDS field names. But I do not know how ABAPCleaner analyzes the code internally. If it is not technically possible for ABAPCleaner to recognize the context correctly, I would still love to have the "replace ALL name matches" option, mentioned above.

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

No branches or pull requests

1 participant