 <p>Instead of using <code>MODIFY</code>, use a field symbol:</p> <pre><code>DATA: lt_materials TYPE TABLE OF zzllog. FIELD-SYMBOLS: &lt;ls_line&gt; TYPE zzllog. * other code with strange comments :-) LOOP AT lt_materials ASSIGNING &lt;ls_line&gt; WHERE matnr IS INITIAL. SELECT SINGLE MATNR FROM zlldet INTO &lt;ls_line&gt;-matnr WHERE palet = &lt;ls_line&gt;-palet. ENDLOOP. </code></pre> <p>This is just an example for the correct syntax. It's not a good idea to do this in a real program because there's a fair chance thtat you'll be hitting the database with thousands of requests, and potentially draw quite a bit of performance. It'd be better to preselect the <code>PALET</code> numbers that have no <code>MATNR</code> into a separate table and then use <code>FOR ALL ENTRIES IN</code> to read all the <code>MATNR</code>s in a single query.</p> <p>EDIT: Added type names. BTW, your way of declaring the internal table is somewhat outdated...</p>