‎2008 Mar 05 11:30 AM
Hi,
following is my select query. I dont want the select query inside the loop. Please tell me how can i do this.
loop at gt_tvrot.
select tvro~route
tvro~trazt
tvro~traztd
tvro~tdvzt
tvro~tdvztd
tvro~tdvznd
tvro~fahztd
tvro~distz
tvro~medst
tvrot~bezei
appending table gt_tvro
from tvro join tvrot
on tvroroute eq tvrotroute
where tvrot~spras eq sy-langu
Thanks.
and tvro~route eq gt_tvrot-route.
endloop.
‎2008 Mar 05 11:43 AM
Hi
Use the below code
select tvro~route
tvro~trazt
tvro~traztd
tvro~tdvzt
tvro~tdvztd
tvro~tdvznd
tvro~fahztd
tvro~distz
tvro~medst
tvrot~bezei
appending table gt_tvro
*for all entries of gttvrot*_
from tvro join tvrot
on tvroroute eq tvrotroute
where tvrot~spras eq sy-langu
and tvro~route eq gt_tvrot-route.
If you want further clarity on this, got to SE30, Press TIPS and TRICKS push button on the application tool bar. This will help you a lot.
BR
Sree
‎2008 Mar 05 11:48 AM
HI,
I didn't get ur answer can u please clarify. i dont want to write the select query inside the loop.
Thanks
‎2008 Mar 05 11:54 AM
Yes if you use "for all entries" then you can write the select query outside the loop.
Please read the related documentation for the "for all entries"
key word. there you can find some examples also.
BR
Sree
‎2008 Mar 05 11:55 AM
Hi Ramya,
Instead of using LOOP..ENDLOOP se FOR ALL ENTRIES with select query as told above.
Regards,
Atish
‎2008 Mar 05 7:46 PM
hi
For all entries will join the internal tables on a select statement.
but at least one entry should be in itab else select wont take the joining itab.
regards
Jose
‎2008 Mar 06 3:58 AM
‎2008 Mar 06 4:22 AM
Hi,
You can use for all entries as mentioned above. You need to check if there are any entries in the table mentioned in for all entries. If it is initial the query might give a dump.
‎2008 Mar 06 4:58 AM
hi,
Use For ALL Entries Keyword.
But Keep In Mind That .
Check That First Table Contains Data and Use Where Condition.