<?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: Function in function in SELECT of new SQL in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-in-function-in-select-of-new-sql/m-p/12388191#M1994492</link>
    <description>&lt;P&gt;Don't you get 2 leading spaces? (I don't know the result, it's just a question)&lt;/P&gt;</description>
    <pubDate>Tue, 11 May 2021 17:44:13 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2021-05-11T17:44:13Z</dc:date>
    <item>
      <title>Function in function in SELECT of new SQL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-in-function-in-select-of-new-sql/m-p/12388182#M1994483</link>
      <description>&lt;P&gt;Hello, I have the below select and I want to ask if it is possible to do the below &lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;SELECT CASE WHEN bseg~koart = 'D' THEN right( kna1~stceg, length( kna1~stceg ) )
            WHEN bseg~koart = 'K' THEN right( lfa1~stceg, 9 )
            ELSE ' '   
       END AS stceg
FROM kna1 WHERE konnr between 1000 and 2000
INTO TABLE @DATA(it_vat).&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Is it possible to pass the length dynamically or I must do it later with a loop.&lt;/P&gt;
  &lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 08:34:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-in-function-in-select-of-new-sql/m-p/12388182#M1994483</guid>
      <dc:creator>ekekakos</dc:creator>
      <dc:date>2021-05-11T08:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: Function in function in SELECT of new SQL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-in-function-in-select-of-new-sql/m-p/12388183#M1994484</link>
      <description>&lt;P&gt;You mean there's the syntax error "&lt;STRONG&gt;In the function "RIGHT", the parameter number "2" must be an ABAP variable. This is not the case for the expression that starts with "LENGTH"&lt;/STRONG&gt;", and you're asking for a workaround.&lt;/P&gt;&lt;P&gt;The message is clear, so you should update IT_VAT after the query.&lt;/P&gt;&lt;P&gt;NB: I don't understand what you want to achieve with the strange "right( kna1~stceg,length( kna1~stceg ))"&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 12:31:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-in-function-in-select-of-new-sql/m-p/12388183#M1994484</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-05-11T12:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: Function in function in SELECT of new SQL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-in-function-in-select-of-new-sql/m-p/12388184#M1994485</link>
      <description>&lt;P&gt;Hello Sandra, what I want is to extract only the numbers from the VAT Reg. No eg from the EL12345678912 to take/extract the 12345678912. And I want this to be done in the SELECT query and not later in a LOOP.&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 12:51:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-in-function-in-select-of-new-sql/m-p/12388184#M1994485</guid>
      <dc:creator>ekekakos</dc:creator>
      <dc:date>2021-05-11T12:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: Function in function in SELECT of new SQL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-in-function-in-select-of-new-sql/m-p/12388185#M1994486</link>
      <description>&lt;P&gt;"strange" is not what I mean, I mean "useless/non-sense" code &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;right( kna1~stceg , length( kna1~stceg ) )&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;is exactly equivalent to&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;kna1~stceg&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 May 2021 13:13:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-in-function-in-select-of-new-sql/m-p/12388185#M1994486</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-05-11T13:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: Function in function in SELECT of new SQL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-in-function-in-select-of-new-sql/m-p/12388186#M1994487</link>
      <description>&lt;P&gt;Hi &lt;SPAN class="mention-scrubbed"&gt;elkekakos&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;The answer is no. You cannot use dynamic length in right function.&lt;/P&gt;&lt;P&gt;You Will get an error stating the the second parameter should contain an ABAP variable which should be of numeric type or a number as said by &lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;there is no way other than looping and achieving what you what.&lt;/P&gt;&lt;P&gt;But appreciate your thought to use right function there.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rahul. &lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 13:45:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-in-function-in-select-of-new-sql/m-p/12388186#M1994487</guid>
      <dc:creator>rahulpippalla</dc:creator>
      <dc:date>2021-05-11T13:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: Function in function in SELECT of new SQL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-in-function-in-select-of-new-sql/m-p/12388187#M1994488</link>
      <description>&lt;P&gt;Sandra, sorry, you are right, I mean the following&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;right( kna1~stceg , length( kna1~stceg ) - 2 )&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I am so stretched that I forgot it.&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 14:36:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-in-function-in-select-of-new-sql/m-p/12388187#M1994488</guid>
      <dc:creator>ekekakos</dc:creator>
      <dc:date>2021-05-11T14:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: Function in function in SELECT of new SQL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-in-function-in-select-of-new-sql/m-p/12388188#M1994489</link>
      <description>&lt;P&gt;HI &lt;SPAN class="mention-scrubbed"&gt;elkekakos&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;If you exactly know how much length needs to be removed then why dont you use substring&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SUBSTRING( kna1~stceg, 3 )&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pavana Rahul.&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 15:05:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-in-function-in-select-of-new-sql/m-p/12388188#M1994489</guid>
      <dc:creator>rahulpippalla</dc:creator>
      <dc:date>2021-05-11T15:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: Function in function in SELECT of new SQL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-in-function-in-select-of-new-sql/m-p/12388189#M1994490</link>
      <description>&lt;P&gt;Hi, this is not working because it needs all parameters. I tried it and came up with the follwing error:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The function "SUBSTRING" expects 3 parameters, but 2 parameters were specified&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Elias&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 15:16:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-in-function-in-select-of-new-sql/m-p/12388189#M1994490</guid>
      <dc:creator>ekekakos</dc:creator>
      <dc:date>2021-05-11T15:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: Function in function in SELECT of new SQL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-in-function-in-select-of-new-sql/m-p/12388190#M1994491</link>
      <description>&lt;P&gt;Well I solved my problem and I found the way to gather the n digits from the field stceg.&lt;/P&gt;&lt;P&gt;I use replace because I noticed that it uses 3 expr as parameters. So the code is:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CASE WHEN bseg~koart = 'D' THEN replace( kna1~stceg, substring( kna1~stceg, 1, 2 ), ' ' ) )
                WHEN bseg~koart = 'K' THEN replace( lfa1~stceg, substring( lfa1~stceg, 1, 2 ), ' ' ) )
                ELSE '000000000'
           END AS stceg&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks a lot for your help.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Elias&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 15:32:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-in-function-in-select-of-new-sql/m-p/12388190#M1994491</guid>
      <dc:creator>ekekakos</dc:creator>
      <dc:date>2021-05-11T15:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: Function in function in SELECT of new SQL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-in-function-in-select-of-new-sql/m-p/12388191#M1994492</link>
      <description>&lt;P&gt;Don't you get 2 leading spaces? (I don't know the result, it's just a question)&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 17:44:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-in-function-in-select-of-new-sql/m-p/12388191#M1994492</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-05-11T17:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Function in function in SELECT of new SQL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-in-function-in-select-of-new-sql/m-p/12388192#M1994493</link>
      <description>&lt;P&gt;I check it Sandra and no there is no blank space in front or at the end. As I use the itab for filling a structure which I converted in JSON, I check also json and this field is OK (it is string without space). So I believe that it is OK.&lt;/P&gt;&lt;P&gt;Furthermore, we can use the LTRIM function and put the replace as argument. I saw that there is no error.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 18:54:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-in-function-in-select-of-new-sql/m-p/12388192#M1994493</guid>
      <dc:creator>ekekakos</dc:creator>
      <dc:date>2021-05-11T18:54:31Z</dc:date>
    </item>
  </channel>
</rss>

