<?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: peformance tuning in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/peformance-tuning/m-p/1424753#M203646</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;lt;b&amp;gt;just  copy  and  paste  ...&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: begin of i_sales occurs 0,
vbeln like vbap-vbeln,
posnr like vbap-posnr,
charg like vbap-charg,
bwtar  like vbap-bwtar,
kunnr  like vbak-kunnr,
kwmeng like vbap-kwmeng,
vguid  like vlccuorder-vguid,
end of i_sales.

data:begin of itab occurs 0,
vbeln type vbeln,
vguid type vguid,
end of itab. 



select b~vbeln
b~posnr
b~charg
b~bwtar
c~kunnr
b~kwmeng
INTO TABLE i_sales
FROM vbap AS b
INNER JOIN vbak AS c
ON b~vbeln EQ c~vbeln
inner JOIN lqua AS d
ON b~charg = d~charg 

WHERE b~vbeln IN s_vbeln
AND c~kunnr IN s_kunnr
AND d~werks IN s_werks
AND c~auart EQ 'ZOR'
AND b~abgru EQ space.

if not i_sales[] is initial.
select vbeln vguid into table itab from vlccuorder
for all entries in i_sales
where vbeln = i_sales-vbeln.
endif.
sort itab .
loop at i_sales .
read table itab binary search with key vbeln = i_sales-vbeln
i_sales-vguid = itab-vguid.
modify i_sales.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Jul 2006 07:14:14 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-07-24T07:14:14Z</dc:date>
    <item>
      <title>peformance tuning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/peformance-tuning/m-p/1424746#M203639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi experts&lt;/P&gt;&lt;P&gt;i have got stuck in performance tuning osf one query&lt;/P&gt;&lt;P&gt;how can i tune this query by breaking it into two parts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT a~vguid&lt;/P&gt;&lt;P&gt;         b~vbeln&lt;/P&gt;&lt;P&gt;         b~posnr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         b~charg&lt;/P&gt;&lt;P&gt;         b~bwtar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         c~kunnr&lt;/P&gt;&lt;P&gt;         b~kwmeng&lt;/P&gt;&lt;P&gt;         INTO TABLE i_sales&lt;/P&gt;&lt;P&gt;         FROM vlccuorder AS a&lt;/P&gt;&lt;P&gt;         INNER JOIN vbap AS b&lt;/P&gt;&lt;P&gt;         ON ( a&lt;SUB&gt;vbeln EQ b&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;         AND  a&lt;SUB&gt;posnr EQ b&lt;/SUB&gt;posnr )&lt;/P&gt;&lt;P&gt;         INNER JOIN vbak AS c&lt;/P&gt;&lt;P&gt;         ON ( b&lt;SUB&gt;vbeln EQ c&lt;/SUB&gt;vbeln )&lt;/P&gt;&lt;P&gt;         JOIN lqua AS d&lt;/P&gt;&lt;P&gt;         ON ( b&lt;SUB&gt;charg EQ d&lt;/SUB&gt;charg )&lt;/P&gt;&lt;P&gt;         WHERE b~vbeln IN s_vbeln&lt;/P&gt;&lt;P&gt;           AND c~kunnr IN s_kunnr&lt;/P&gt;&lt;P&gt;           AND d~werks IN s_werks&lt;/P&gt;&lt;P&gt;            AND c~auart EQ 'ZOR'&lt;/P&gt;&lt;P&gt;            AND b~abgru EQ space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wherin primary key fields of tables are:&lt;/P&gt;&lt;P&gt;a)vlccuorder is  vguid&lt;/P&gt;&lt;P&gt;b)vbap  is vbeln and posnr&lt;/P&gt;&lt;P&gt;c)vbak  is vbeln&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>Mon, 24 Jul 2006 05:22:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/peformance-tuning/m-p/1424746#M203639</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-24T05:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: peformance tuning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/peformance-tuning/m-p/1424747#M203640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kunal , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first get the SO from VBAK+VBAP and then for &amp;lt;b&amp;gt;vlccuorder&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Prabhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jul 2006 05:26:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/peformance-tuning/m-p/1424747#M203640</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-24T05:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: peformance tuning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/peformance-tuning/m-p/1424748#M203641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kunal,&lt;/P&gt;&lt;P&gt;      Check whether you have used all the KEY FIELDS for Where Condition you hav eused in your Select Query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Prashanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jul 2006 05:29:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/peformance-tuning/m-p/1424748#M203641</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-24T05:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: peformance tuning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/peformance-tuning/m-p/1424749#M203642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the query fields in where condition are covered,&lt;/P&gt;&lt;P&gt;idea is i want to break two tables- vbap and vbak &lt;/P&gt;&lt;P&gt;by using "for all entries in" or may be "using corresponding fields of"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks if u can guide&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jul 2006 05:37:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/peformance-tuning/m-p/1424749#M203642</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-24T05:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: peformance tuning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/peformance-tuning/m-p/1424750#M203643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it will be helpful if u send me some doc. related that can be helpful.&lt;/P&gt;&lt;P&gt;please also tell me how to  use index in tuning a query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jul 2006 06:59:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/peformance-tuning/m-p/1424750#M203643</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-24T06:59:00Z</dc:date>
    </item>
    <item>
      <title>Re: peformance tuning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/peformance-tuning/m-p/1424751#M203644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Before advising on how to tune it would be helpful to know how many rows will there usually be in the result table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Will the s_ variables have many entries in them or just a few?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also how big is the table 'a'? i.e. how many rows in vlccuorder?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jul 2006 07:06:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/peformance-tuning/m-p/1424751#M203644</guid>
      <dc:creator>former_member186741</dc:creator>
      <dc:date>2006-07-24T07:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: peformance tuning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/peformance-tuning/m-p/1424752#M203645</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;Use The following logic;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select all the VBELN's and details on join of VBAK and VBAP into table itab. Do For All Entries on that ITAB to get the vguiid from vlccuorder into another table. Move all the entries of both the table to a final table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this Helps&lt;/P&gt;&lt;P&gt;Anirban&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jul 2006 07:09:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/peformance-tuning/m-p/1424752#M203645</guid>
      <dc:creator>former_member480923</dc:creator>
      <dc:date>2006-07-24T07:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: peformance tuning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/peformance-tuning/m-p/1424753#M203646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;lt;b&amp;gt;just  copy  and  paste  ...&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: begin of i_sales occurs 0,
