<?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: Subselect in sa_split_list in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/subselect-in-sa-split-list/qaa-p/13843603#M4874446</link>
    <description>&lt;P&gt;Are you using version 12 or below?&lt;/P&gt;
&lt;P&gt;In those versions a procedure does not accept subqueries as argument, such as your "(select top...)".&lt;/P&gt;
&lt;P&gt;With v16, that was  changed, and your query should work here.&lt;/P&gt;
&lt;P&gt;In v12, you could use a derived query to get the top result and then use CROSS APPLY to provide the result as argument to the procedure. The forum does contain such samples, search for APPLY or LATERAL...&lt;/P&gt;</description>
    <pubDate>Fri, 29 Sep 2017 06:58:19 GMT</pubDate>
    <dc:creator>VolkerBarth</dc:creator>
    <dc:date>2017-09-29T06:58:19Z</dc:date>
    <item>
      <title>Subselect in sa_split_list</title>
      <link>https://community.sap.com/t5/technology-q-a/subselect-in-sa-split-list/qaq-p/13843602</link>
      <description>&lt;P&gt;When I try:&lt;/P&gt;
&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;&lt;/SPAN&gt;select line_num, row_value as cc_test FROM sa_split_list( (select top 1 start at 3 substr(cc_txt,12) FROM tblCategory), ';' ) where line_num = 1;
&lt;/PRE&gt;&lt;/DIV&gt;


&lt;P&gt;I get syntax error near ','. Why&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2017 05:09:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/subselect-in-sa-split-list/qaq-p/13843602</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-09-29T05:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: Subselect in sa_split_list</title>
      <link>https://community.sap.com/t5/technology-q-a/subselect-in-sa-split-list/qaa-p/13843603#M4874446</link>
      <description>&lt;P&gt;Are you using version 12 or below?&lt;/P&gt;
&lt;P&gt;In those versions a procedure does not accept subqueries as argument, such as your "(select top...)".&lt;/P&gt;
&lt;P&gt;With v16, that was  changed, and your query should work here.&lt;/P&gt;
&lt;P&gt;In v12, you could use a derived query to get the top result and then use CROSS APPLY to provide the result as argument to the procedure. The forum does contain such samples, search for APPLY or LATERAL...&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2017 06:58:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/subselect-in-sa-split-list/qaa-p/13843603#M4874446</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2017-09-29T06:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: Subselect in sa_split_list</title>
      <link>https://community.sap.com/t5/technology-q-a/subselect-in-sa-split-list/qaa-p/13843605#M4874448</link>
      <description>&lt;P&gt;I am using SA12. 
Can you show me how I use Cross Apply in this case? I have searched but do not understand how to do.
I found an openstring solution, but it had its limitations as well.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2017 07:16:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/subselect-in-sa-split-list/qaa-p/13843605#M4874448</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-09-29T07:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: Subselect in sa_split_list</title>
      <link>https://community.sap.com/t5/technology-q-a/subselect-in-sa-split-list/qaa-p/13843604#M4874447</link>
      <description>&lt;P&gt;Here's a sample with a (rather useless) subquery on the system table SYSTAB,
returning a date value.&lt;/P&gt;
&lt;PRE&gt;-- It "packs" the expected value as column "x" of a derived query (DT)
-- and then calls the stored procedure for that according column, split by a hyphen.
--
-- Note: If you do not apply the "TOP 1" clause, DT will return several rows
-- and the procedure will be called for each result set row separately
-- (in case that may be helpful here)

select line_num, row_value
from (select top 1 last_modified_at as x from systab order by 1) DT
&amp;nbsp;&amp;nbsp; CROSS APPLY sa_split_list(DT.x, '-')
-- where line_num = 1&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Sep 2017 07:29:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/subselect-in-sa-split-list/qaa-p/13843604#M4874447</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2017-09-29T07:29:41Z</dc:date>
    </item>
  </channel>
</rss>

