title: How to delete DDIC table records which have different id than row number in internal table?
body: <p>I have an ALV with two rows. I want to delete these rows in internal table and dictionary table also. To get which rows in alv i chose, i use a method</p>
  
  <pre><code>go_selections = go_salv-&gt;get_selections( ).
  go_rows = go_selections-&gt;get_selected_rows( )
  </code></pre>
  
  <p>Nextly, i am iterating through results <code>LOOP AT go_rows INTO gv_row.</code></p>
  
  <p>Inside above loop I have an another loop, which stores data from internal table into workarea. Then, i set the counter variable which holds the id of the dictionary table and delete respective row.</p>
  
  <pre><code>LOOP AT gr_data INTO lr_znewfdkey6.
       counter2 = lr_znewfdkey6-id.
                IF counter2 EQ gv_row.
                  DELETE FROM znew_fdkey01 WHERE id EQ lr_znewfdkey6-id.
                  MESSAGE 'Row deleted .' TYPE 'I'.
  
  </code></pre>
  
  <p>But unfortunately this works only when id of the dictionary table is equal to row number selected in alv. If I have <code>lr_znewfdkey6-id</code> in dictionary table, equal to for example 5, <strong>get_selected_rows( )</strong> returns value started by one etc., and this will cause inequality. </p>
  
  <p>How to fix this?</p>