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

Delete enum related logic #65

Open
larshp opened this issue Apr 20, 2022 · 7 comments
Open

Delete enum related logic #65

larshp opened this issue Apr 20, 2022 · 7 comments

Comments

@larshp
Copy link
Collaborator

larshp commented Apr 20, 2022

the abap-file-formats is in 702 syntax, so enums are out of scope?

suggest deleting the related logic in this repository, less code is easier to get running, plus ENUMS in ABAP is a mess...

@larshp
Copy link
Collaborator Author

larshp commented Apr 21, 2022

looks like some is used for internal logic

  TYPES:
    BEGIN OF ENUM enum_formatting_option STRUCTURE formatting_option,
      no_formatting VALUE IS INITIAL,
      camel_case    VALUE 1,
    END OF ENUM enum_formatting_option STRUCTURE formatting_option,

    BEGIN OF ENUM enum_type_info STRUCTURE type_info,
      string,
      numeric,
      boolean,
      date_time,
    END OF ENUM enum_type_info STRUCTURE type_info,

    BEGIN OF ENUM enum_operation STRUCTURE operation,
      initial,
      write_element,
      open_structure,
      close_structure,
      open_table,
      close_table,
    END OF ENUM enum_operation STRUCTURE operation.

and some, is external facing logic which is not needed?

      get_enum_values
        IMPORTING element_name        TYPE string
                  element_description TYPE REF TO cl_abap_elemdescr
        RETURNING VALUE(result)       TYPE string_table
        RAISING
                  zcx_aff_tools,

      get_enum_descriptions
        IMPORTING element_name        TYPE string
                  element_description TYPE REF TO cl_abap_elemdescr
        RETURNING VALUE(result)       TYPE string_table,

@larshp
Copy link
Collaborator Author

larshp commented Apr 21, 2022

was hoping not to downport ENUMs but guess I'll add that, work work 🚈

@larshp
Copy link
Collaborator Author

larshp commented Apr 21, 2022

testcase, can be removed, out of scope?

  METHOD enum_element.
*  base type / base structure/ ohne (integer)
    TYPES:
      BEGIN OF ENUM category,
        general ##NEEDED,
        classic_badi ##NEEDED,
      END OF ENUM category.

@larshp larshp changed the title Delete ENUMs and related logic? Delete enum related logic Apr 21, 2022
@albertmink albertmink self-assigned this Apr 21, 2022
@albertmink
Copy link
Contributor

albertmink commented Apr 21, 2022

This is two fold (both to be removed!):

  • We allow ENUMs to be parsed. This can be removed, because as you said: It is out-of-scope.
  • Internal logic is somehow based on ENUMs e.g. here and it can be replaced by constants. See comment below

@albertmink albertmink removed their assignment Apr 21, 2022
@larshp
Copy link
Collaborator Author

larshp commented Apr 21, 2022

keep the internal logic as is, I implemented automatic downport of ENUMS to constants earlier today,

image

@albertmink
Copy link
Contributor

So (hypothetically) I could do a downport on my local machine and copy/paste the results to the repository, right?

@larshp
Copy link
Collaborator Author

larshp commented Apr 21, 2022

yea (but in this case we want to maintain the code in the high version/ENUM)

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

2 participants