<?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 Improve performance code in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/improve-performance-code/m-p/12622338#M2012780</link>
    <description>&lt;P&gt;Hi guys &lt;/P&gt;
  &lt;P&gt;When going through the loop (I put the attachment) it takes a while and there is a time out error. I researched ways to improve performance and I wanted to know if you can give suggestions by looking at the attached code.&lt;/P&gt;
  &lt;P&gt;Thanks &lt;A href="https://answers.sap.com/storage/temp/2074513-loop.txt" data-attachment="2074513"&gt;loop.txt&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Jul 2022 21:02:44 GMT</pubDate>
    <dc:creator>ronaldo_aparecido</dc:creator>
    <dc:date>2022-07-15T21:02:44Z</dc:date>
    <item>
      <title>Improve performance code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/improve-performance-code/m-p/12622338#M2012780</link>
      <description>&lt;P&gt;Hi guys &lt;/P&gt;
  &lt;P&gt;When going through the loop (I put the attachment) it takes a while and there is a time out error. I researched ways to improve performance and I wanted to know if you can give suggestions by looking at the attached code.&lt;/P&gt;
  &lt;P&gt;Thanks &lt;A href="https://answers.sap.com/storage/temp/2074513-loop.txt" data-attachment="2074513"&gt;loop.txt&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jul 2022 21:02:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/improve-performance-code/m-p/12622338#M2012780</guid>
      <dc:creator>ronaldo_aparecido</dc:creator>
      <dc:date>2022-07-15T21:02:44Z</dc:date>
    </item>
    <item>
      <title>Re: Improve performance code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/improve-performance-code/m-p/12622339#M2012781</link>
      <description>&lt;P&gt;Start by moving your SELECT outside the LOOP.&lt;/P&gt;&lt;P&gt;After that, use SAT to know what needs to be optimized.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jul 2022 05:34:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/improve-performance-code/m-p/12622339#M2012781</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-07-16T05:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: Improve performance code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/improve-performance-code/m-p/12622340#M2012782</link>
      <description>&lt;P&gt;The code is complicated.&lt;BR /&gt;For example, there are two SELECT FOR ALL ENTRIES : you should ensure that there are no duplicates regarding the WHERE clause&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*          SELECT bukrs belnr gjahr budat xblnr cpudt cputm usnam tcode stblg bktxt kursf glvor awtyp awkey&lt;BR /&gt;*            APPENDING TABLE t_bkpf*&lt;BR /&gt;*            FROM bkpf&lt;BR /&gt;*            FOR ALL ENTRIES IN t_ztbfi905&lt;BR /&gt;*            WHERE bukrs EQ t_ztbfi905-bukrs_bsik&lt;BR /&gt;*              AND belnr EQ t_ztbfi905-n_doc&lt;BR /&gt;*              AND gjahr EQ t_ztbfi905-ano_n_doc.
t_ztbfi905_tmp[] = t_ztbfi905[].
SORT t_ztbfi905_tmp[]                                 BY bukrs_bsik n_doc ano_n_doc.
DELETE ADJACENT DUPLICATES FROM t_ztbfi905_tmp COMPARING bukrs_bsik n_doc ano_n_doc.

          SELECT bukrs belnr gjahr budat xblnr cpudt cputm usnam tcode stblg bktxt kursf glvor awtyp awkey&lt;BR /&gt;            APPENDING TABLE t_bkpf*&lt;BR /&gt;            FROM bkpf&lt;BR /&gt;            FOR ALL ENTRIES IN t_ztbfi905_tmp&lt;BR /&gt;            WHERE bukrs EQ t_ztbfi905_tmp-bukrs_bsik&lt;BR /&gt;              AND belnr EQ t_ztbfi905_tmp-n_doc&lt;BR /&gt;              AND gjahr EQ t_ztbfi905_tmp-ano_n_doc.

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 16 Jul 2022 17:30:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/improve-performance-code/m-p/12622340#M2012782</guid>
      <dc:creator>chaouki_akir</dc:creator>
      <dc:date>2022-07-16T17:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Improve performance code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/improve-performance-code/m-p/12622341#M2012783</link>
      <description>&lt;P&gt;Hi &lt;SPAN class="mention-scrubbed"&gt;ronaldo.aparecido&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;you use several loops and combine them. Please check if you can join them in the SQL query.&lt;/P&gt;&lt;P&gt;If you need lookup tables, try to use hash tables with unique keys.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Thorsten&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jul 2022 18:27:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/improve-performance-code/m-p/12622341#M2012783</guid>
      <dc:creator>ThorstenHoefer</dc:creator>
      <dc:date>2022-07-16T18:27:50Z</dc:date>
    </item>
    <item>
      <title>Re: Improve performance code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/improve-performance-code/m-p/12622342#M2012784</link>
      <description>&lt;P&gt;Before using FOR ALL ENRIES you check if internal table has value or not?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 01:35:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/improve-performance-code/m-p/12622342#M2012784</guid>
      <dc:creator>former_member808116</dc:creator>
      <dc:date>2022-08-05T01:35:01Z</dc:date>
    </item>
  </channel>
</rss>

