<?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: How to stop runtime error: time limit exceeded... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-stop-runtime-error-time-limit-exceeded/m-p/2063142#M426670</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You can use the following fun modules instead of using select statements for CDHDR and CDPOS tables:&lt;/P&gt;&lt;P&gt;CHANGEDOCUMENT_READ_HEADERS&lt;/P&gt;&lt;P&gt;CHANGEDOCUMENT_READ_POSITIONS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ask your basis person to increase time Limit (from 10 minutes)for execution to more time to avoid run time error.&lt;/P&gt;&lt;P&gt;But generally 10 minutes is good time. If you wants run the report for more than 3 minutes you have to schedule it in background, that will be better instead of running in foreground, instead of wasting system resources.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if useful.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Mar 2007 04:29:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-19T04:29:04Z</dc:date>
    <item>
      <title>How to stop runtime error: time limit exceeded...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-stop-runtime-error-time-limit-exceeded/m-p/2063140#M426668</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;&lt;/P&gt;&lt;P&gt;I am having a problem modifying a report wherein one of its internal &lt;/P&gt;&lt;P&gt;tables contains around 300,000 lines and it always gives us time limit &lt;/P&gt;&lt;P&gt;exceeded error in prod server. Our time limit is only 10 mins and I &lt;/P&gt;&lt;P&gt;would like to know on how should I go about this. Below is the original&lt;/P&gt;&lt;P&gt;and the revised code. Any inputs would be  greatly appreciated. Again, &lt;/P&gt;&lt;P&gt;thank you guys and take care!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Original code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT * INTO CORRESPONDING FIELDS OF TABLE it_cdpos&lt;/P&gt;&lt;P&gt;      FROM cdpos FOR ALL ENTRIES IN it_cdhdr&lt;/P&gt;&lt;P&gt;     WHERE objectclas EQ it_cdhdr-objectclas&lt;/P&gt;&lt;P&gt;       AND objectid   = it_cdhdr-objectid&lt;/P&gt;&lt;P&gt;       AND changenr   = it_cdhdr-changenr&lt;/P&gt;&lt;P&gt;       AND tabname    = lc_tabname_mcha&lt;/P&gt;&lt;P&gt;       AND fname     IN (lc_fname_zustd,'LWEDT').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT it_cdpos ASCENDING BY objectid changenr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT it_cdpos INTO wa_cdpos.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    l_matnr = wa_cdpos-objectid+00(18).&lt;/P&gt;&lt;P&gt;    l_charg = wa_cdpos-objectid+22(10).&lt;/P&gt;&lt;P&gt;    l_zustd = wa_cdpos-value_new+00(01).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    READ TABLE it_batch INTO wa_batch&lt;/P&gt;&lt;P&gt;         WITH KEY matnr = l_matnr&lt;/P&gt;&lt;P&gt;                  charg = l_charg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;      l_tabix = sy-tabix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      wa_batch-zustd = l_zustd.&lt;/P&gt;&lt;P&gt;      MODIFY it_batch FROM wa_batch INDEX l_tabix&lt;/P&gt;&lt;P&gt;             TRANSPORTING zustd.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      wa_batch-matnr = l_matnr.&lt;/P&gt;&lt;P&gt;      wa_batch-charg = l_charg.&lt;/P&gt;&lt;P&gt;      wa_batch-zustd = l_zustd.&lt;/P&gt;&lt;P&gt;      wa_batch-code  = 'A'.              "selected within period&lt;/P&gt;&lt;P&gt;      APPEND wa_batch TO it_batch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE it_batch WHERE zustd EQ lc_zustd_x.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My version:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF t_cdpos,&lt;/P&gt;&lt;P&gt;        objectid  TYPE cdpos-objectid,&lt;/P&gt;&lt;P&gt;        changenr  TYPE cdpos-changenr,&lt;/P&gt;&lt;P&gt;        value_new TYPE cdpos-value_new,&lt;/P&gt;&lt;P&gt;       END OF t_cdpos.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: it_cdpos TYPE SORTED TABLE OF t_cdpos&lt;/P&gt;&lt;P&gt;      WITH NON-UNIQUE KEY objectid changenr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;fs_cdpos&amp;gt; LIKE LINE OF it_cdpos.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT objectid changenr value_new&lt;/P&gt;&lt;P&gt;      FROM cdpos&lt;/P&gt;&lt;P&gt;      INTO TABLE it_cdpos&lt;/P&gt;&lt;P&gt;      FOR ALL ENTRIES IN it_cdhdr&lt;/P&gt;&lt;P&gt;     WHERE objectclas EQ it_cdhdr-objectclas&lt;/P&gt;&lt;P&gt;       AND objectid   = it_cdhdr-objectid&lt;/P&gt;&lt;P&gt;       AND changenr   = it_cdhdr-changenr&lt;/P&gt;&lt;P&gt;       AND tabname    = lc_tabname_mcha&lt;/P&gt;&lt;P&gt;       AND fname     IN (lc_fname_zustd,'LWEDT').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE it_cdpos WHERE value_new+00(01) = 'X'.&lt;/P&gt;&lt;P&gt;  LOOP AT it_cdpos ASSIGNING &amp;lt;fs_cdpos&amp;gt;.&lt;/P&gt;&lt;P&gt;    l_matnr = &amp;lt;fs_cdpos&amp;gt;-objectid+00(18).&lt;/P&gt;&lt;P&gt;    l_charg = &amp;lt;fs_cdpos&amp;gt;-objectid+22(10).&lt;/P&gt;&lt;P&gt;    l_zustd = &amp;lt;fs_cdpos&amp;gt;-value_new+00(01).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    wa_batch-matnr = l_matnr.&lt;/P&gt;&lt;P&gt;    wa_batch-charg = l_charg.&lt;/P&gt;&lt;P&gt;    wa_batch-zustd = l_zustd.&lt;/P&gt;&lt;P&gt;    wa_batch-code  = 'A'.&lt;/P&gt;&lt;P&gt;    APPEND wa_batch TO it_batch.&lt;/P&gt;&lt;P&gt;    CLEAR wa_batch.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***Also, do you think the original and modified code will give the same result?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2007 03:10:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-stop-runtime-error-time-limit-exceeded/m-p/2063140#M426668</guid>
      <dc:creator>aris_hidalgo</dc:creator>
      <dc:date>2007-03-19T03:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to stop runtime error: time limit exceeded...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-stop-runtime-error-time-limit-exceeded/m-p/2063141#M426669</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;PRE&gt;&lt;CODE&gt;

