I have a field symbol of a component of a structure:
ASSIGN COMPONENT lv_field_name OF STRUCTURE ls_structure TO <lv_data>.
IF sy-subrc = 0.
WRITE <lv_data> TO lv_field_value.
ENDIF.
Problem: if <lv_data>
is of type CURR
the result of WRITE...
might be wrong.
<lv_data>
references to to a field that holds the currency symbol (like 'EUR').
In my case we can make the assumption that the referenced currency field is in the same structure.
Is there an abstract way to get the referenced currency value of <lv_data>
so that I can write something like
WRITE <lv_data> TO lv_field_value CURRENCY <lv_currency>.
I looked into class cl_abap_typedescr
and subclasses, but I found nothing that I can use to assign <lv_currency>
.