title: Comparing date with a date range in two tables
body: <p>I am trying to change another table using a table. I need to work with a table (we call it tab1) that uses a fixed date (workdate). The other table (tab2) uses a time range in two table entries (startdate and enddate).</p>
  <p>I want to use tab1 to check if the entry in tab2 exists based on the dates. Then change the status of tab1 if it does not exist in tab2.</p>
  <p>My idea was to use a LOOP AT outside of a READ TABLE, but im missing something important.</p>
  <p>Regards Sruscht</p>
  <p>EDIT: Sorry, that i wasnt clear with my question. Here is my code, which i tried once, but it set all status on delete.</p>
  <pre><code>LOOP AT lt_tab1 ASSIGNING &lt;fs_tab1&gt;
    WHERE workdate GE lt_tab2-enddate
    AND  workdate LE lt_tab2-startdate.
  
    ENDLOOP.
  
   IF sy-subrc NE 0.
  &quot;set lt_tab1-status on delete
    ENDIF.
  </code></pre>
  <p>If entries are deleted in table tab2, they are not changed in table tab1. In other words, tab1 is not updated.
  The status in tab1 must then be changed so that the system is not displayed in other programs and/or applications.As already mentioned, tab1 uses a fixed date and tab2 uses a time range, which is described as start and end date.</p>
  <p>My idea is to go through itab1 and look for the entry in itab2. If the entry is not in itab2, then the status of itab1 is changed.</p>
  <p>Sorry that the question is so long, but I have big problems with this case.</p>
  <p>The important thing I was talking about was the solution.</p>