Accelerated LOOP

Using "LOOP AT itab ASSIGNING ." instead of a work area you avoid data transport into the work area.

Using "LOOP AT itab ASSIGNING ." instead of using a work area (either explicit or via header line) you avoid data transport into the work area. The field symbol is a pointer into(!) the table so that you can modify the table line directly; you don't need MODIFY thus avoiding another data transport.
report z.
types: begin of rec_type,
       count type i,
       string(1024) type c,
       end   of rec_type.
types  tab_type type rec_type occurs 0.
data   itab type tab_type.
data   wa   type rec_type.
field-symbols 
  
    type rec_type.
do 1000 times.
   append wa to itab.
enddo.
loop at itab assigning 
   
    . " pointer
   
    
     -count = sy-tabix. " modify itab
   
     
      -string = 'x'. " without MODIFY
endloop.

     
    
   
  
This was first published in December 2001

Dig deeper on SAP ABAP

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchManufacturingERP

SearchOracle

SearchDataManagement

SearchAWS

SearchBusinessAnalytics

SearchCRM

SearchContentManagement

SearchFinancialApplications

Close