SAP / abap-file-formats

File formats that define and specify the file representation for ABAP development objects
MIT License
58 stars 56 forks source link

Refactoring ENUMs #171

Closed larshp closed 3 years ago

larshp commented 3 years ago

In the original suggestion, https://github.com/SAP/abap-file-formats/issues/92#issuecomment-841975386 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 commented 3 years ago

Let's take the following example: https://github.com/SAP/abap-file-formats/blob/b569b7b519e4b6b93aa2920cbcc522a8730f8550/file-formats/intf/type/zif_aff_intf_v1.intf.abap#L11-L33

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 commented 3 years ago

ah, I did not remember, also see #61