<?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: QUERY -  Use UNION with Dynamic join query in Spend Management Q&amp;A</title>
    <link>https://community.sap.com/t5/spend-management-q-a/query-use-union-with-dynamic-join-query/qaa-p/10118228#M157168</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;STRONG&gt;Francisco,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I have used two filters in both the queries and used UNION between them.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Regards&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Praveen&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Mar 2014 06:04:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2014-03-04T06:04:21Z</dc:date>
    <item>
      <title>QUERY -  Use UNION with Dynamic join query</title>
      <link>https://community.sap.com/t5/spend-management-q-a/query-use-union-with-dynamic-join-query/qaq-p/10118226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to use UNION in two queries so that I can have one value for two filter fields. When I keep the below filter statement, it works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;%AND_OP("UPPER(T8.PARENT_OBJECT_ID)",&amp;lt;%?(T8.OBJECTID)%&amp;gt;) %&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;%AND_OP("UPPER(T5.MultipleRegionName_OBJECT_ID)",&amp;lt;%?(T5.MultipleRegionName_OBJECT_ID)%&amp;gt;)%&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;%DYN_FILTER%&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when I add UNION and copy past the same query, it gives me error :&lt;/P&gt;&lt;P&gt;SQL Exception: Missing IN or OUT parameter at index:: 1, ANSI-92 SQL State:&lt;/P&gt;&lt;P&gt;99999, Vendor Error Code: 17041.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anyone has implemented UNION ALL with two query(having dynamic filters),request you to please paste the code snippet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;query-1&lt;BR /&gt;....&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;&amp;lt;%DYN_FILTER%&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UNION ALL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;query-2&lt;BR /&gt;....&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;&amp;lt;%DYN_FILTER%&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Praveen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg. I want to get Document ID &#xD;
query 1- from Master Agreement&#xD;
where&#xD;
Doc.Owner = xyz&#xD;
UNION&#xD;
query 2 - from Agreement&#xD;
where&#xD;
Doc.Owner = xyz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Feb 2014 07:17:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/spend-management-q-a/query-use-union-with-dynamic-join-query/qaq-p/10118226</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-02-11T07:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: QUERY -  Use UNION with Dynamic join query</title>
      <link>https://community.sap.com/t5/spend-management-q-a/query-use-union-with-dynamic-join-query/qaa-p/10118227#M157167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;STRONG&gt;Praveen,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The number of parameters filters is not equals the number of&amp;nbsp; ?'s in your query. You need duplicate &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;the parameter used in first query.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Regards &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Francisco&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2014 12:37:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/spend-management-q-a/query-use-union-with-dynamic-join-query/qaa-p/10118227#M157167</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-02-25T12:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: QUERY -  Use UNION with Dynamic join query</title>
      <link>https://community.sap.com/t5/spend-management-q-a/query-use-union-with-dynamic-join-query/qaa-p/10118228#M157168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;STRONG&gt;Francisco,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I have used two filters in both the queries and used UNION between them.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Regards&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Praveen&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Mar 2014 06:04:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/spend-management-q-a/query-use-union-with-dynamic-join-query/qaa-p/10118228#M157168</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-03-04T06:04:21Z</dc:date>
    </item>
  </channel>
</rss>