SELECT * INTO CORRESPONDING FIELDS OF TABLE it_cdpos
FROM cdpos FOR ALL ENTRIES IN it_cdhdr
WHERE objectclas EQ it_cdhdr-objectclas
AND objectid = it_cdhdr-objectid
AND changenr = it_cdhdr-changenr
AND tabname = lc_tabname_mcha
AND fname IN (lc_fname_zustd,'LWEDT').


Avoid this and use CHANGE_DOCUMENT_READ

or search for fm CHANGE*DOCUMENT*RANGE* in se37

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aRs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2007 03:16:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-stop-runtime-error-time-limit-exceeded/m-p/2063141#M426669</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2007-03-19T03:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to stop runtime error: time limit exceeded...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-stop-runtime-error-time-limit-exceeded/m-p/2063142#M426670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You can use the following fun modules instead of using select statements for CDHDR and CDPOS tables:&lt;/P&gt;&lt;P&gt;CHANGEDOCUMENT_READ_HEADERS&lt;/P&gt;&lt;P&gt;CHANGEDOCUMENT_READ_POSITIONS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ask your basis person to increase time Limit (from 10 minutes)for execution to more time to avoid run time error.&lt;/P&gt;&lt;P&gt;But generally 10 minutes is good time. If you wants run the report for more than 3 minutes you have to schedule it in background, that will be better instead of running in foreground, instead of wasting system resources.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if useful.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2007 04:29:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-stop-runtime-error-time-limit-exceeded/m-p/2063142#M426670</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-19T04:29:04Z</dc:date>
    </item>
  </channel>
</rss>

