Consider the following code snippet:
TYPES: BEGIN OF ty_tab,
col1 TYPE char20,
col2 TYPE char20,
col3 TYPE i,
col4 TYPE i,
END OF ty_tab.
DATA: it_tab TYPE TABLE OF ty_tab,
wa_tab TYPE ty_tab.
FIELD-...
Dear friends,
I want to store the name of a variable in a string for later use. Assume that the name of the variable is not known till runtime.
Something like:
DATA: v_myvar TYPE c. " v_myvar may not be known till runtime
DATA: varname TYPE s...
That is as close to the solution as I have gotten. But what about singular FS or variables that are not part of any structure? Thanks for the valuable input.
Ok. I resolved it myself. It was a stupid mistake.
DATA: lv_fname TYPE string.
MOVE 'WA_TAB-COL3' TO lv_fname. " Determined dynamically
ASSIGN (lv_fname) TO <fs_name>.
MOVE <fs_temp> TO <fs_name>.
One possible scenario would be the use of
ASSIGN COMPONENT sy-index OF STRUCTURE <fs_wa> TO <fs>.
Now, I modify the value of <fs> @ runtime based on a condition and want to have a log of structure components that got modified.
I think we would...