2006 Nov 23 9:14 AM
Hi,
i want to get type of a variable dynamically, in ABAP. For example, the following code :
data: my_var type zmystruct.
In ABAP i want to get 'zmystruct', and after i want to create dynamically a new variable with this type.
Thanks for help.
Cheers
ps: I posted yesterday the same message but it was deleted, why ?
2006 Nov 23 9:18 AM
The following links should help you
Regards,
Ravi
Note Please mark all the helpful answers
The following links should help you
Regards,
Ravi
Note Please mark all the helpful answers
2006 Nov 23 9:18 AM
The following links should help you
Regards,
Ravi
Note Please mark all the helpful answers
2006 Nov 23 9:19 AM
Hi,
The easiest way is to use class CL_ABAP_TYPEDESCR. It will return all the details of a variable (including complex types), allowing you to dynamically create another instance of it.
MJ
2006 Nov 23 9:19 AM
DATA: FLD(8) TYPE N,
F_TYPE.
DESCRIBE FIELD FLD TYPE F_TYPE.
Result: F_TYPE contains the value 'N'.Reward if helpful and close the thread
Message was edited by:
chandrasekhar jagarlamudi
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |