‎2010 May 18 2:55 PM
Hi
I have dynamic internal table <lt_paxxxx>. Iam fillling <lt_paxxxx> in the following way.
select * into table <lt_paxxxx> from (infty-dbname).
I have to pass data of <lt_paxxxx> to another internal table lt_final.
'lt_final' should contain fields like <lt_paxxxx>, infty name, DB name.
Could you please help me out how to pass <lt_paxxxx> data to 'LT_FINAL'.
‎2010 May 18 3:06 PM
loop at <it_table>
into <is_table>.
loop at it_fieldcatalog
into is_fieldcatalog.
assign component is_fieldcatalog-fieldname
of structure <is_table>
to <field1>.
concatenate 'IT_TABLE-'
is_fieldcatalog-fieldname
into w_field.
assign (w_field) to <field2>.
check sy-subrc eq space.
move <field1> to <field2>.
endloop.
append it_table
endloop.
regards
‎2010 May 18 3:08 PM
Hi,
You can use method CL_ABAP_TYPEDESCR=>DESCRIBE_BY_DATA to get the description object of each of the tables. The method returns an object reference of type CL_ABAP_TYPEDESCR - but in case of an internal table you an cast this reference to type CL_ABAP_TABLEDESCR. In this object you have a public attribute COMPONENTS which describe the components of a table's line.
With the two components lists of the 2 tables you should be able to move the values to your target table using dynamic ASSIGN.
Regards, Gerd Rother