-
Notifications
You must be signed in to change notification settings - Fork 41
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: No line between DATA declaration of a table and initialization #303
Comments
Hi Edo, currently, I'd rather label this "no defect", because the idea behind this empty line – to separate upfront declarations from executable statements – is still valid here, isn't it? If you prefer an inline declaration, you could alternatively define a table type first (maybe even on class or global level is this table type could be useful in different places?) and then use it as the type of the VALUE constructor: METHOD get_confirmed_quantity.
TYPES ty_tt_sup_conf_cat TYPE STANDARD TABLE OF zb_c_purgdocsupplierconfirmati-SupplierConfirmationCategory WITH EMPTY KEY.
DATA(conf_cats) = VALUE ty_tt_sup_conf_cat( ( 'AB' ) ( 'LA' ) ).
LOOP AT conf_cats INTO DATA(conf_cat). Kind regards, |
Hi Jörg-Michael, maybe we misunderstood each other? Because it is semantically a "declaration of a constant" I do not like to have the separation line in the middle of it. Again, I am aware it is a very tiny detail (not a defect at all), but I wanted to let you know that this use case exists. Best regards, |
Hi Edo, ah, yes, now I understand your point! But then a number of questions come to mind:
So, my feeling is that this is really rather a limitation of the ABAP language… just as you said, there is no technical equivalent for this (very valid) semantic scenario, and I assume that the initialization is indeed performed at runtime each time the method is called (not at compile time into a static storage). Kind regards, |
Hi Jörg-Michael, |
Hi,
to loop over a list of "options", I want to create a "quasi-constant" table containing these constants.
I think there is no way in ABAP other than to do it like this:
However, ABAPCleaner then separates the DATA and its initialization, which I would prefer it not to do in this special case.
(I know, this is a very small detail, still I wanted to share this.)
Best regards,
Edo
The text was updated successfully, but these errors were encountered: