<?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: Function SUBSTRING: parameter at position 1 has incorrect data type LCHR - CDS view in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/function-substring-parameter-at-position-1-has-incorrect-data-type-lchr-cds/qaa-p/11947280#M4490428</link>
    <description>&lt;P&gt;Hi Praveen,&lt;/P&gt;&lt;P&gt;This can be achieved with the help of table function.&lt;/P&gt;&lt;P&gt;As per SAP
documentation we cannot use LCHR in cast function (ABAP CDS limitation).&lt;/P&gt;&lt;P&gt;&lt;A href="https://launchpad.support.sap.com/#/notes/0002752176"&gt;https://launchpad.support.sap.com/#/notes/0002752176&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I would definitely suggest trying table function to address this issue.
We can use substr in the method.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;return select A.mandt,
    A.docnum,
    A.idoctp,
    A.mestyp,
    B.dtint2,
    B.sdata,
    substr(B.sdata, 1,10 )  as SubStringData from  edidc A
left outer join edid4 B on A.docnum = B.docnum
and A.idoctp = B.segnam&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; Hope this help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Sep 2019 12:02:58 GMT</pubDate>
    <dc:creator>MisaqTonse</dc:creator>
    <dc:date>2019-09-24T12:02:58Z</dc:date>
    <item>
      <title>Function SUBSTRING: parameter at position 1 has incorrect data type LCHR - CDS view</title>
      <link>https://community.sap.com/t5/technology-q-a/function-substring-parameter-at-position-1-has-incorrect-data-type-lchr-cds/qaq-p/11947278</link>
      <description>&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1676591-2019-04-29-17h51-42.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1676590-2019-04-29-17h49-22.png" /&gt;&lt;/P&gt;
  &lt;P&gt;Dear,&lt;/P&gt;
  &lt;P&gt;I would like to fetch the first 10 values from the field edid4.sdata from the segment &lt;/P&gt;
  &lt;P&gt;where b.segnam = 'E1BPMEPOHEADER' and a.mestyp = 'PORDCR1'&lt;/P&gt;
  &lt;P&gt;Getting an error message "Function SUBSTRING: parameter at position 1 has incorrect data type LCHR"&lt;/P&gt;
  &lt;P&gt;Can you please advice "how to extract the values from the sdata of EDID4 table with LCHAR.&lt;/P&gt;
  &lt;P&gt;Regards&lt;/P&gt;
  &lt;P&gt;Praveen G.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2019 08:55:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-substring-parameter-at-position-1-has-incorrect-data-type-lchr-cds/qaq-p/11947278</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-04-29T08:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Function SUBSTRING: parameter at position 1 has incorrect data type LCHR - CDS view</title>
      <link>https://community.sap.com/t5/technology-q-a/function-substring-parameter-at-position-1-has-incorrect-data-type-lchr-cds/qaa-p/11947279#M4490427</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Can you use CAST SQL operation and convert the LCHR type to a String value and then try to use Substring operation ?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sijin&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2019 13:28:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-substring-parameter-at-position-1-has-incorrect-data-type-lchr-cds/qaa-p/11947279#M4490427</guid>
      <dc:creator>Sijin_Chandran</dc:creator>
      <dc:date>2019-05-06T13:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: Function SUBSTRING: parameter at position 1 has incorrect data type LCHR - CDS view</title>
      <link>https://community.sap.com/t5/technology-q-a/function-substring-parameter-at-position-1-has-incorrect-data-type-lchr-cds/qaa-p/11947280#M4490428</link>
      <description>&lt;P&gt;Hi Praveen,&lt;/P&gt;&lt;P&gt;This can be achieved with the help of table function.&lt;/P&gt;&lt;P&gt;As per SAP
documentation we cannot use LCHR in cast function (ABAP CDS limitation).&lt;/P&gt;&lt;P&gt;&lt;A href="https://launchpad.support.sap.com/#/notes/0002752176"&gt;https://launchpad.support.sap.com/#/notes/0002752176&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I would definitely suggest trying table function to address this issue.
We can use substr in the method.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;return select A.mandt,
    A.docnum,
    A.idoctp,
    A.mestyp,
    B.dtint2,
    B.sdata,
    substr(B.sdata, 1,10 )  as SubStringData from  edidc A
