<?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 performance issue with the code in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-the-code/m-p/5978454#M1340403</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 have below code.for printing it is taking enough time..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which way i can improve the performance of below piece of code and what changes i will do for improving performance??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kindly help me..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form get_komgd.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  tables: kotd994.                     "kondd&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data : tfill_auswahl type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data: begin of auswahl occurs 10,&lt;/P&gt;&lt;P&gt;           kappl like kotd994-kappl ,&lt;/P&gt;&lt;P&gt;           kschl like kotd994-kschl ,&lt;/P&gt;&lt;P&gt;           vkorg like kotd994-vkorg ,&lt;/P&gt;&lt;P&gt;           vtweg like kotd994-vtweg ,&lt;/P&gt;&lt;P&gt;           spart like kotd994-spart ,&lt;/P&gt;&lt;P&gt;           kvgr1 like kotd994-kvgr1 ,&lt;/P&gt;&lt;P&gt;           matwa like kotd994-matwa ,&lt;/P&gt;&lt;P&gt;           datbi like kotd994-datbi ,&lt;/P&gt;&lt;P&gt;           datab like kotd994-datab ,&lt;/P&gt;&lt;P&gt;           knumh like kotd994-knumh ,&lt;/P&gt;&lt;P&gt;           smatn like kondd-smatn,&lt;/P&gt;&lt;P&gt;           meins like kondd-meins,&lt;/P&gt;&lt;P&gt;             sugrd like kondd-sugrd,&lt;/P&gt;&lt;P&gt;     end of auswahl.&lt;/P&gt;&lt;P&gt;  tables: kondd.&lt;/P&gt;&lt;P&gt;  select * from  kondd&lt;/P&gt;&lt;P&gt;         where  smatn       = ltap-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    select * from  kotd994&lt;/P&gt;&lt;P&gt;           where  kappl       = 'V'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;         and    kschl       = vbak-kschl&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;           and    vkorg       = vbak-vkorg&lt;/P&gt;&lt;P&gt;           and    vtweg       = vbak-vtweg&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     and    spart       = vbak-spart&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;           and    kvgr1       = vbak-kvgr1&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     and    matwa       = vbak-matwa&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;           and    datbi       &amp;gt;= sy-datum&lt;/P&gt;&lt;P&gt;           and    datab       &amp;lt;= sy-datum&lt;/P&gt;&lt;P&gt;           and    knumh       = kondd-knumh    .&lt;/P&gt;&lt;P&gt;    endselect.&lt;/P&gt;&lt;P&gt;    if sy-subrc = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   and kotd994-kvgr1(1) = 'Z'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      move-corresponding kotd994 to auswahl.&lt;/P&gt;&lt;P&gt;      move-corresponding kondd to auswahl.&lt;/P&gt;&lt;P&gt;      append auswahl   .&lt;/P&gt;&lt;P&gt;    endif.                             " sy-subrc = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;write: / auswahl.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  endselect.&lt;/P&gt;&lt;P&gt;  describe table auswahl lines tfill_auswahl.&lt;/P&gt;&lt;P&gt;  if tfill_auswahl = 1.&lt;/P&gt;&lt;P&gt;    komgd-matwa = auswahl-matwa.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    clear komgd-matwa.&lt;/P&gt;&lt;P&gt;  endif.                               " tfill_auswahl = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                               " ZHX_GET_COSTUMER_NR&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Aug 2009 13:49:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-08-19T13:49:46Z</dc:date>
    <item>
      <title>performance issue with the code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-the-code/m-p/5978454#M1340403</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 have below code.for printing it is taking enough time..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which way i can improve the performance of below piece of code and what changes i will do for improving performance??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kindly help me..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form get_komgd.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  tables: kotd994.                     "kondd&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data : tfill_auswahl type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data: begin of auswahl occurs 10,&lt;/P&gt;&lt;P&gt;           kappl like kotd994-kappl ,&lt;/P&gt;&lt;P&gt;           kschl like kotd994-kschl ,&lt;/P&gt;&lt;P&gt;           vkorg like kotd994-vkorg ,&lt;/P&gt;&lt;P&gt;           vtweg like kotd994-vtweg ,&lt;/P&gt;&lt;P&gt;           spart like kotd994-spart ,&lt;/P&gt;&lt;P&gt;           kvgr1 like kotd994-kvgr1 ,&lt;/P&gt;&lt;P&gt;           matwa like kotd994-matwa ,&lt;/P&gt;&lt;P&gt;           datbi like kotd994-datbi ,&lt;/P&gt;&lt;P&gt;           datab like kotd994-datab ,&lt;/P&gt;&lt;P&gt;           knumh like kotd994-knumh ,&lt;/P&gt;&lt;P&gt;           smatn like kondd-smatn,&lt;/P&gt;&lt;P&gt;           meins like kondd-meins,&lt;/P&gt;&lt;P&gt;             sugrd like kondd-sugrd,&lt;/P&gt;&lt;P&gt;     end of auswahl.&lt;/P&gt;&lt;P&gt;  tables: kondd.&lt;/P&gt;&lt;P&gt;  select * from  kondd&lt;/P&gt;&lt;P&gt;         where  smatn       = ltap-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    select * from  kotd994&lt;/P&gt;&lt;P&gt;           where  kappl       = 'V'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;         and    kschl       = vbak-kschl&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;           and    vkorg       = vbak-vkorg&lt;/P&gt;&lt;P&gt;           and    vtweg       = vbak-vtweg&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     and    spart       = vbak-spart&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;           and    kvgr1       = vbak-kvgr1&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     and    matwa       = vbak-matwa&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;           and    datbi       &amp;gt;= sy-datum&lt;/P&gt;&lt;P&gt;           and    datab       &amp;lt;= sy-datum&lt;/P&gt;&lt;P&gt;           and    knumh       = kondd-knumh    .&lt;/P&gt;&lt;P&gt;    endselect.&lt;/P&gt;&lt;P&gt;    if sy-subrc = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   and kotd994-kvgr1(1) = 'Z'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      move-corresponding kotd994 to auswahl.&lt;/P&gt;&lt;P&gt;      move-corresponding kondd to auswahl.&lt;/P&gt;&lt;P&gt;      append auswahl   .&lt;/P&gt;&lt;P&gt;    endif.                             " sy-subrc = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;write: / auswahl.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  endselect.&lt;/P&gt;&lt;P&gt;  describe table auswahl lines tfill_auswahl.&lt;/P&gt;&lt;P&gt;  if tfill_auswahl = 1.&lt;/P&gt;&lt;P&gt;    komgd-matwa = auswahl-matwa.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    clear komgd-matwa.&lt;/P&gt;&lt;P&gt;  endif.                               " tfill_auswahl = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                               " ZHX_GET_COSTUMER_NR&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2009 13:49:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-the-code/m-p/5978454#M1340403</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-19T13:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: performance issue with the code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-the-code/m-p/5978455#M1340404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
