<?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: I got  run time error when in a select statement in Zprogram in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/i-got-run-time-error-when-in-a-select-statement-in-zprogram/m-p/4405801#M1047139</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hari,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of using * try to select only required fields also try to use more where clause. You can check the report /1BCDWB/DBCOSP via SE38 to see how they are fetching data from COSP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Nagaraj Kalbavi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Aug 2008 07:59:40 GMT</pubDate>
    <dc:creator>former_member70391</dc:creator>
    <dc:date>2008-08-19T07:59:40Z</dc:date>
    <item>
      <title>I got  run time error when in a select statement in Zprogram</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/i-got-run-time-error-when-in-a-select-statement-in-zprogram/m-p/4405800#M1047138</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;I got  run time error when i executed the Zprogram .the dump is showing below.and here i am giveing the Select query of the dump and the data base table cosp have the 30000000 records in database&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       SELECT * FROM COSP INTO WA_COSP1       &lt;/P&gt;&lt;P&gt;          WHERE LEDNR = '00'                &lt;/P&gt;&lt;P&gt;       AND GJAHR = YEAR                  &lt;/P&gt;&lt;P&gt;          AND WRTTP IN WERTYP               &lt;/P&gt;&lt;P&gt;          AND KSTAR IN KOSAR                &lt;/P&gt;&lt;P&gt;         AND VRGNG IN BETVOR.              &lt;/P&gt;&lt;P&gt;                                                  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After a certain length of time, the program is terminated. In the case     &lt;/P&gt;&lt;P&gt;of a work area, this means that                                            &lt;/P&gt;&lt;P&gt;- endless loops (DO, WHILE, ...),                                          &lt;/P&gt;&lt;P&gt;- database accesses producing an excessively large result set,             &lt;/P&gt;&lt;P&gt;- database accesses without a suitable index (full table scan)             &lt;/P&gt;&lt;P&gt;do not block the processing for too long.                                                                                &lt;/P&gt;&lt;P&gt;The system profile "rdisp/max_wprun_time" contains the maximum runtime of a&lt;/P&gt;&lt;P&gt; program. The                                                              &lt;/P&gt;&lt;P&gt;current setting is 600 seconds. Once this time limit has been exceeded,    &lt;/P&gt;&lt;P&gt;the system tries to terminate any SQL statements that are currently        &lt;/P&gt;&lt;P&gt;being executed and tells the ABAP processor to terminate the current       &lt;/P&gt;&lt;P&gt;program. Then it waits for a maximum of 60 seconds. If the program is      &lt;/P&gt;&lt;P&gt;still active, the work process is restarted.                                                                                &lt;/P&gt;&lt;P&gt;successfully processed, the system gives it another 600 seconds.           &lt;/P&gt;&lt;P&gt;Hence the maximum runtime of a program is at least twice the value of      &lt;/P&gt;&lt;P&gt;the system profile parameter "rdisp/max_wprun_time".                                                                                &lt;/P&gt;&lt;P&gt;Plese give me solution .&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;hari&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Aug 2008 07:48:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/i-got-run-time-error-when-in-a-select-statement-in-zprogram/m-p/4405800#M1047138</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-19T07:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: I got  run time error when in a select statement in Zprogram</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/i-got-run-time-error-when-in-a-select-statement-in-zprogram/m-p/4405801#M1047139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hari,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of using * try to select only required fields also try to use more where clause. You can check the report /1BCDWB/DBCOSP via SE38 to see how they are fetching data from COSP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Nagaraj Kalbavi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Aug 2008 07:59:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/i-got-run-time-error-when-in-a-select-statement-in-zprogram/m-p/4405801#M1047139</guid>
      <dc:creator>former_member70391</dc:creator>
      <dc:date>2008-08-19T07:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: I got  run time error when in a select statement in Zprogram</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/i-got-run-time-error-when-in-a-select-statement-in-zprogram/m-p/4405802#M1047140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hari,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U are using IN operator  hence u cant use work area u have to use internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from COSP into table lt_cosp.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Aug 2008 08:02:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/i-got-run-time-error-when-in-a-select-statement-in-zprogram/m-p/4405802#M1047140</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-19T08:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: I got  run time error when in a select statement in Zprogram</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/i-got-run-time-error-when-in-a-select-statement-in-zprogram/m-p/4405803#M1047141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hari,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your "SELECT" query is wrong.&lt;/P&gt;&lt;P&gt;If you are selecting data into work area, you must use SELECT UP TO 1 ROWS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Aug 2008 08:02:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/i-got-run-time-error-when-in-a-select-statement-in-zprogram/m-p/4405803#M1047141</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-19T08:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: I got  run time error when in a select statement in Zprogram</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/i-got-run-time-error-when-in-a-select-statement-in-zprogram/m-p/4405804#M1047142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check&lt;/P&gt;&lt;P&gt;1) if you can limit to specific fields and not all the fields in table COSP .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) if first step not relevent make select with limit of records use in select UP TO N ROWS. make it a couple of time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Aug 2008 08:08:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/i-got-run-time-error-when-in-a-select-statement-in-zprogram/m-p/4405804#M1047142</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-19T08:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: I got  run time error when in a select statement in Zprogram</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/i-got-run-time-error-when-in-a-select-statement-in-zprogram/m-p/4405805#M1047143</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;Try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. If u dont want all the fields in the table, select only the required fields instead of using select *.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Use internal table instead of work area as to handle large amount of data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sharin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Aug 2008 08:21:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/i-got-run-time-error-when-in-a-select-statement-in-zprogram/m-p/4405805#M1047143</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-19T08:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: I got  run time error when in a select statement in Zprogram</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/i-got-run-time-error-when-in-a-select-statement-in-zprogram/m-p/4405806#M1047144</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;  Here your database has many records, in order to improve the performance, if not all the fields will be used &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you'd better to select the exact fields not ' * ' which means all the fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Second, your select statement has some problem. There two ways to write select statement. I advise you &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to use the first statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. SELECT &amp;lt;FIELD1 FIELD2 ... FIELDn&amp;gt; &lt;/P&gt;&lt;P&gt;        FROM datebase_table&lt;/P&gt;&lt;P&gt;        INTO TABLE iternal_table&lt;/P&gt;&lt;P&gt;        WHERE &amp;lt;clause&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.SELECT &amp;lt;FIELD1 FIELD2 ... FIELDn&amp;gt;&lt;/P&gt;&lt;P&gt;       FROM database_table&lt;/P&gt;&lt;P&gt;       INTO workarea&lt;/P&gt;&lt;P&gt;       WHERE &amp;lt;clause&amp;gt;&lt;/P&gt;&lt;P&gt;   ENDSELECT.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Aug 2008 09:23:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/i-got-run-time-error-when-in-a-select-statement-in-zprogram/m-p/4405806#M1047144</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-19T09:23:31Z</dc:date>
    </item>
    <item>
      <title>Re: I got  run time error when in a select statement in Zprogram</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/i-got-run-time-error-when-in-a-select-statement-in-zprogram/m-p/4405807#M1047145</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;Plz try this way :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Try to have the fields in select query instead of select *.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. You are selecting the records from table into a workarea without endselect, use this way...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select f1
                   f2
