‎2009 Mar 26 11:01 PM
Hi. I have the next problem.
Let' supose that I have a variable wich contents the name of a data element (ls_element = NAME_ORG).
I want to define another variable using the content of the previus variable (ls_variable TYPE NAME_ORG).
How can I do that??
‎2009 Mar 26 11:38 PM
Hello,
try using the CREATE DATA statement:
DATA type_name TYPE TYPENAME.
DATA dyn_data TYPE REF TO DATA.
* Dynamically create the variable dyn_data
type_name = 'VBAK'. " <-- or any other valid type
CREATE DATA dyn_data TYPE (type_name).
Use a field symbol to work with the dynamically defined variable.
Best regards
David
‎2009 Mar 26 11:38 PM
Hello,
try using the CREATE DATA statement:
DATA type_name TYPE TYPENAME.
DATA dyn_data TYPE REF TO DATA.
* Dynamically create the variable dyn_data
type_name = 'VBAK'. " <-- or any other valid type
CREATE DATA dyn_data TYPE (type_name).
Use a field symbol to work with the dynamically defined variable.
Best regards
David
‎2009 Mar 27 2:35 AM
Hi,
Firstly, you can get NAME_ORG into one variable using ((ls_element).. like..
lv_temp = ((ls_element).
Once you get this.. use CREATE DATA.. to create lv_variable.