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

question regarding all entries

Former Member
0 Likes
408
 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

2 REPLIES 2
Read only

arul_murugan
Active Participant
0 Likes
370

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

Read only

ThomasZloch
Active Contributor
0 Likes
370

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