07-23-2007 7:27 AM
hi friends,
i was doing a coding in which i have three internal tables without header line .
when i tried to append the details from two internal tables using field symbol into third internal table using field symbol for fpi_zmsr_output as <fl_zmsr_output>.
i am getting a error like <fl_zmsr_output> is not assigned . but i have declared the field symbols globally .
please help me, the code for that is written below
LOOP AT fpi_zmsr_a004 ASSIGNING <fl_zmsr_a004>.
READ TABLE fpi_zmsr_konp ASSIGNING <fl_zmsr_konp> WITH TABLE KEY
knumh = <fl_zmsr_a004>-knumh.
<fl_zmsr_output>-matnr = <fl_zmsr_a004>-matnr.
<fl_zmsr_output>-datab = <fl_zmsr_a004>-datab.
<fl_zmsr_output>-kbetr = <fl_zmsr_konp>-kbetr.
APPEND <fl_zmsr_output> TO fpi_zmsr_output.
reward is sure for good answers..
07-23-2007 7:37 AM
Declare a structure same as that of the field symbol fl_zmsr_output and assign the variables to this structure initially. Then use the ASSIGN statement to assign the structure to the field symbol.
e.g:
LOOP AT fpi_zmsr_a004 ASSIGNING <fl_zmsr_a004>.
READ TABLE fpi_zmsr_konp ASSIGNING <fl_zmsr_konp> WITH TABLE KEY
knumh = <fl_zmsr_a004>-knumh.
ls_zmsr_output-matnr = <fl_zmsr_a004>-matnr.
ls_zmsr_output-datab = <fl_zmsr_a004>-datab.
ls_zmsr_output-kbetr = <fl_zmsr_konp>-kbetr.
ASSIGN ls_zmsr_output to <fl_zmsr_output>.
APPEND <fl_zmsr_output> TO fpi_zmsr_output.
This is needed because the field symbol does not get assigned when you simply use the "=" operator to transfer the values. You need to use the ASSIGN command explicitly to assign a field symbol.
Please reward points if the solution was useful.