Hello,
I'll explain this question in 2 parts 😊, the general idea and it's intents
I've been trying to do some dynamic coding and I still didn't manage a way to find out a variable name at runtime.
I wanted to pass the variable into a method/subroutine and find out what is the variable name along with some other properties:
o_dynsel->add_select_option( s_matnr[] ).
Here's the idea:
While using the dynamic selection FM's (FREE_SELECTION_INIT), I wanted to map the select-options I have on screen to their corresponding fields inside the function. This can be achieved If:
Plus, I wanted to do this as generic as possible.
I could do this using a text with the variable name:
o_dynsel->add_select_option( i_selop = 'S_MATNR'
i_ref_field = 'MARA-MATNR' ).
But I simply don't like it that way(plus, I can always get spelling errors! )