title: Calculated date in WHERE condition of CDS view
body: <p>I'm trying to get a list of valid system status for the notification object, in order to not check all the notifications in the table, I want to execute the selection by checking only the last 2 years of data.</p>
  
  <p>Maybe there is a better solution to my problem, but I'm still curious about this technical limitation. To my knowledge, the system status in SAP are kind of hardcoded and can't be determined per object via any table (SAP could add new system status any moment).</p>
  
  <p>I tried to create the below CDS view, but the function <code>dats_add_months</code> can't be used in the where condition, is there a solution to that? Notice that 7.50 doesn't have session parameter for system date so I use an environment variable:</p>
  
  <pre><code>define view ZNOTIF_SYS_STATUS 
      with parameters sydat : abap.dats @&lt;Environment.systemField: #SYSTEM_DATE
      as select distinct from qmel as notif
      inner join jest as notif_status on notif_status.objnr = notif.objnr
                                     and notif_status.inact = ''
      inner join tj02t as sys_status on sys_status.istat = notif_status.stat
                                    and sys_status.spras = $session.system_language
  {
      key sys_status.txt04 as statusID,
          sys_status.txt30 as description
  } where notif.erdat &gt; dats_add_months($parameters.sydat, -12, '') //THIS CAN'T BE USED!!
  </code></pre>