<?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 solutions regarding runtime error in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/solutions-regarding-runtime-error/m-p/1287893#M154449</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 recently had my program transported on prod server and  the program produces a run time error. The error pointed out in my sort statement and when I checked the db table where I get the records I found out that it contains almost 3 million recs. So when I sort the itab it causes the run time error. i have posted below my code so you guys can check it out. Any suggestions and comments would be highly appreciated. Thanks a lot guys and take care!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*get all records from table ztm0019 and append to itab.&lt;/P&gt;&lt;P&gt;  SELECT * FROM ztm0019&lt;/P&gt;&lt;P&gt;  APPENDING TABLE t_ztm0019.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*populate itab t_ztm0019_tmp.&lt;/P&gt;&lt;P&gt;  t_ztm0019_tmp[] = t_ztm0019[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR t_ztm0019[].&lt;/P&gt;&lt;P&gt;*sort itab according to latest date and time grouped by serial no.&lt;/P&gt;&lt;P&gt;  SORT t_ztm0019_tmp BY sernr datum DESCENDING uzeit DESCENDING.    "--&amp;gt; here is the error occurs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DELETE ADJACENT DUPLICATES FROM t_ztm0019_tmp COMPARING&lt;/P&gt;&lt;P&gt;                                                         sernr&lt;/P&gt;&lt;P&gt;                                                         bwart&lt;/P&gt;&lt;P&gt;                                                         mblnr.&lt;/P&gt;&lt;P&gt;  LOOP AT t_ztm0019_tmp.&lt;/P&gt;&lt;P&gt;*read first record from itab.&lt;/P&gt;&lt;P&gt;    READ TABLE t_ztm0019_tmp INDEX sy-index.&lt;/P&gt;&lt;P&gt;    IF t_ztm0019_tmp-bwart EQ '702'&lt;/P&gt;&lt;P&gt;      OR t_ztm0019_tmp-bwart EQ '708'&lt;/P&gt;&lt;P&gt;      OR t_ztm0019_tmp-bwart EQ '712'&lt;/P&gt;&lt;P&gt;      OR t_ztm0019_tmp-bwart EQ '718'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      LOOP AT t_ztm0019_tmp WHERE sernr = t_ztm0019_tmp-sernr.&lt;/P&gt;&lt;P&gt;        APPEND t_ztm0019_tmp TO t_ztm_acc_variance.&lt;/P&gt;&lt;P&gt;        CLEAR  t_ztm0019_tmp.&lt;/P&gt;&lt;P&gt;        DELETE t_ztm0019_tmp.&lt;/P&gt;&lt;P&gt;      ENDLOOP.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      APPEND t_ztm0019_tmp TO t_ztm0019.&lt;/P&gt;&lt;P&gt;      CLEAR t_ztm0019_tmp.&lt;/P&gt;&lt;P&gt;      DELETE t_ztm0019_tmp.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    CONTINUE.      " Go for next SERNR&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*inserts or updates records in db table ztm_acc_variance based on itab&lt;/P&gt;&lt;P&gt;  MODIFY ztm_acc_variance FROM TABLE t_ztm_acc_variance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*inserts or update unaccounted variances from itab&lt;/P&gt;&lt;P&gt;  MODIFY ztm0019 FROM TABLE t_ztm0019.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*deletes records from db table ztm0019 based on matching entries in itab&lt;/P&gt;&lt;P&gt;  DELETE ztm0019 FROM TABLE t_ztm_acc_variance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Mar 2006 01:17:27 GMT</pubDate>
    <dc:creator>aris_hidalgo</dc:creator>
    <dc:date>2006-03-13T01:17:27Z</dc:date>
    <item>
      <title>solutions regarding runtime error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/solutions-regarding-runtime-error/m-p/1287893#M154449</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 recently had my program transported on prod server and  the program produces a run time error. The error pointed out in my sort statement and when I checked the db table where I get the records I found out that it contains almost 3 million recs. So when I sort the itab it causes the run time error. i have posted below my code so you guys can check it out. Any suggestions and comments would be highly appreciated. Thanks a lot guys and take care!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*get all records from table ztm0019 and append to itab.&lt;/P&gt;&lt;P&gt;  SELECT * FROM ztm0019&lt;/P&gt;&lt;P&gt;  APPENDING TABLE t_ztm0019.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*populate itab t_ztm0019_tmp.&lt;/P&gt;&lt;P&gt;  t_ztm0019_tmp[] = t_ztm0019[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR t_ztm0019[].&lt;/P&gt;&lt;P&gt;*sort itab according to latest date and time grouped by serial no.&lt;/P&gt;&lt;P&gt;  SORT t_ztm0019_tmp BY sernr datum DESCENDING uzeit DESCENDING.    "--&amp;gt; here is the error occurs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DELETE ADJACENT DUPLICATES FROM t_ztm0019_tmp COMPARING&lt;/P&gt;&lt;P&gt;                                                         sernr&lt;/P&gt;&lt;P&gt;                                                         bwart&lt;/P&gt;&lt;P&gt;                                                         mblnr.&lt;/P&gt;&lt;P&gt;  LOOP AT t_ztm0019_tmp.&lt;/P&gt;&lt;P&gt;*read first record from itab.&lt;/P&gt;&lt;P&gt;    READ TABLE t_ztm0019_tmp INDEX sy-index.&lt;/P&gt;&lt;P&gt;    IF t_ztm0019_tmp-bwart EQ '702'&lt;/P&gt;&lt;P&gt;      OR t_ztm0019_tmp-bwart EQ '708'&lt;/P&gt;&lt;P&gt;      OR t_ztm0019_tmp-bwart EQ '712'&lt;/P&gt;&lt;P&gt;      OR t_ztm0019_tmp-bwart EQ '718'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      LOOP AT t_ztm0019_tmp WHERE sernr = t_ztm0019_tmp-sernr.&lt;/P&gt;&lt;P&gt;        APPEND t_ztm0019_tmp TO t_ztm_acc_variance.&lt;/P&gt;&lt;P&gt;        CLEAR  t_ztm0019_tmp.&lt;/P&gt;&lt;P&gt;        DELETE t_ztm0019_tmp.&lt;/P&gt;&lt;P&gt;      ENDLOOP.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      APPEND t_ztm0019_tmp TO t_ztm0019.&lt;/P&gt;&lt;P&gt;      CLEAR t_ztm0019_tmp.&lt;/P&gt;&lt;P&gt;      DELETE t_ztm0019_tmp.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    CONTINUE.      " Go for next SERNR&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*inserts or updates records in db table ztm_acc_variance based on itab&lt;/P&gt;&lt;P&gt;  MODIFY ztm_acc_variance FROM TABLE t_ztm_acc_variance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*inserts or update unaccounted variances from itab&lt;/P&gt;&lt;P&gt;  MODIFY ztm0019 FROM TABLE t_ztm0019.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*deletes records from db table ztm0019 based on matching entries in itab&lt;/P&gt;&lt;P&gt;  DELETE ztm0019 FROM TABLE t_ztm_acc_variance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Mar 2006 01:17:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/solutions-regarding-runtime-error/m-p/1287893#M154449</guid>
      <dc:creator>aris_hidalgo</dc:creator>
      <dc:date>2006-03-13T01:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: solutions regarding runtime error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/solutions-regarding-runtime-error/m-p/1287894#M154450</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;May be you can avoid the SORT by declaring the internal table t_ztm0019 as a SORTED Table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suresh Datti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Mar 2006 01:24:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/solutions-regarding-runtime-error/m-p/1287894#M154450</guid>
      <dc:creator>suresh_datti</dc:creator>
      <dc:date>2006-03-13T01:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: solutions regarding runtime error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/solutions-regarding-runtime-error/m-p/1287895#M154451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suresh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Howe can I make my itab as a sorted table? Also, If you notice my select statement above, the itab already has a record and I am appending all the records from the db table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Mar 2006 01:30:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/solutions-regarding-runtime-error/m-p/1287895#M154451</guid>
      <dc:creator>aris_hidalgo</dc:creator>
      <dc:date>2006-03-13T01:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: solutions regarding runtime error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/solutions-regarding-runtime-error/m-p/1287896#M154452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the error?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Mar 2006 01:31:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/solutions-regarding-runtime-error/m-p/1287896#M154452</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-13T01:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: solutions regarding runtime error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/solutions-regarding-runtime-error/m-p/1287897#M154453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Viray,&lt;/P&gt;&lt;P&gt;  if you think that gives you problem..&lt;/P&gt;&lt;P&gt; then try this,,&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT * FROM ztm0019
