Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Performance Issue

Former Member
0 Likes
778

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
761

Interview?

Rob

7 REPLIES 7
Read only

Former Member
0 Likes
761

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.

Read only

Former Member
0 Likes
761

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

Read only

shimon_tal
Advisor
Advisor
0 Likes
761

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

Read only

Former Member
0 Likes
762

Interview?

Rob

Read only

0 Likes
761

nope, seems more like a written test, so might be certification

Read only

0 Likes
761

It seems very similar to another question by another(?) individual.

Rob

Read only

Former Member
0 Likes
761

Correct.

Rather avoid Ferry Latino and Cosmo Kramer until he / she gets his / her act together, as per the forum rules.

Cheers,

Julius