<?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 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning/m-p/2777264#M647375</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vind,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You just declare the table itab_mseg  with fields in the same order as like in the select statement. like lgort charg aufnr bwart erfmg matnr . change the order of fields in where condition like in table order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change the code as below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if not gt_cms006[] is  initial.

select bwart
         matnr
          lgort 
         charg
         erfmg
         aufnr           
         from mseg
 into table itab_mseg 
for all entries in gt_cms006 
where ( bwart = '261' or bwart = '101' or bwart = '102' )
and werks = gt_cms006-werks
and ( lgort = 'COIL' or lgort = 'FG01' )
and aufnr = gt_cms006-aufnr.

endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reward points if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Suma.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Sep 2007 13:23:59 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-05T13:23:59Z</dc:date>
    <item>
      <title>PERFORMANCE TUNING</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning/m-p/2777262#M647373</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;Req ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if p_comp eq 'X'.&lt;/P&gt;&lt;P&gt;    select * from ZTABLE into table gt_cms006&lt;/P&gt;&lt;P&gt;    where werks in s_werks&lt;/P&gt;&lt;P&gt;    and line  in s_line&lt;/P&gt;&lt;P&gt;    and aufnr in s_aufnr&lt;/P&gt;&lt;P&gt;    and matnr in s_matnr&lt;/P&gt;&lt;P&gt;    and charg in s_charg&lt;/P&gt;&lt;P&gt;    and block in s_block.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    select * from ZTABLE into table gt_cms006&lt;/P&gt;&lt;P&gt;    where werks in s_werks&lt;/P&gt;&lt;P&gt;    and line  in s_line&lt;/P&gt;&lt;P&gt;    and aufnr in s_aufnr&lt;/P&gt;&lt;P&gt;    and matnr in s_matnr&lt;/P&gt;&lt;P&gt;    and charg in s_charg&lt;/P&gt;&lt;P&gt;    and block in s_block&lt;/P&gt;&lt;P&gt;    and archive ne 'X'.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tables :  ZTABLE  has &amp;#145;aufnr&amp;#146; as key element &lt;/P&gt;&lt;P&gt;             MSEG key elements are &amp;#145;mblnr&amp;#146; , &amp;#145;mjahr &amp;#145; , &amp;#145;zeile&amp;#146;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note : The below statement is taking time to retrieve data  is there any other way to get it tuned ?? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select lgort charg aufnr bwart erfmg matnr from mseg into&lt;/P&gt;&lt;P&gt;      corresponding fields of table itab_mseg for all entries&lt;/P&gt;&lt;P&gt;          in gt_cms006 where  aufnr = gt_cms006-aufnr&lt;/P&gt;&lt;P&gt;                        and     werks = gt_cms006-werks&lt;/P&gt;&lt;P&gt;                        and  ( lgort = 'COIL' or lgort = 'FG01' )&lt;/P&gt;&lt;P&gt;               and ( bwart = '261' or bwart = '101' or bwart = '102' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vind&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2007 13:10:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning/m-p/2777262#M647373</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-05T13:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: PERFORMANCE TUNING</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning/m-p/2777263#M647374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check gt_cms006  is populated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use into TABLE instead of INTO CORRESPONDING...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 'or' statements will not help either.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2007 13:16:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning/m-p/2777263#M647374</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-05T13:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: PERFORMANCE TUNING</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning/m-p/2777264#M647375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vind,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You just declare the table itab_mseg  with fields in the same order as like in the select statement. like lgort charg aufnr bwart erfmg matnr . change the order of fields in where condition like in table order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change the code as below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if not gt_cms006[] is  initial.

select bwart
         matnr
          lgort 
         charg
         erfmg
         aufnr           
         from mseg
 into table itab_mseg 
for all entries in gt_cms006 
where ( bwart = '261' or bwart = '101' or bwart = '102' )
and werks = gt_cms006-werks
and ( lgort = 'COIL' or lgort = 'FG01' )
and aufnr = gt_cms006-aufnr.

endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reward points if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Suma.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2007 13:23:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning/m-p/2777264#M647375</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-05T13:23:59Z</dc:date>
    </item>
    <item>
      <title>Re: PERFORMANCE TUNING</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning/m-p/2777265#M647376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vind ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Avoid using 'into corresponding' instead use into table.&lt;/P&gt;&lt;P&gt;Keep where condition simple as -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select lgort charg aufnr bwart erfmg matnr from mseg into&lt;/P&gt;&lt;P&gt;corresponding fields of table itab_mseg for all entries&lt;/P&gt;&lt;P&gt;in gt_cms006 where aufnr = gt_cms006-aufnr&lt;/P&gt;&lt;P&gt;and werks = gt_cms006-werks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Define  ranges for lgort as r_lgort&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;You can delete the internal table once data is fetched as -&lt;/P&gt;&lt;P&gt;DELETE ITAB_MSEG WHERE  LGORT NOT IN R_LGORT  .&lt;/P&gt;&lt;P&gt;similarly define ranges for  bwart and delete itab_mseg using where condition as above. This will reduce load  on database while fetching data and performance will improve.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2007 13:45:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning/m-p/2777265#M647376</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-05T13:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: PERFORMANCE TUNING</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning/m-p/2777266#M647377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;1.when using for all entries , always check if table gt_cms006  is not initial.&lt;/P&gt;&lt;P&gt;2. Avoid into corresponding fields instead declare the internal table with the same structure of database table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2007 13:54:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning/m-p/2777266#M647377</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-05T13:54:58Z</dc:date>
    </item>
  </channel>
</rss>

