'MODIFY' statement changes the content of one or several internal table lines that can be specified using the table key or the table index

Ex : MODIFY TABLE itab FROM wa TRANSPORTING field1.
Only change field1 taken from work area wa in internal table itab

MODIFY itab INDEX idx FROM wa TRANSPORTING field1.
Mentioning the line number for modification.

MODIFY itab FROM wa TRANSPORTING field2 WHERE field1 = ‘ ‘.
Additional condition apart from the primary fields of wa.

If you are looping through the internal table and modifying the contents , its recommended to use field symbols instead of work area.

In case of field symbols just use ASSIGNING <fieldsymbolname> instead of into.

EX:

LOOP AT it_mara ASSIGNING <wa_mara> FROM lv_index.
  ... <processing statements>.....
ENDLOOP.
Any changes done on <wa_mara> will be reflected back into the internal table



Serkan AKKAVAK
Computer Engineer
ABAP Developer & SAP MM SD Consultant