select * 
           from kondd
           where smatn = ltap-matnr.
 
    select *
              from kotd994
              where kappl = 'V'
* and kschl = vbak-kschl
              and vkorg = vbak-vkorg
              and vtweg = vbak-vtweg
* and spart = vbak-spart
              and kvgr1 = vbak-kvgr1
* and matwa = vbak-matwa
              and datbi &amp;gt;= sy-datum
              and datab &amp;lt;= sy-datum
              and knumh = kondd-knumh .
   endselect.
  if sy-subrc = 0.
* and kotd994-kvgr1(1) = 'Z'.
     move-corresponding kotd994 to auswahl.
     move-corresponding kondd to auswahl.
     append auswahl .
   endif. " sy-subrc = 0.

* write: / auswahl.
endselect.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is a typical nested loop, you should change it into a JOIN or use at least a FOR ALL ENTRIES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please change also the header line coding, it is hard to understand what is done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2009 13:59:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-the-code/m-p/5978455#M1340404</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-19T13:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: performance issue with the code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-the-code/m-p/5978456#M1340405</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;u r absolutely right ..can u analysis and  tell me what should i right??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please tell me the what changes i will do.?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how to break and use for all entries which u mentioned??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if u provide details, then may be i can really impliment the logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;awaiting for ur reply..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2009 14:04:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-the-code/m-p/5978456#M1340405</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-19T14:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: performance issue with the code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-the-code/m-p/5978457#M1340406</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;can somebody reply me..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2009 14:59:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-the-code/m-p/5978457#M1340406</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-19T14:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: performance issue with the code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-the-code/m-p/5978458#M1340407</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;Two important point to keep in mind before you write any select statement in ABAP:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Keep the database access less&lt;/P&gt;&lt;P&gt;2. Keep the amount of data transfer small&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well, to go with what has been suggested, you can make a local buffer of the kondd table and then you can run the 2nd select statement based on all the entries of the first table. But you need to look into the tables and need to decide which will be the best approach in this case. There are plenty of example available as to how to write for all entries. Also, you need to use the field symbols to speed up the processing of the statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, use a proper header line as this will make the code much more cleaner and easy to understand. &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;Samantak.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2009 15:49:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-the-code/m-p/5978458#M1340407</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-19T15:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: performance issue with the code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-the-code/m-p/5978459#M1340408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
select  .... speifiy need fields
           INTO corresponding fields of table auswahl.
           from kondd as a
           INNER JOIN  kotd994 as b
           ON b~knumh = a~knumh .
           where a~smatn = ltap-matnr.
           AND   b~kappl = 'V'
