<?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: Performance tuning on this code in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-this-code/m-p/5096545#M1182823</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Fetch data from the Database table without the where condition.&lt;/P&gt;&lt;P&gt;I.E.&lt;/P&gt;&lt;P&gt;SELECT vbeln vbtyp_n vbtyp_v vbelv&lt;/P&gt;&lt;P&gt;INTO TABLE lt_vbfa1 FROM vbfa&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN lt_vbrp&lt;/P&gt;&lt;P&gt;WHERE vbeln = lt_vbrp-vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once that data is fetch use IF condition in loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP at &amp;lt;ITAB&amp;gt;.&lt;/P&gt;&lt;P&gt;IF &amp;lt;ITAB&amp;gt;-vbtyp_n IN ('N','S')&lt;/P&gt;&lt;P&gt;   AND &amp;lt;ITAB&amp;gt;-vbtyp_v IN ('M','P','O').&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;With above code Search in the database will be reduced...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will solve the performance isse...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Feb 2009 05:28:55 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-02-05T05:28:55Z</dc:date>
    <item>
      <title>Performance tuning on this code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-this-code/m-p/5096543#M1182821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This piece of coding is taking ages to execute, any idea how can i fine tune it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT vbeln vbtyp_n vbtyp_v vbelv&lt;/P&gt;&lt;P&gt;      INTO TABLE lt_vbfa1 FROM vbfa&lt;/P&gt;&lt;P&gt;      FOR ALL ENTRIES IN lt_vbrp&lt;/P&gt;&lt;P&gt;      WHERE vbeln = lt_vbrp-vbeln&lt;/P&gt;&lt;P&gt;        AND vbtyp_n IN ('N','S')&lt;/P&gt;&lt;P&gt;        AND vbtyp_v IN ('M','P','O').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 01:25:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-this-code/m-p/5096543#M1182821</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-05T01:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: Performance tuning on this code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-this-code/m-p/5096544#M1182822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;GOOD MORNING BRO...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try out this one and check performance..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT vbelv vbeln vbtyp_n vbtyp_v &lt;/P&gt;&lt;P&gt;INTO TABLE lt_vbfa1 FROM vbfa&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN lt_vbrp&lt;/P&gt;&lt;P&gt;WHERE vbeln = lt_vbrp-vbeln&lt;/P&gt;&lt;P&gt;AND vbtyp_n IN ('N','S')&lt;/P&gt;&lt;P&gt;AND vbtyp_v IN ('M','P','O').&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 04:37:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-this-code/m-p/5096544#M1182822</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-05T04:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: Performance tuning on this code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-this-code/m-p/5096545#M1182823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Fetch data from the Database table without the where condition.&lt;/P&gt;&lt;P&gt;I.E.&lt;/P&gt;&lt;P&gt;SELECT vbeln vbtyp_n vbtyp_v vbelv&lt;/P&gt;&lt;P&gt;INTO TABLE lt_vbfa1 FROM vbfa&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN lt_vbrp&lt;/P&gt;&lt;P&gt;WHERE vbeln = lt_vbrp-vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once that data is fetch use IF condition in loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP at &amp;lt;ITAB&amp;gt;.&lt;/P&gt;&lt;P&gt;IF &amp;lt;ITAB&amp;gt;-vbtyp_n IN ('N','S')&lt;/P&gt;&lt;P&gt;   AND &amp;lt;ITAB&amp;gt;-vbtyp_v IN ('M','P','O').&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;With above code Search in the database will be reduced...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will solve the performance isse...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 05:28:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-this-code/m-p/5096545#M1182823</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-05T05:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: Performance tuning on this code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-this-code/m-p/5096546#M1182824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Table VBFA (sales document flow) is to be used to find preceding documents, like cancelation invoices for an invoice.&lt;/P&gt;&lt;P&gt;Here original documents are to be found for a preceding document. Then it's better not to use table VBFA because its key is original document number. Then try to use VBRP-VGBEL (preceding document) or VBRP-AUBEL (preceding sales order). Here something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT vbrk~vbeln vbrk~vbtyp vbrp~vgtyp vbrp~vgbel
INTO TABLE lt_vbfa1
FROM vbrk INNER JOIN vbrp ON vbrk~vbeln EQ vbrp~vbeln
FOR ALL ENTRIES IN lt_vbrp
WHERE vbrk~vbeln = lt_vbrp-vbeln
AND   vbrp~posnr = lt_vbrp-posnr
AND   vbrk~vbtyp IN ('N','S')
AND   vbrp~vgtyp IN ('M','P','O').&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards Jack&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 06:06:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-this-code/m-p/5096546#M1182824</guid>
      <dc:creator>JackGraus</dc:creator>
      <dc:date>2009-02-05T06:06:50Z</dc:date>
    </item>
  </channel>
</rss>

