<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Can we use substring function in CDS view where clause in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-substring-function-in-cds-view-where-clause/m-p/12326678#M1991393</link>
    <description>&lt;P&gt;Hi &lt;SPAN class="mention-scrubbed"&gt;husainsd&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;please check below code you can able to understand,&lt;/P&gt;&lt;P&gt;define view ZK_I_DATE_FUNC as select from ZK_I_DATE_FUNCTIONS &lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;
    Id,&lt;/P&gt;&lt;P&gt;
    Name, &lt;/P&gt;&lt;P&gt;    StartDate, &lt;/P&gt;&lt;P&gt;    EndDate,&lt;/P&gt;&lt;P&gt;
    //date functions &lt;/P&gt;&lt;P&gt; DATs_is_valid(StartDate) as s_Date1,&lt;/P&gt;&lt;P&gt;
 dats_is_valid(EndDate) as e_Date1, &lt;/P&gt;&lt;P&gt;  dats_days_between(StartDate, EndDate) as betweenS, &lt;/P&gt;&lt;P&gt; dats_add_days(StartDate, 7, 'NULL') as ad_days, &lt;/P&gt;&lt;P&gt;  dats_add_months(StartDate, 2, 'FAIL') as ADD_MONTHS, &lt;/P&gt;&lt;P&gt;  DATS_ADD_DAYS(StartDate, 4, 'INITIAL')   as option4, &lt;/P&gt;&lt;P&gt;  DATS_ADD_DAYS(StartDate, 2, 'UNCHANGED') as option5&lt;/P&gt;&lt;P&gt;
}  where StartDate = $session.system_date&lt;/P&gt;</description>
    <pubDate>Thu, 17 Dec 2020 03:38:07 GMT</pubDate>
    <dc:creator>former_member689077</dc:creator>
    <dc:date>2020-12-17T03:38:07Z</dc:date>
    <item>
      <title>Can we use substring function in CDS view where clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-substring-function-in-cds-view-where-clause/m-p/12326677#M1991392</link>
      <description>&lt;P&gt;My requirement is to fetch the current year by using the system date variable in the CDS view.&lt;/P&gt;
  &lt;P&gt;I am using the substring function along with $session.system_date field in the where clause but it is not allowing me to use it.&lt;/P&gt;
  &lt;P&gt;Can someone guide me on how to use it in the where clause?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2020 22:22:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-substring-function-in-cds-view-where-clause/m-p/12326677#M1991392</guid>
      <dc:creator>Husain</dc:creator>
      <dc:date>2020-12-16T22:22:19Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use substring function in CDS view where clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-substring-function-in-cds-view-where-clause/m-p/12326678#M1991393</link>
      <description>&lt;P&gt;Hi &lt;SPAN class="mention-scrubbed"&gt;husainsd&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;please check below code you can able to understand,&lt;/P&gt;&lt;P&gt;define view ZK_I_DATE_FUNC as select from ZK_I_DATE_FUNCTIONS &lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;
    Id,&lt;/P&gt;&lt;P&gt;
    Name, &lt;/P&gt;&lt;P&gt;    StartDate, &lt;/P&gt;&lt;P&gt;    EndDate,&lt;/P&gt;&lt;P&gt;
    //date functions &lt;/P&gt;&lt;P&gt; DATs_is_valid(StartDate) as s_Date1,&lt;/P&gt;&lt;P&gt;
 dats_is_valid(EndDate) as e_Date1, &lt;/P&gt;&lt;P&gt;  dats_days_between(StartDate, EndDate) as betweenS, &lt;/P&gt;&lt;P&gt; dats_add_days(StartDate, 7, 'NULL') as ad_days, &lt;/P&gt;&lt;P&gt;  dats_add_months(StartDate, 2, 'FAIL') as ADD_MONTHS, &lt;/P&gt;&lt;P&gt;  DATS_ADD_DAYS(StartDate, 4, 'INITIAL')   as option4, &lt;/P&gt;&lt;P&gt;  DATS_ADD_DAYS(StartDate, 2, 'UNCHANGED') as option5&lt;/P&gt;&lt;P&gt;
}  where StartDate = $session.system_date&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2020 03:38:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-substring-function-in-cds-view-where-clause/m-p/12326678#M1991393</guid>
      <dc:creator>former_member689077</dc:creator>
      <dc:date>2020-12-17T03:38:07Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use substring function in CDS view where clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-substring-function-in-cds-view-where-clause/m-p/12326679#M1991394</link>
      <description>&lt;P&gt;Hi Kiran,&lt;/P&gt;&lt;P&gt;I need to extract the current year from the system.date. In the where clause something like&lt;/P&gt;&lt;P&gt;year= system.date+4?&lt;/P&gt;&lt;P&gt;Can we do this?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2020 17:44:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-substring-function-in-cds-view-where-clause/m-p/12326679#M1991394</guid>
      <dc:creator>Husain</dc:creator>
      <dc:date>2020-12-17T17:44:57Z</dc:date>
    </item>
  </channel>
</rss>

