‎2008 Nov 01 1:40 PM
HI,
Which of the following is the fastest way to fill an internal table of the structure above.
a) select field1 field2 into (itab-field1, itab-field2)
from ztable where field1 = '10'.
Append itab.
Endselect.
b) select * from ztable
where field1 = '10'.
Move ztable to wa.
Append itab from wa.
Endselect.
c) select * into corresponding-fields of itab
from ztable where field1 = '10'.
d) select * from ztable
where field1 = '10'.
Append itab.
Endselect.
e) select * into table itab from ztable
where field1 = '10'.Regards
‎2008 Nov 01 6:30 PM
‎2008 Nov 01 2:18 PM
hi,
if u have only two fields, then use following code.
select field1 field2 into
(itab-field1, itab-field2)
from ztable where field1 = '10'.
Append itab.
Endselect.
‎2008 Nov 01 2:30 PM
i feel you can go with E option only because you are using single select statement.
Also you can compare statements only when you have same requirement.
A,B,D have got additional statements like move append it will take definitely longer time . C will take more time than E as you are using into corresponding fields
‎2008 Nov 01 3:39 PM
HI Ferry ,
My opinion is E , because u HIT the Database just one time ,
insted of doing loop (a,b,d).
C take more then D because the corresponding.
Regards
‎2008 Nov 01 6:30 PM
‎2008 Nov 01 6:33 PM
nope, seems more like a written test, so might be certification
‎2008 Nov 01 6:39 PM
It seems very similar to another question by another(?) individual.
Rob
‎2008 Nov 01 7:33 PM
Correct.
Rather avoid Ferry Latino and Cosmo Kramer until he / she gets his / her act together, as per the forum rules.
Cheers,
Julius