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

Refactoring ENUMs #171

Closed
larshp opened this issue Aug 16, 2021 · 2 comments · Fixed by #173
Closed

Refactoring ENUMs #171

larshp opened this issue Aug 16, 2021 · 2 comments · Fixed by #173

Comments

@larshp
Copy link
Collaborator

larshp commented Aug 16, 2021

In the original suggestion,
#92 (comment)
the ABAP code has access to both the internal and external values.

This is not the case right now, https://github.com/SAP/abap-file-formats/blob/main/file-formats/typesUsedForAll/zif_aff_types_v1.intf.abap#L9

I have not looked at how to do serialization to and from ABAP file formats yet, but expect this to give problems

@schneidermic0
Copy link
Contributor

Let's take the following example:

BEGIN OF co_category,
"! <p class="shorttext">General</p>
"! General interface
general TYPE ty_category VALUE '00',
"! <p class="shorttext">Classic BAdI</p>
"! Interface definition of a classic BAdI
classic_badi TYPE ty_category VALUE '01',
"! <p class="shorttext">Business (Static Components)</p>
"! Business interface for static components
business_static_components TYPE ty_category VALUE '51',
"! <p class="shorttext">Business (Instance-dep. components)</p>
"! Business interface for instance-dependent components
business_instance_components TYPE ty_category VALUE '52',
"! <p class="shorttext">DB Procedure Proxy</p>
"! Generated interface of a database procedure proxy
db_procedure_proxy TYPE ty_category VALUE '65',
"! <p class="shorttext">Web Dynpro Runtime</p>
"! Web Dynpro runtime interface
web_dynpro_runtime TYPE ty_category VALUE '80',
"! <p class="shorttext">Enterprise Services</p>
"! Generated interface of enterprise services
enterprise_service TYPE ty_category VALUE '90',
END OF co_category.

I understand it the following way:

  1. Internal values (e.g., which are stored in the database) are the values of the constants.
    Example: The internal for BAdI definitions is value is 01
  2. External values are derived from the constant name by creating camelCase values.
    Example: The internal value for BAdI definitions (field badi_dafinition) is badiDefinition

Do I miss anything? Wouldn't this be sufficient.

If it is sufficient, most probably, specification has to be adapted to describe this behavior.

@larshp
Copy link
Collaborator Author

larshp commented Aug 16, 2021

ah, I did not remember, also see #61

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

Successfully merging a pull request may close this issue.

2 participants