12-02-2008 11:42 AM
field-symbols: <dyn_table> type standard table,
<dyn_wa>,
<dyn_field>.
loop at <dyn_table> into <dyn_wa>.
do.
assign component sy-index
of structure <dyn_wa> to <dyn_field>.
if sy-subrc <> 0.
exit.
endif.
if sy-index = 1.
write:/ <dyn_field>.
else.
write: <dyn_field>.
endif.
enddo.
endloop.
In <Dyn_table> i have created feilds F1, F2,F3 dynamicly and so in <dyn_wa> . with this code i can read the feilds F1,F2,F3 from <Dyn_WA> but what if i want assign a value to it like
<Dyn_table> -F1 = 123 " This code is not working as feilds are added dynamicly to it ....
Please advice how we can do <Dyn_table> -F1 = 123 some thing like this
12-02-2008 11:48 AM
Hi,
Assign a blank structure to FS_TAB with fields F1 F2 and F3.
Then you can address FS_TAB-F1.
Hope this helps,
Raj
12-02-2008 11:58 AM
hello Rajat,
thanks for your intrest .. but the proble we dont now how many feilds will be there in the (It's dynamicly done at runtime ) so creating the sturtue is also a ?
02-18-2009 12:00 PM
Hi Rajat,
I hope this problem might have already solved..
In other case..
--> Create fieldcatalog for internal table
--> From Fieldcatalog you can get the position of the fields, Hence u can use
ASSIGn Composinent <position> of structure <> to <fs>.
--> after this, you can directly pass ur value to <fs>
<fs> = '20'.
Cheers,
Nag