‎2006 Feb 09 12:07 PM
hi
i have bulid a internal table (dynamically)
but i cannot get value to print under the internal table
loop at it_final2 into WA_COUNT.
MOVE-CORRESPONDING WA_COUNT TO <DYN_WA>.
ASSIGN COMPONENT WA_COUNT-BTEXT OF STRUCTURE <dyn_wa> TO <fs_1>.
*ASSIGN COMPONENT WA_COUNT-num OF STRUCTURE <dyn_wa> TO <fs1>.
ASSIGN WA_COUNT-NUM TO <fs_1>.
append <dyn_wa> to <DYNTABLE>.
endloop.
sarangan r
‎2006 Feb 09 12:16 PM
What about something like that ?
loop at it_final2
into wa_count.
loop at it_fieldcatalog
into is_fieldcatalog.
assign component is_fieldcatalog-fieldname of structure <dyn_wa> to <field>.
check sy-subrc eq space.
concatenante 'it_final2-' fieldname into field.
assign (field) to <field2>.
check sy-subrc eq space.
move <field2> to <field>.
...
endloop.
endloop.Rgd
Frédéric
‎2006 Feb 09 1:09 PM
loop at it_final2 into WA_COUNT.
MOVE-CORRESPONDING WA_COUNT TO <DYN_WA>.
ASSIGN COMPONENT WA_COUNT-BTEXT OF STRUCTURE <dyn_wa> TO <fs1>.
<b>ASSIGN WA_COUNT-NUM TO <fs_1>.
<fs1> = <fs_1>. </b>
" above statement is moving value to the field
ABOVE CAN ALSO BE REPLACED LIKE BELOW
*********<FS1> = WA_COUNT-NUM.
append <dyn_wa> to <DYNTABLE>.
endloop.
copy and paste above, it will work.
in ur program, u r pointing field and value both to <fs_1>
thats wrong. both should be different fieldsymbols.
that is not that much confusing.
with ASSIGN COMPONENT , WE ARE POITING THE FIELD to a field symbol.
with ASSIGN we are pointing value to a field symbol.
NOW <FS1> = <fs_1>
MEANS WE ARE PASSING VALUE TO THE FIELD.
WITH ASSIGN , we are assigning
‎2006 Feb 09 1:27 PM
sorry small correction to the above
we cant give like this <FS1> = WA_COUNT-NUM.
give like below
*********assign WA_COUNT-NUM to <fs1>.
‎2006 Feb 10 2:41 AM
sorry, but i don't understand. what is it you want to print? please give more info.
‎2006 Feb 10 5:52 AM
Hi Sarangan,
Check this:
field-symbols: <dyn_table> type standard table,
<dyn_wa>,
<dyn_field>.
Suppose u have created the table now->
Select Data from table.
select * into table <dyn_table>
from (p_table).
*Print table
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.
write: <dyn_field>.
enddo.
endloop.
Thanks & Regards,
Ankur