Hi All,
I have a Huge Internal Table with several columns and would like to get Just two columns from it to another internal table that has just two columns.
Something like this:
Table A; Fld1 Fld2 Fld3 Fld4 1 11 21 31 2 12 22 32 3 13 23 33 4 14 24 34 5 15 25 35 6 16 26 36
And the resulting second table after the move.
Table B; Fld1 Fld2 1 11 2 12 3 13 4 14 5 15 6 16
But as the Table A is huge with about a 100,000 records; Looping through takes up a lot of resources. And
TableA[] = TableB[] doesn't work for me as the Flds have a different structure in the two tables.
Is there any other way to get around this.?
Thanks in advance..!
Jr
I guess you have to loop it .there is no other way.
Anyway, you must have already looped some other table when you have built the first table. Populate the second table as well in the same step.
regards,
ravi
Hi jr,
1. It can be done.
2. Provided the following simple things are fulfilled.
a) Table A should have also have
FIELD1, FIELD2 (of internal table B)
As the FIRST TWO FIELDS (Starting from Left)
3. Then
tableb[] = tablea[]
will work PERFECTLY FINE.
4. To get a taste of it, just copy paste
5.
report abc.
data : t001 like t001 occurs 0 with header line.
data : begin of itab occurs 0,
mandt like t001-mandt,
bukrs like t001-bukrs,
end of itab.
*-------
select * from t001
into table t001.
itab[] = t001[].
break-point.
regards,
amit m.
HI
Try out this code. Its working fine.
Data : begin of it_vbak occurs 0,
vbeln like vbak-vbeln,
ernam like vbak-ernam,
end of it_vbak.
Data : begin of it_final occurs 0,
vbeln like vbak-vbeln,
end of it_final.
select vbeln ernam from vbak into table it_vbak.
it_final[] = it_vbak[].
loop at it_final.
write:/ it_final-vbeln.
endloop.
Regards
Haritha
Add a comment