Code: Alles auswählen.
move quell_wa-feld(n) to ziel_wa-feld(n)
Code: Alles auswählen.
REPORT zcfh_assign_component.
TYPES: BEGIN OF ty_in,
feld_01 TYPE string,
feld_02 TYPE string,
feld_03 TYPE string,
END OF ty_in,
BEGIN OF ty_out,
feld_a TYPE string,
feld_b TYPE string,
feld_c TYPE string,
END OF ty_out.
DATA: wa_in TYPE ty_in,
wa_out TYPE ty_out.
wa_in = VALUE ty_in( feld_01 = 'Montag' feld_02 = 'Dienstag' feld_03 = 'Mittwoch' ).
DO.
ASSIGN COMPONENT sy-index OF STRUCTURE wa_in TO FIELD-SYMBOL(<lv_in>).
IF sy-subrc <> 0.
EXIT.
ENDIF.
ASSIGN COMPONENT sy-index OF STRUCTURE wa_out TO FIELD-SYMBOL(<lv_out>).
IF sy-subrc <> 0.
EXIT.
ENDIF.
<lv_out> = <lv_in>.
ENDDO.
cl_demo_output=>display( wa_out ).