Problem solve Get help with specific problems with your technologies, process and projects.

Fetching data from external tables

Using 'For all entries in Itab' option with Select statement rather than using loop endloop option.

If we have selected some data into an internal table and now we 
have to fetch more data from other tables based on the entries in 
internal table, it's always advisable to use 'For all entries in Itab' 
option with Select statement rather than using loop endloop option.
****
And we should try to directly fetch data in internal table rather 
than fetching in a variable and then moving this variable into 
internal table.

data: begin of itab occurs 1000.
       equnr like v_equi-equnr.      
data: end of itab.

data: begin of itab2 occurs 1000.
       tplnr like v_equi-tplnr.
data: end of itab2.
*****
With out For all Entries option
******

Select equnr from afih into table itab where aufnr > '100000'.

loop at itab.
 select tplnr from v_equi where
         equnr = itab-equnr.
   itab2-tplne = v_equi-tplnr.
   append itab2.
   clear itab2.
 endselect.
endloop.

******
Now using 'For all entries option'

Select tplnr into table itab2 from v_equi for all entries in itab where]
   equnr = itab-equnr.

Here data will be fetched in single shot and communication server 
will be reduced which in turn will improve 
performance of the code.
********** 
  
  
This was last published in January 2002

Dig Deeper on SAP ABAP

PRO+

Content

Find more PRO+ content and other member only offers, here.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchManufacturingERP

SearchOracle

SearchDataManagement

SearchAWS

SearchBusinessAnalytics

SearchCRM

SearchContentManagement

SearchFinancialApplications

Close