* and kschl = vbak-kschl
              and vkorg = vbak-vkorg
              and vtweg = vbak-vtweg
* and spart = vbak-spart
              and kvgr1 = vbak-kvgr1
* and matwa = vbak-matwa
              and datbi &amp;gt;= sy-datum
              and datab &amp;lt;= sy-datum.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check documentation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;add b~  and a~ in WHERE and in the fields you need&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2009 19:16:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-the-code/m-p/5978459#M1340408</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-19T19:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: performance issue with the code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-the-code/m-p/5978460#M1340409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lata,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try replacing the 2 select statements with the following join.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT  c~kappl
        c~kschl
        c~vkorg
        c~vtweg
        c~spart
        c~kvgr1
        c~matwa
        c~datbi
        c~datab
        c~knumh
        b~smatn
        b~meins
        b~sugrd
  FROM        vbap   AS a
  INNER JOIN kondd   AS b
  ON a~knumh EQ b~knumh
  INNER JOIN kotd994 AS c
  ON c~knumh EQ b~knumh
  INTO TABLE auswahl
  WHERE a~vbeln EQ vbak-vbeln
  AND   a~matnr EQ ltap-matnr
  AND   c~kappl EQ 'V'
  AND   c~vkorg EQ vbak-vkorg
  AND   c~vtweg EQ vbak-vtweg
  AND   c~kvgr1 EQ vbak-kvgr1
  AND   c~datbi GE sy-datum
  AND   c~datab LE sy-datum.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2009 20:20:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-the-code/m-p/5978460#M1340409</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-19T20:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: performance issue with the code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-the-code/m-p/5978461#M1340410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
 vbak-vbeln
  AND   a~matnr EQ ltap-matnr
  AND   c~kappl EQ 'V'
  AND   c~vkorg EQ vbak-vkorg
  AND   c~vtweg EQ vbak-vtweg
  AND   c~kvgr1 EQ vbak-kvgr1
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did not plan to invest much time in this thread, but you should post the more complete coding,&lt;/P&gt;&lt;P&gt;there are still two loop on itap and vbak ... open&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why don't you try all five tables into one big join! If the index relation is o.k., then it will work fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2009 10:58:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-the-code/m-p/5978461#M1340410</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-20T10:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: performance issue with the code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-the-code/m-p/5978462#M1340411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Siegfried,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lata has only provided us with the code in the subroutine, that is why I could not use VBAK in the query. I am not sure how she is quering VBAK or how the rest of her program is structured. I did not want to confuse her by making assumptions and adding hypothetical code. I merely tried to improve the code in the subroutine because that is what she has shared with us. Probably if she shares the rest of the code with us I could attempt to give a more complete solution. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However you are right. Leaving out VBAK from the join does not really make sense. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Never the less I am sure that this new join should run a lot faster than her original code given the fact that we are pretty much using primary keys in all the 3 tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2009 13:22:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-the-code/m-p/5978462#M1340411</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-20T13:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: performance issue with the code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-the-code/m-p/5978463#M1340412</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;Using two select statements will take more time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rather use this sample code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select *    from kondd in to corresponding fields of table auswahl&lt;/P&gt;&lt;P&gt;        where smatn = ltap-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    select *      from kotd994 into corresponding fields of auswahl&lt;/P&gt;&lt;P&gt;             for all entries of auswahl&lt;/P&gt;&lt;P&gt;              where kappl = 'V'&lt;/P&gt;&lt;P&gt;              and vkorg = vbak-vkorg&lt;/P&gt;&lt;P&gt;              and vtweg = vbak-vtweg&lt;/P&gt;&lt;P&gt;              and kvgr1 = vbak-kvgr1&lt;/P&gt;&lt;P&gt;              and datbi &amp;gt;= sy-datum&lt;/P&gt;&lt;P&gt;              and datab &amp;lt;= sy-datum&lt;/P&gt;&lt;P&gt;              and knumh = auswahl-knumh .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;however, in the structure of auswahl maintain the field of knumh as well, so that we can pass the values in the second select directly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will improve the performance very well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if possible, try and use the primary key combinations in the where clause while extracting the data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Aug 2009 17:59:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-the-code/m-p/5978463#M1340412</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-21T17:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: performance issue with the code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-the-code/m-p/5978464#M1340413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using two select statements will take more time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rather use this sample code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... what follows are 2 select statements &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Aug 2009 14:51:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-the-code/m-p/5978464#M1340413</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-22T14:51:47Z</dc:date>
    </item>
  </channel>
</rss>

