2010 May 24 11:26 AM
code 1 Loop at int_cntry.
Select single * from zfligh into int_fligh
where cntry = int_cntry-cntry.
Append int_fligh.
Endloop.
code2 Select * from zfligh appending table int_fligh
For all entries in int_cntry
Where cntry = int_cntry-cntry.
Hello Expert i am new to sap abap i need your help regarding all entries . it is not a good idea to write select query inside a loop. code 2 will show better performance than the code one because it fetches data from database in a one go but i want to know more details about all entries .if you know more please help
Thanks in advance
Chitta Ranjan Mahato
Edited by: Mahatoji on May 24, 2010 12:32 PM
code 1 Loop at int_cntry.
Select single * from zfligh into int_fligh
where cntry = int_cntry-cntry.
Append int_fligh.
Endloop.
code2 Select * from zfligh appending table int_fligh
For all entries in int_cntry
Where cntry = int_cntry-cntry.
Hello Expert i am new to sap abap i need your help regarding all entries . it is not a good idea to write select query inside a loop. code 2 will show better performance than the code one because it fetches data from database in a one go but i want to know more details about all entries .if you know more please help
Thanks in advance
Chitta Ranjan Mahato
Edited by: Mahatoji on May 24, 2010 12:32 PM
2010 May 24 11:51 AM
HI,
its better to go for For all entries based on the performance. It will fetch the records based on the entries available in the first table. But before going for For all entries, check the first internal table with not initial, if there is no records in the first internal table then it will fetch all the records into the second internal table.
<removed by moderator>
Thanks
Arul
Edited by: Thomas Zloch on May 24, 2010 6:01 PM
2010 May 24 5:02 PM
Please look around in the ABAP performance forum, especially the sticky notes there.
Always search for existing information before starting a new thread.
Thread locked.
Thomas