Could you show the real line which has an error? The one you show is correct.
You may write something like ASSIGN COMPONENT ('MATNR') OF STRUCTURE <fs_wa> TO <fs_comp>. Here MATNR is a literal so it's not evaluated by the compiler. You may also use a variable name "g_fieldname" which contains "MATNR": ASSIGN COMPONENT (g_fieldname) OF STRUCTURE <fs_wa> TO <fs_comp>.
If you have any doubt, look at the ABAP documentation.