‎2007 Oct 29 6:33 AM
Just check the 2 select statements below.
1.select * from lfa1 into table itab where .....
2.select * from lfa1 into itab where .....
append itab.
endselect.
In the both cases which one is preferrablein terms of performance and what is the Reason for that.
‎2007 Oct 29 6:35 AM
Hi Sandeep,
the first 1 is good.
Bcoz the second one puts a hit on the database table in a loop.
thus reducing the performance timing.
Awrd points if found useful
‎2007 Oct 29 6:35 AM
Hi Sandeep,
the first 1 is good.
Bcoz the second one puts a hit on the database table in a loop.
thus reducing the performance timing.
Awrd points if found useful
‎2007 Oct 29 6:35 AM
First one.
Since in second, the Database hit each and everytime. It's like writing a select query in a loop.
Regards
Nishant
‎2007 Oct 29 6:44 AM
hi ,
<b>Statement 1.</b>
Based on the where condition , records from LFA1 table will be retrieved and saved to the internal table directly in a single process. In this case database hit is very less , we can say a single hit.
<b>
Statement 2.</b>
The controls checks each and every record based on the where condition . If the record found , it goes inside the loop and append to the internal table.
Here the database hits are more . Also the append statement on each sucessful conditions decrease the performance.
Conclusion :
Its better to use "into table" , ie the statement 1.
Have a nice day.
Regards
Meikandan.
‎2007 Oct 29 7:13 AM
hi sandeep,
the first one is a better option to use because if the where condition is matched it directly get's all the values from lfa1 to itab but in the second case the query is executed every time the where condition is true it fetches from the db and appends it to the internal table.
so in the second case the performance is not as gud as in the 1st case.
regards,
sohi