Passing values tofield catalog
I have dynamically created a structure based on my requirement and assigned to field symbols as well. But i dont know how to assign the values to the column fields of that Field Symbols.
Consider the dynamic structure of the field symbol is VBELN, AUDAT, MAT, QUANTITY.
I tried to pass like
<FS>-VBELN = '000101010'. <FS>-AUDAT = '20110101'. <FS>-MAT = '100-100'. <FS>-QUANTITY = '10'.
But this showing an error VBELN is not a component of <FS>.
Plz help me out for the same.
Thanks in Advance.
Clemens Li replied
you need one more field-symbol.
If <fs> is assigned to the line of the dynamic table, then
ASSIGN COMPONENT 'VBELN' OF STRUCTURE <fs> TO <f2>. <F2> = '000101010'.
Or even more dynamic:
data: lv_fieldname type fieldname. lv_fieldname = 'VBELN'. ASSIGN COMPONENT (lv_fieldname) OF STRUCTURE <fs> TO <f2>. <F2> = '000101010'.
... and so on.