APPENDING TABLE t_ztm0019.

*populate itab t_ztm0019_tmp.
loop at t_ztm0019.
  APPEND t_ztm0019 TO t_ztm0019_tmp SORTED BY sernr datum .
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here it is sorted by  descending order ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;satesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Mar 2006 01:36:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/solutions-regarding-runtime-error/m-p/1287897#M154453</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-13T01:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: solutions regarding runtime error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/solutions-regarding-runtime-error/m-p/1287898#M154454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is the error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The current ABAP/4 program was meant to sort a dataset (internal table or extract) for reasons of capacity, this was not possible due to to insufficient main storage space. Therefore, the external sort was called and resulted in the follwing error: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the system could not write the sorted file to the temporary file /usr/sap/prd...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Mar 2006 01:46:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/solutions-regarding-runtime-error/m-p/1287898#M154454</guid>
      <dc:creator>aris_hidalgo</dc:creator>
      <dc:date>2006-03-13T01:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: solutions regarding runtime error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/solutions-regarding-runtime-error/m-p/1287899#M154455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Viray,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your production system does not have enough physical (or available) memory at the time that you are running your program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If possible, run the program on a specific server that has a larger amount of memory (or ask your company to buy more memory... good luck).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or... if possible, reduce the fields that are returned from your SELECT statement.  If not ALL of them are required in your business logic, you can reduce memory usage dramatically (especially with 3M+ records) when you only return the required fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Meaning instead of - &lt;/P&gt;&lt;P&gt;SELECT * from ZXXXXXX&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do a &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT FIELD1 FIELD2 FIELD3 FIELD4 from ZXXXXX&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Mar 2006 02:05:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/solutions-regarding-runtime-error/m-p/1287899#M154455</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-13T02:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: solutions regarding runtime error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/solutions-regarding-runtime-error/m-p/1287900#M154456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OR....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you could try to select into 2 separate internal tables.  In these SELECTS, use the ORDER BY clause to make the DB server do the sorting for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This MIGHT still not work if your app servers are weak, though.  But it is worth a try.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points accordingly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Mar 2006 02:07:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/solutions-regarding-runtime-error/m-p/1287900#M154456</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-13T02:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: solutions regarding runtime error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/solutions-regarding-runtime-error/m-p/1287901#M154457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI viraylab,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   I think that your program is not any issue. If you can run it in your development server but it not display any error. I agree with John's  viewpoint. I think you should connect with your basic. good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Mar 2006 02:34:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/solutions-regarding-runtime-error/m-p/1287901#M154457</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-13T02:34:22Z</dc:date>
    </item>
  </channel>
</rss>

