<?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: SELECT statement gives short dump in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-gives-short-dump/m-p/3715499#M894445</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the suggestion, but I would need to create internal table with fields txcmp, tyear as they have to be part of WHERE clause. Then I would have to populate it from gp_tstpr.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 May 2008 06:01:57 GMT</pubDate>
    <dc:creator>former_member194099</dc:creator>
    <dc:date>2008-05-06T06:01:57Z</dc:date>
    <item>
      <title>SELECT statement gives short dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-gives-short-dump/m-p/3715497#M894443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;I have a select statement which is something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   SELECT DISTINCT * FROM t5ux1                     &lt;/P&gt;&lt;P&gt;                  WHERE tyear = gp_udate(4)       &lt;/P&gt;&lt;P&gt;                    AND txcmp = units-txcmp       &lt;/P&gt;&lt;P&gt;                    AND pernr IN gp_tstpr.        &lt;/P&gt;&lt;P&gt;   ee_index-pernr = t5ux1-personid.               &lt;/P&gt;&lt;P&gt;   ee_index-txcmp = t5ux1-txcmp.                  &lt;/P&gt;&lt;P&gt;   COLLECT ee_index.                              &lt;/P&gt;&lt;P&gt; ENDSELECT.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"gp_tstpr" is a select option here.  When gp_tstpr is huge with say 30000 entries it gives a dump with CX_SY_OPEN_SQL_DB exception, otherwise this statement works fine. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Different possibilities to solve the problems are:&lt;/P&gt;&lt;P&gt;1. Use FOR ALL ENTRIES IN clause. But to use this clause I would need to declare a new internal table having all the key fields from t5ux1 and populate it from gp_tstpr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Use CHECK statement inside select which would be like-&lt;/P&gt;&lt;P&gt;     SELECT DISTINCT * FROM t5ux1                     &lt;/P&gt;&lt;P&gt;                  WHERE tyear = gp_udate(4)       &lt;/P&gt;&lt;P&gt;                    AND txcmp = units-txcmp.       &lt;/P&gt;&lt;P&gt;              CHECK ee_index-pernr IN gp_tstpr.&lt;/P&gt;&lt;P&gt;              APPEND ee_index.&lt;/P&gt;&lt;P&gt;  ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are there any more options to solve this problem? Which option is better also from performance perspective?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sagar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 May 2008 05:40:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-gives-short-dump/m-p/3715497#M894443</guid>
      <dc:creator>former_member194099</dc:creator>
      <dc:date>2008-05-06T05:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT statement gives short dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-gives-short-dump/m-p/3715498#M894444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT DISTINCT * FROM t5ux1 
WHERE tyear = gp_udate(4) 
AND txcmp = units-txcmp 
AND pernr IN gp_tstpr. 
ee_index-pernr = t5ux1-personid. 
ee_index-txcmp = t5ux1-txcmp. 
COLLECT ee_index. 
ENDSELECT.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I feel usage of FOR ALL ENTRIES is a better option. As an internal table automatically gets created for the Select Option Field with the values as high, low. etc.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So better use for all entries on the select option and try it out. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Pls reward if useful.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sirisha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 May 2008 05:54:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-gives-short-dump/m-p/3715498#M894444</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-06T05:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT statement gives short dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-gives-short-dump/m-p/3715499#M894445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the suggestion, but I would need to create internal table with fields txcmp, tyear as they have to be part of WHERE clause. Then I would have to populate it from gp_tstpr.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 May 2008 06:01:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-gives-short-dump/m-p/3715499#M894445</guid>
      <dc:creator>former_member194099</dc:creator>
      <dc:date>2008-05-06T06:01:57Z</dc:date>
    </item>
  </channel>
</rss>