vbeln like vbap-vbeln,
posnr like vbap-posnr,
charg like vbap-charg,
bwtar  like vbap-bwtar,
kunnr  like vbak-kunnr,
kwmeng like vbap-kwmeng,
vguid  like vlccuorder-vguid,
end of i_sales.

data:begin of itab occurs 0,
vbeln type vbeln,
vguid type vguid,
end of itab. 



select b~vbeln
b~posnr
b~charg
b~bwtar
c~kunnr
b~kwmeng
INTO TABLE i_sales
FROM vbap AS b
INNER JOIN vbak AS c
ON b~vbeln EQ c~vbeln
inner JOIN lqua AS d
ON b~charg = d~charg 

WHERE b~vbeln IN s_vbeln
AND c~kunnr IN s_kunnr
AND d~werks IN s_werks
AND c~auart EQ 'ZOR'
AND b~abgru EQ space.

if not i_sales[] is initial.
select vbeln vguid into table itab from vlccuorder
for all entries in i_sales
where vbeln = i_sales-vbeln.
endif.
sort itab .
loop at i_sales .
read table itab binary search with key vbeln = i_sales-vbeln
i_sales-vguid = itab-vguid.
modify i_sales.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jul 2006 07:14:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/peformance-tuning/m-p/1424753#M203646</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-24T07:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: peformance tuning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/peformance-tuning/m-p/1424754#M203647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;result table, u mean final result internal table will&lt;/P&gt;&lt;P&gt;be having  few entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table vlccuorder is having around 200 rows&lt;/P&gt;&lt;P&gt; vbap and vbpa tables are having entries around 800 each&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jul 2006 07:17:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/peformance-tuning/m-p/1424754#M203647</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-24T07:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: peformance tuning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/peformance-tuning/m-p/1424755#M203648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;with such low numbers I don't think the sql needs breaking up. I think it's just innefficient because the joins to LQUA is not specified at a low enough level AND does not specify the material, only the batch(CHARG) so hitting this table will be very inefficient. I also think it should be restructured to work down the hierarchy from top to bottom.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This might be better:&lt;/P&gt;&lt;P&gt;SELECT vlcc&lt;SUB&gt;vguid vbap&lt;/SUB&gt;vbeln vbap&lt;SUB&gt;posnr vbap&lt;/SUB&gt;charg&lt;/P&gt;&lt;P&gt; vbap&lt;SUB&gt;bwtar vbak&lt;/SUB&gt;kunnr vbap~kwmeng&lt;/P&gt;&lt;P&gt;INTO corresponding fields of TABLE i_sales&lt;/P&gt;&lt;P&gt;FROM &lt;/P&gt;&lt;P&gt;vlccuorder AS vlcc &lt;/P&gt;&lt;P&gt;INNER JOIN vbap &lt;/P&gt;&lt;P&gt;ON ( vlcc&lt;SUB&gt;vbeln EQ vbap&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;AND vlcc&lt;SUB&gt;posnr EQ vbap&lt;/SUB&gt;posnr )&lt;/P&gt;&lt;P&gt;INNER JOIN vbak &lt;/P&gt;&lt;P&gt;ON ( vbap&lt;SUB&gt;vbeln EQ vbak&lt;/SUB&gt;vbeln )&lt;/P&gt;&lt;P&gt;JOIN lqua &lt;/P&gt;&lt;P&gt;ON ( vbap&lt;SUB&gt;charg EQ lqua&lt;/SUB&gt;charg )&lt;/P&gt;&lt;P&gt;WHERE vbap~vbeln IN s_vbeln&lt;/P&gt;&lt;P&gt;AND vbak~kunnr IN s_kunnr&lt;/P&gt;&lt;P&gt;AND lqua~werks IN s_werks&lt;/P&gt;&lt;P&gt;AND vbak~auart EQ 'ZOR'&lt;/P&gt;&lt;P&gt;AND vbap~abgru EQ space.&lt;/P&gt;&lt;P&gt;FROM vbak&lt;/P&gt;&lt;P&gt;JOIN vbap &lt;/P&gt;&lt;P&gt;ON ( vbap&lt;SUB&gt;vbeln EQ vbak&lt;/SUB&gt;vbeln )&lt;/P&gt;&lt;P&gt;join vlccuorder as vlcc&lt;/P&gt;&lt;P&gt;ON ( vlcc&lt;SUB&gt;vbeln EQ vbap&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt; AND vlcc&lt;SUB&gt;posnr EQ vbap&lt;/SUB&gt;posnr )&lt;/P&gt;&lt;P&gt;JOIN lqua &lt;/P&gt;&lt;P&gt;ON ( lqua&lt;SUB&gt;matnr eq vbap&lt;/SUB&gt;matnr&lt;/P&gt;&lt;P&gt; and lqua&lt;SUB&gt;werks eq vbap&lt;/SUB&gt;werks&lt;/P&gt;&lt;P&gt; and lqua&lt;SUB&gt;charg EQ vbap&lt;/SUB&gt;charg )&lt;/P&gt;&lt;P&gt;WHERE vbak~vbeln IN s_vbeln&lt;/P&gt;&lt;P&gt;  AND vbak~kunnr IN s_kunnr&lt;/P&gt;&lt;P&gt;  AND vbak~auart EQ 'ZOR'&lt;/P&gt;&lt;P&gt;  AND vbap~abgru EQ space.&lt;/P&gt;&lt;P&gt;  AND vbap~werks IN s_werks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jul 2006 07:44:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/peformance-tuning/m-p/1424755#M203648</guid>
      <dc:creator>former_member186741</dc:creator>
      <dc:date>2006-07-24T07:44:00Z</dc:date>
    </item>
  </channel>
</rss>

