<?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: Time Out selecting Table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-out-selecting-table/m-p/4109474#M982612</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;P&gt;a bit old fashioned but it may work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;statics:    s_cursor type cursor.
....

DO.
If sy-index = 1. "first loop.
      open cursor with hold s_cursor for
         SELECT ..."continue your statement without package size
endif.

        fetch next cursor s_cursor
                   into corresponding fields
                   of table " your table
                   package size "your size.
        if sy-subrc &amp;lt;&amp;gt; 0.
          close cursor s_cursor.
          EXIT
        endif.
  COMMIT WORK. "resets runtime for max runtime
ENDDO.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Be sure not to append all entries but to process them block by block - else memory would be a problem...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;HP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Jul 2008 15:47:30 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-07-03T15:47:30Z</dc:date>
    <item>
      <title>Time Out selecting Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-out-selecting-table/m-p/4109470#M982608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends,  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I'm with another problem.&lt;/P&gt;&lt;P&gt;I have a Specific table with 150.000.000 register approximately. I'm using the select bellow, with the command PACKAGE SIZE, but anyway a time out occurs. The Basis don't have permission to change the time of time out.  You can Help-me.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXAMPLE BELLOW:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT rvers                                          &lt;/P&gt;&lt;P&gt;         drcrk&lt;/P&gt;&lt;P&gt;         docnr&lt;/P&gt;&lt;P&gt;         docln&lt;/P&gt;&lt;P&gt;         racct&lt;/P&gt;&lt;P&gt;         rcntr&lt;/P&gt;&lt;P&gt;         hsl&lt;/P&gt;&lt;P&gt;         sgtxt&lt;/P&gt;&lt;P&gt;         budat&lt;/P&gt;&lt;P&gt;         FROM zglt1sbra&lt;/P&gt;&lt;P&gt;             APPENDING TABLE gt_zglt1sbra&lt;/P&gt;&lt;P&gt;             PACKAGE SIZE 150000&lt;/P&gt;&lt;P&gt;             WHERE rrcty  = v_rrcty&lt;/P&gt;&lt;P&gt;            WHERE rrcty  EQ gw_rrcty&lt;/P&gt;&lt;P&gt;                    AND   rvers  IN r_rvers&lt;/P&gt;&lt;P&gt;                    AND   ryear  IN br_gjahr&lt;/P&gt;&lt;P&gt;                   AND   docnr  IN br_belnr&lt;/P&gt;&lt;P&gt;                  AND   rbukrs EQ br_bukrs-low&lt;/P&gt;&lt;P&gt;                  AND   activ  NE c_rkiv&lt;/P&gt;&lt;P&gt;                  AND   activ  NE c_rkiu&lt;/P&gt;&lt;P&gt;                 AND    budat  IN br_budat&lt;/P&gt;&lt;P&gt;                AND zzzxblnr IN br_xblnr.&lt;/P&gt;&lt;P&gt;   ENDSELECT.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2008 15:30:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-out-selecting-table/m-p/4109470#M982608</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-03T15:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: Time Out selecting Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-out-selecting-table/m-p/4109471#M982609</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;this is a Z table, we don't know much about it, i.e. its primary and secondary keys could be interesting. But I've seen this:&lt;/P&gt;&lt;P&gt;AND ryear IN br_gjahr&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;AND budat IN br_budat&lt;/P&gt;&lt;P&gt;I assume budat(4) = ryear (if the financial year = calendar year),which the selection on gjahr is not really necessary.&lt;/P&gt;&lt;P&gt;On the other hand I ahve no idea these 150.000.000 records are in how many years? For example you could archive records which are older than 01.01.2007 and the whole thing could be faster.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps some&lt;/P&gt;&lt;P&gt;ec&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2008 15:36:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-out-selecting-table/m-p/4109471#M982609</guid>
      <dc:creator>JozsefSzikszai</dc:creator>
      <dc:date>2008-07-03T15:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: Time Out selecting Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-out-selecting-table/m-p/4109472#M982610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1)Do not use SELECT.ENDSELECT. Change the select so as to hit the DB in one shot, as shown below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
select f1 f2 f3
into table i_tab
from dbtab
where f1 in s_f1 and
          f2 in s_f2.

if sy-subrc = 0.

endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)The where clause should have fields in the order as in DB table.&lt;/P&gt;&lt;P&gt;3)Do not use "NE" condition in SELECT. It breaks the search key.Retrieve the records without it and then delete invalid records from the internal table, as shown below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DELETE I_tab WHERE f3 '01'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5) If that also doesn't help create a secondary index on the DB table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2008 15:41:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-out-selecting-table/m-p/4109472#M982610</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-03T15:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: Time Out selecting Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-out-selecting-table/m-p/4109473#M982611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Flavio Ferreira,&lt;/P&gt;&lt;P&gt;                              You can do two things to avoid the time out issue:&lt;/P&gt;&lt;P&gt;1) Speak with your BASIS and try to do some Secondary indexing on some of the table fields.&lt;/P&gt;&lt;P&gt;2) As per the Eric Cartman's response you can archive the tabe data upto Dec 2007 .&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;Thanks,&lt;/P&gt;&lt;P&gt;Greetson&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2008 15:44:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-out-selecting-table/m-p/4109473#M982611</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-03T15:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Time Out selecting Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-out-selecting-table/m-p/4109474#M982612</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;P&gt;a bit old fashioned but it may work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;statics:    s_cursor type cursor.
....

DO.
If sy-index = 1. "first loop.
      open cursor with hold s_cursor for
         SELECT ..."continue your statement without package size
endif.

        fetch next cursor s_cursor
                   into corresponding fields
                   of table " your table
                   package size "your size.
        if sy-subrc &amp;lt;&amp;gt; 0.
          close cursor s_cursor.
          EXIT
        endif.
  COMMIT WORK. "resets runtime for max runtime
ENDDO.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Be sure not to append all entries but to process them block by block - else memory would be a problem...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;HP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2008 15:47:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-out-selecting-table/m-p/4109474#M982612</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-03T15:47:30Z</dc:date>
    </item>
  </channel>
</rss>

