<?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>Question Re: SAP CDS Parameter without leading zero in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/sap-cds-parameter-without-leading-zero/qaa-p/12505647#M4686641</link>
    <description>&lt;P&gt;maybe it is because of your HANA version because when running the following statement on my system that 2.0 SPS05, it is working fine.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select ltrim('000111','0') from dummy
where ltrim('000111','0') = '111'&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2031536-capture-decran-2022-03-11-092647.jpg" /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 11 Mar 2022 08:27:45 GMT</pubDate>
    <dc:creator>Cocquerel</dc:creator>
    <dc:date>2022-03-11T08:27:45Z</dc:date>
    <item>
      <title>SAP CDS Parameter without leading zero</title>
      <link>https://community.sap.com/t5/technology-q-a/sap-cds-parameter-without-leading-zero/qaq-p/12505644</link>
      <description>&lt;P&gt;Hello Guys, &lt;/P&gt;
  &lt;P&gt;I have a question about the use of parameters in my CDS Code. &lt;/P&gt;
  &lt;P&gt;For example I'm want to search via parameter a specific material. &lt;/P&gt;
  &lt;P&gt;In our DB all material have leading zeros.&lt;/P&gt;
  &lt;P&gt;But I want to enter the materialnummer without the leading zero. &lt;/P&gt;
  &lt;P&gt;Down you can see my code, hava you idea/tip how I can solve this problem?&lt;/P&gt;
  &lt;P&gt;Regads &lt;/P&gt;
  &lt;P&gt;Hassin&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;@AbapCatalog.sqlViewName: 'ZCS_MARA_PARA'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'VDS View with Parameter'

define view ZCS_MARA_Test1_PARA
    with parameters p_matnr : matnr, p_ernam : ernam
as select from ZCP_MARAView_Test1 

{
    //ZCP_MARAView_Test1
    ltrim(matnr,'0')    as Materialnummer,
    ersda               as Angelegt_Am,
    ernam               as Angelegt_Von,
    laeda               as Geaedert_Am,
    aenam               as Geaendert_Von
}
where   matnr = :p_matnr
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Mar 2022 11:38:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sap-cds-parameter-without-leading-zero/qaq-p/12505644</guid>
      <dc:creator>hassin</dc:creator>
      <dc:date>2022-03-07T11:38:10Z</dc:date>
    </item>
    <item>
      <title>Re: SAP CDS Parameter without leading zero</title>
      <link>https://community.sap.com/t5/technology-q-a/sap-cds-parameter-without-leading-zero/qaa-p/12505645#M4686639</link>
      <description>&lt;P&gt;Would changing the WHERE clause this way fit your requirement ?&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;where ltrim(matnr,'0') = :p_matnr&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Mar 2022 12:28:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sap-cds-parameter-without-leading-zero/qaa-p/12505645#M4686639</guid>
      <dc:creator>Cocquerel</dc:creator>
      <dc:date>2022-03-07T12:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: SAP CDS Parameter without leading zero</title>
      <link>https://community.sap.com/t5/technology-q-a/sap-cds-parameter-without-leading-zero/qaa-p/12505646#M4686640</link>
      <description>&lt;P&gt;It would fit my requirement but I get an error.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;User-defined functions are not supported in the WHERE clause&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 13:06:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sap-cds-parameter-without-leading-zero/qaa-p/12505646#M4686640</guid>
      <dc:creator>hassin</dc:creator>
      <dc:date>2022-03-07T13:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: SAP CDS Parameter without leading zero</title>
      <link>https://community.sap.com/t5/technology-q-a/sap-cds-parameter-without-leading-zero/qaa-p/12505647#M4686641</link>
      <description>&lt;P&gt;maybe it is because of your HANA version because when running the following statement on my system that 2.0 SPS05, it is working fine.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select ltrim('000111','0') from dummy
where ltrim('000111','0') = '111'&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2031536-capture-decran-2022-03-11-092647.jpg" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 08:27:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sap-cds-parameter-without-leading-zero/qaa-p/12505647#M4686641</guid>
      <dc:creator>Cocquerel</dc:creator>
      <dc:date>2022-03-11T08:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: SAP CDS Parameter without leading zero</title>
      <link>https://community.sap.com/t5/technology-q-a/sap-cds-parameter-without-leading-zero/qaa-p/12505648#M4686642</link>
      <description>&lt;P&gt;To solve this issue you have to use "ltrim(matnr,'0') as Matnr_Test" one view before.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 08:39:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sap-cds-parameter-without-leading-zero/qaa-p/12505648#M4686642</guid>
      <dc:creator>hassin</dc:creator>
      <dc:date>2022-10-12T08:39:37Z</dc:date>
    </item>
  </channel>
</rss>