left outer join edid4 B on A.docnum = B.docnum
and A.idoctp = B.segnam&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; Hope this help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 12:02:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-substring-parameter-at-position-1-has-incorrect-data-type-lchr-cds/qaa-p/11947280#M4490428</guid>
      <dc:creator>MisaqTonse</dc:creator>
      <dc:date>2019-09-24T12:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: Function SUBSTRING: parameter at position 1 has incorrect data type LCHR - CDS view</title>
      <link>https://community.sap.com/t5/technology-q-a/function-substring-parameter-at-position-1-has-incorrect-data-type-lchr-cds/qaa-p/11947281#M4490429</link>
      <description>&lt;P&gt;Use below code&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;substring(cast(B.sdata as abap.char( 1000 )), 1,10) as ApplicationData&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Sep 2019 13:26:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-substring-parameter-at-position-1-has-incorrect-data-type-lchr-cds/qaa-p/11947281#M4490429</guid>
      <dc:creator>shanthi_bhaskar</dc:creator>
      <dc:date>2019-09-24T13:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: Function SUBSTRING: parameter at position 1 has incorrect data type LCHR - CDS view</title>
      <link>https://community.sap.com/t5/technology-q-a/function-substring-parameter-at-position-1-has-incorrect-data-type-lchr-cds/qaa-p/11947282#M4490430</link>
      <description>&lt;P&gt;  &lt;SPAN class="mention-scrubbed"&gt;shanthi.bhaskar&lt;/SPAN&gt; CAST is not supported for the type LCHAR.&lt;/P&gt;&lt;P&gt;I am on "SAP_ABA - Release 740 and SP-Level 0017", Does it support in any further releases.  &lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 14:15:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-substring-parameter-at-position-1-has-incorrect-data-type-lchr-cds/qaa-p/11947282#M4490430</guid>
      <dc:creator>srikanthnalluri</dc:creator>
      <dc:date>2019-09-24T14:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: Function SUBSTRING: parameter at position 1 has incorrect data type LCHR - CDS view</title>
      <link>https://community.sap.com/t5/technology-q-a/function-substring-parameter-at-position-1-has-incorrect-data-type-lchr-cds/qaa-p/11947283#M4490431</link>
      <description>&lt;P&gt;You cannot use the EDID4 in the CDS directly. You need to create Table function and call the SAP Standard Method there.  and then use the table function in the CDS view&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;GET_EDID4_DATA&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/1730950-edid4.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1730951-edid4-2.png" /&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;SB.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 18:02:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-substring-parameter-at-position-1-has-incorrect-data-type-lchr-cds/qaa-p/11947283#M4490431</guid>
      <dc:creator>shanthi_bhaskar</dc:creator>
      <dc:date>2019-09-24T18:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Function SUBSTRING: parameter at position 1 has incorrect data type LCHR - CDS view</title>
      <link>https://community.sap.com/t5/technology-q-a/function-substring-parameter-at-position-1-has-incorrect-data-type-lchr-cds/qaa-p/11947284#M4490432</link>
      <description>&lt;P&gt;You are a genious and I hate CDS.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 14:16:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-substring-parameter-at-position-1-has-incorrect-data-type-lchr-cds/qaa-p/11947284#M4490432</guid>
      <dc:creator>marco_ignazzi002</dc:creator>
      <dc:date>2021-03-09T14:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: Function SUBSTRING: parameter at position 1 has incorrect data type LCHR - CDS view</title>
      <link>https://community.sap.com/t5/technology-q-a/function-substring-parameter-at-position-1-has-incorrect-data-type-lchr-cds/qaa-p/11947285#M4490433</link>
      <description>&lt;P&gt;Hi Shanti,&lt;/P&gt;&lt;P&gt;I have created a similar CDS table function. But when I join it with my CDS, it does not allow me to have multiple document numbers(invoice number, Sales Orders, PO etc). All these fields have been fetched using substring on Sdata field. Not sure why its not allowing me to display 3 documents. Can you please guide me here?&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1957724-error-in-cds.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2021 04:33:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-substring-parameter-at-position-1-has-incorrect-data-type-lchr-cds/qaa-p/11947285#M4490433</guid>
      <dc:creator>guna91</dc:creator>
      <dc:date>2021-07-21T04:33:47Z</dc:date>
    </item>
  </channel>
</rss>

