2014 Aug 18 2:56 PM
Hi,
I have a huge dynamic table with a few columns and need to fill another dynamic table with some of the columns, that are also existing in the other one. I first know at runtime, which fields the smaller table contains.
Until now, I did it that way:
LOOP AT <it_tab_structure> ASSIGNING <wa_tab_structure>.
LOOP AT lt_comp_full INTO ls_comp_full.
ASSIGN COMPONENT ls_comp_full-name OF STRUCTURE <structure> TO <column>.
ASSIGN COMPONENT ls_comp_full-name OF STRUCTURE <wa_tab_structure> TO <value>.
<column> = <value>.
ENDLOOP.
APPEND <structure> TO <table>.
ENDLOOP.
lt_comp_full contains the columns of the second table, that have to be filled.
This is taking a very long time, as there can be a lot of columns in the source table and the source table contains at least 100000 records.
Is there therefore any way to fill the other table faster?
Thank you & best regards,
Michael
2014 Aug 18 3:15 PM
Hi Michael,
If you are on ABAP 7.4 then use MOVE-CORRESPONDING itab1 TO itab2.
Thanks,
Sharath
2014 Aug 18 3:15 PM
Hi Michael,
If you are on ABAP 7.4 then use MOVE-CORRESPONDING itab1 TO itab2.
Thanks,
Sharath
2014 Aug 18 3:29 PM
Hey Sharath,
thank you for your answer! Unfortunately I don't have a 7.4 system here, but your example pointed out, that I can also use move-corresponding from one structure to the other, which I thought, was not possible. I'm trying out, if this makes it faster now.
I'll let you all know, if this made the deal.
Thank you & best regards,
Michael & Arne
2014 Aug 18 4:32 PM
Hi Sharath,
MOVE-CORRESPONDING helped a lot, even I could not use it for whole tables.
Thank you very much!
Michael & Arne