from cosp
into table wa_cosp1
WHERE LEDNR = '00' 
AND GJAHR = YEAR 
AND WRTTP IN WERTYP 
AND KSTAR IN KOSAR 
AND VRGNG IN BETVOR. 
endselect..&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Or else it always a good practice performance wise to write select without end select and using a internal table for storing the result of select query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT f1
             f2
 FROM COSP INTO IT_COSP1      "internal table
WHERE LEDNR = '00' 
AND GJAHR = YEAR 
AND WRTTP IN WERTYP 
AND KSTAR IN KOSAR 
AND VRGNG IN BETVOR.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. even we can have &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT upto 1 rows f1&lt;/P&gt;&lt;P&gt;                                  f2&lt;/P&gt;&lt;P&gt; FROM COSP INTO WA_COSP1 &lt;/P&gt;&lt;P&gt;WHERE LEDNR = '00' &lt;/P&gt;&lt;P&gt;AND GJAHR = YEAR &lt;/P&gt;&lt;P&gt;AND WRTTP IN WERTYP &lt;/P&gt;&lt;P&gt;AND KSTAR IN KOSAR &lt;/P&gt;&lt;P&gt;AND VRGNG IN BETVOR. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanx,&lt;/P&gt;&lt;P&gt;dhanashri.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Dhanashri Pawar on Aug 19, 2008 11:37 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Aug 2008 09:36:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/i-got-run-time-error-when-in-a-select-statement-in-zprogram/m-p/4405807#M1047145</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-19T09:36:38Z</dc:date>
    </item>
  </channel>
</rss>

