title: Error DBIF_RSQL_INVALID_RSQL CX_SY_OPEN_SQL_DB in program
body: <p>I get the following error: DBIF_RSQL_INVALID_RSQL CX_SY_OPEN_SQL_DB (Open SQL command is too big. Condition WHERE of the Open SQL command contains too many conditions). The error points to the following line:</p>
  
  <pre><code>select * from Z3T_MAILS into table t_full_mail UP TO 250 ROWS where ID in r_mid  and (p_dat_clause).
  </code></pre>
  
  <p>Other parts of code:</p>
  
  <pre><code>    DATA: p_dat_clause type STRING,
      t_full_mail type Z3TT_MAILS,
      r_mid       type range of Z3E_MAIL_ID.
  
   &lt;...&gt;
  
    if not NOT_READED is initial.
      p_clause = 'ISREAD = '''''.
    endif.
  
    if DATETO is initial.
      p_dateto = DATEFROM.
    else.
      p_dateto = DATETO.
    endif.
    if not DATEFROM is initial or not DATETO is initial.
      concatenate 'SEND_DATE &gt;= ''' DATEFROM  ''' and SEND_DATE &lt;= ''' p_dateto '''' into p_dat_clause.
    endif.
  
      &lt;...&gt;
  
        if MAILS is supplied  or  BODY is supplied  or  p_dat_clause ne ''.
          if not r_mid[] is initial.
            select * from Z3T_MAILS into table t_full_mail UP TO 250 ROWS where ID in r_mid  and (p_dat_clause).
          endif.
        endif.
  </code></pre>
  
  <p>I am new to ABAP and would appreciate any help!</p>