title: I don't understand how READ TABLE inside LOOP works
body: <p>In my code I need to iterate inside a loop, and for each iteration in the loop I have to fill in the data whose values ​​are different in certain cells.</p>
  <p>Reading the sap documentation I have come to the conclusion that what I need is to use a read table to fill for each iteration into a working area that later I'll treat.</p>
  <p>I have declarated the following tables:</p>
  <ul>
  <li><p><em>it_sap</em> with the content of a join from VBRK and VBRP tables</p>
  </li>
  <li><p><em>wa_sap</em> as working area</p>
  </li>
  <li><p><em>it_ext</em> with content from an another join from an external database</p>
  </li>
  <li><p><em>wa_ext</em> as working area.</p>
  </li>
  </ul>
  <p>This is how my loop looks actually like:</p>
  <pre><code>
    LOOP AT it_sap INTO wa_sap.
  
      wa_sap-tipo_documento = wa_sap-xblnr+2(1). &quot; Linea
  
      tiket = wa_sap-xblnr+9(7).
      creationyear = wa_sap-fkdat+0(4).
  
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT' 
        EXPORTING
          input  = tiket
        IMPORTING
          output = tiket.
  
      CONCATENATE creationyear '/' wa_sap-vkorg wa_sap-xblnr+7(2) '/' tiket INTO wa_sap-codalb.
  
      &quot;CLEAR position.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
        EXPORTING
          input  = wa_sap-posnr
        IMPORTING
          output = position.
  
      READ TABLE it_ext INTO wa_ext
      WITH KEY codalb = wa_ext-codalb
               tipo_documento = wa_ext-tipo_documento.
  
      IF sy-subrc = 0.
        wa_sap-import_total = wa_ext-import_total.
        wa_sap-import = wa_ext-import.
        wa_sap-price = wa_ext-price.
        wa_sap-price_total = wa_ext-price_total.
        wa_sap-disccount = wa_ext-disccount.
        wa_sap-quantity = wa_ext-quantity.
  
        MODIFY it_sap FROM wa_sap.
  
        IF wa_sap-importe_total &lt;&gt; wa_sap-netwr. &quot;AND position = 1 .
          APPEND wa_sap TO it_results.
        ENDIF.
  
      ENDIF.
  
    ENDLOOP.
  
  </code></pre>
  <p>How does it work? I understand that by using the conditional <code>sy-subrc = 0</code> I can see if the previous statement gives true or false but <strong>I don't quite understand how it works by using <code>READ</code> instead <code>SELECT</code> steament</strong>.</p>
  <p>Thank you guys!</p>