<?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: runtime issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-issue/m-p/2765221#M643924</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can remove the VBAK JOIN as you are not selecting any field from table VBAK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Arya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Sep 2007 12:12:34 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-11T12:12:34Z</dc:date>
    <item>
      <title>runtime issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-issue/m-p/2765220#M643923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the below statement is giving me a runtime error.&lt;/P&gt;&lt;P&gt;In the shortdumb I got the messages as&lt;/P&gt;&lt;P&gt;-&amp;gt;The maximum size of an SQL statement has been exceeded.&lt;/P&gt;&lt;P&gt;-&amp;gt;The statement contains too many input variables.&lt;/P&gt;&lt;P&gt;-&amp;gt;the space needed for the input data exceeds the available memory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can some one please suggest me a best replacement for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also when I checked in ST05 this was taking higher time than any other statement and was in red highlight&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT vkdfs&lt;SUB&gt;vkorg vkdfs&lt;/SUB&gt;vbtyp vkdfs&lt;SUB&gt;vbeln tvko&lt;/SUB&gt;bukrs&lt;/P&gt;&lt;P&gt;         vkdfs&lt;SUB&gt;fkdat VKDFS&lt;/SUB&gt;SPART                             &lt;/P&gt;&lt;P&gt;         into (t_vkdfs-vkorg, t_vkdfs-vbtyp, t_vkdfs-vbeln,&lt;/P&gt;&lt;P&gt;               t_vkdfs-bukrs, t_vkdfs-fkdat, T_VKDFS-SPART)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      FROM vkdfs join tvko on ( vkdfs&lt;SUB&gt;vkorg = tvko&lt;/SUB&gt;vkorg )&lt;/P&gt;&lt;P&gt;                 JOIN VBAK ON ( VKDFS&lt;SUB&gt;SPART = VBAK&lt;/SUB&gt;SPART )          &lt;/P&gt;&lt;P&gt;      WHERE fkdat IN s_wadat&lt;/P&gt;&lt;P&gt;        AND vkdfs~vkorg IN s_vkorg AND&lt;/P&gt;&lt;P&gt;            VKDFS~SPART IN S_SPART AND                          &lt;/P&gt;&lt;P&gt;            vkdfs~vbtyp &amp;lt;&amp;gt; 'C'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2007 12:03:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-issue/m-p/2765220#M643923</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-11T12:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: runtime issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-issue/m-p/2765221#M643924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can remove the VBAK JOIN as you are not selecting any field from table VBAK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Arya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2007 12:12:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-issue/m-p/2765221#M643924</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-11T12:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: runtime issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-issue/m-p/2765222#M643925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;(1) As TVKO is a small table (relatively) you could read the whole table into an internal sorted table once at the load of program. &lt;/P&gt;&lt;P&gt;Then LOOP at your internal table read from VKDFS/VBAP and move fields missing from VBAK and TVKO &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(2) You are joining VBAK and VKDFS via SPART field only? So for each record of VBAK in a division, you join ALL records of VKDFS in the same division, you miss some join-criteria, like VBELN or so?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2007 12:20:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-issue/m-p/2765222#M643925</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2007-09-11T12:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: runtime issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-issue/m-p/2765223#M643926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT vkdfs&lt;SUB&gt;vkorg vkdfs&lt;/SUB&gt;vbtyp vkdfs&lt;SUB&gt;vbeln tvko&lt;/SUB&gt;bukrs&lt;/P&gt;&lt;P&gt;vkdfs&lt;SUB&gt;fkdat VKDFS&lt;/SUB&gt;SPART &lt;/P&gt;&lt;P&gt;into (t_vkdfs-vkorg, t_vkdfs-vbtyp, t_vkdfs-vbeln,&lt;/P&gt;&lt;P&gt;t_vkdfs-bukrs, t_vkdfs-fkdat, T_VKDFS-SPART)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM vkdfs join tvko on ( vkdfs&lt;SUB&gt;vkorg = tvko&lt;/SUB&gt;vkorg )&lt;/P&gt;&lt;P&gt;JOIN VBAK ON ( VKDFS&lt;SUB&gt;SPART = VBAK&lt;/SUB&gt;SPART )&lt;/P&gt;&lt;P&gt; WHERE fkdat IN s_wadat&lt;/P&gt;&lt;P&gt;AND vkdfs~vkorg IN s_vkorg AND&lt;/P&gt;&lt;P&gt;VKDFS~SPART IN S_SPART AND &lt;/P&gt;&lt;P&gt;vkdfs~vbtyp &amp;lt;&amp;gt; 'C'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will suggest - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Dont do the join on VBAK. you can get the document type in VKDFS-VBTYP if u r seraching for Sales Orders.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. You arenot selecting into tables. So i guess it ends with an ENDSEELCT. Dont select into variables and then process. Declare an internal table and do the SELECT in one shot. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT fld1 fld2 .......fldn&lt;/P&gt;&lt;P&gt;into        TABLE t_itab&lt;/P&gt;&lt;P&gt;from       some_table&lt;/P&gt;&lt;P&gt;where    -&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ur code between SELECT and ENDSELECT ( ABAP4 processing) is making the DB Select to take a very longer period of time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2007 12:30:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-issue/m-p/2765223#M643926</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-11T12:30:53Z</dc:date>
    </item>
    <item>
      <title>Re: runtime issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-issue/m-p/2765224#M643927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ther is a limited amount of memory available for creation of an SQL statement to be sent to the Database - this used to be in the range 6K to 8K bytes I believe.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This space must hold the entire SQL statement and all the data values for it (ie values in the WHERE block).  So if you construct a WHERE that uses a lot of  "field IN select-option" type comparisons, and then fill these select-options with lots of values, you soon get past the limit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in your example, you have S_WADAT, S_VKORG, S_SPART - so if for example the S_WADAT selection had 500 dates in it this would use over 4K bytes - over half of what is available.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only solution is to decrease the number of entries - perhaps by using ranges instead of single entries, or perhaps by calling the select multiple times with subsets of the selection range and append the returned results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Upgrade to a later database or to 64 bit architecture may change the limit - I dont know - suggest you check SAP OSS notes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2007 14:05:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-issue/m-p/2765224#M643927</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-11T14:05:34Z</dc:date>
    </item>
  </channel>
</rss>

