‎2007 Jul 10 11:35 AM
HI...
Is there any problem if in put the select statement in loop like this.
loop at itab.
select * from .......
endloop.
‎2007 Jul 10 11:37 AM
Hi,
This would delay the programming time. It would take more time for the execution of the logic. so it is always better to avoid Select within a loop.
<b>Reward points if this helps,</b>
Kiran
‎2007 Jul 10 11:37 AM
Hi,
We can't use Select for the Internal Tables.
Regards,
Padmam.
‎2007 Jul 10 11:37 AM
hi,
We can display the data only by writing in the loop.
We cannot retrieve the data inside the loop because it gets repeated.
‎2007 Jul 10 11:37 AM
Hi,
This would delay the programming time. It would take more time for the execution of the logic. so it is always better to avoid Select within a loop.
<b>Reward points if this helps,</b>
Kiran
‎2007 Jul 10 11:40 AM
Hi,
It is possible to do this
loop at itab.
select * from ekpo into table another_itab.
endloop.
But this will give you performance problem as you select from database as many as the loop operation.
‎2007 Jul 10 11:40 AM
performance will not be good else you can use select * from dbtab inside the loop.
better to use for all entrines and then read the int table inside the loop.
for e.g.
select f1 f2 from dbtab into table itab1 for all entries in itab where....
loop at itab.
read table itab1 with key f1 = itab-f1.
if sy-subrc = 0.
<access itab1-f2...>
endif.
endloop.
regards
shiba dutta
‎2007 Jul 10 11:41 AM
Hi,
That will take more time to execute.we have to avoid select query in loops.
so you can use for all entries instead of writing a select query in the loop.
Thanks & Regards,
CS Reddy.