Hi Shah,
There are two ways to change the data in the internal table
1) use modify statement with transporting
2) using field symbols
its better to use field symbols, for better performance.
In the above statement kindly debug that code,so you will understand what you done.
READ TABLE ist_data into wa_data with key afnam = wa_data-afnam.
read table syntax will read the content of the table in matching condition. in your case its afnam = wa_data-afnam. in that wa_data-afnam is zero. so sy-subrc is alwalys 4.
so use,
declare field symbol.
sort ist_data by afnam.
loop at ist_data assigning <fs_data> where afnam is not initial.
<fs_data>-werks = <fs_data>-afnam.
Endloop.
check for field symbol is assigned or not before using field symbol and kindly unassign after using.
Regards,
sampath kumar.