Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

urgent : doubt on field symbols

Former Member
0 Kudos

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..

1 REPLY 1

Former Member
0 Kudos

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.