07-13-2010 6:56 AM
hi all.
i have a piece of code and wish to replace modify by field symbol.doesnt have idea abotu its significance.
please help me with code.thanks!
LOOP AT it_report INTO wa_report.
PERFORM f_get_info_from_it_febko.
wa_report-hbkid = wa_febko-hbkid.
wa_report-hktid = wa_febko-hktid.
wa_report-bukrs = wa_febko-bukrs.
MODIFY it_report FROM wa_report
TRANSPORTING: hbkid, hktid, bukrs.
PERFORM f_get_txt20.
wa_report-txt20 = wa_t028e-txt20.
MODIFY it_report FROM wa_report
TRANSPORTING txt20.
PERFORM f_get_vwezw.
wa_report-vwezw_txt = vwezw_txt.
MODIFY it_report FROM wa_report
TRANSPORTING vwezw_txt.
Moderator message: next time, please (re)search yourself instead of asking basic questions.
Edited by: Thomas Zloch on Jul 13, 2010 11:49 AM
07-13-2010 7:03 AM
Hi,
Fieldd symbols are like the pointers, It will just point the particular record of the internal table.So if you make any changes in the field symbols inside the loop, it will affect the record in the internal table... So no need to use the MODIFY statement....
Sample code :
FIELD-SYMBOLS : <fs_report> like it_report.
LOOP AT it_report ASSIGNING <fs_report>.
PERFORM f_get_info_from_it_febko.
<fs_report>-hbkid = wa_febko-hbkid.
<fs_report>-hktid = wa_febko-hktid.
<fs_report>-bukrs = wa_febko-bukrs.
PERFORM f_get_txt20.
<fs_report>-txt20 = wa_t028e-txt20.
PERFORM f_get_vwezw.
<fs_report>-vwezw_txt = vwezw_txt.
ENDLOOP.
07-13-2010 7:48 AM
appreciate quick reply.
but it gving the syntax error as the row type is not compatible.
please reply.
07-13-2010 7:57 AM
Hello,
I am using Senthil's example as reference, you have to change the field-symbol to LIKE LINE OF:
FIELD-SYMBOLS : <fs_report> LIKE LINE OF it_report.
BR,
Suhas