<?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: select statement from vbak - optimization technique in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-from-vbak-optimization-technique/m-p/5773502#M1307006</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;The secondary index is already available as it is, I mentioned in the second select statement. Still the performance issue is not resolved .&lt;/P&gt;&lt;P&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;&lt;/P&gt;&lt;P&gt;dinesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Jun 2009 09:56:57 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-06-29T09:56:57Z</dc:date>
    <item>
      <title>select statement from vbak - optimization technique</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-from-vbak-optimization-technique/m-p/5773500#M1307004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to modify the select statement due to the performance issue, related to the SQL Trace Performance sheet&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT vbeln&lt;/P&gt;&lt;P&gt;         vkorg&lt;/P&gt;&lt;P&gt;         vtweg&lt;/P&gt;&lt;P&gt;         spart&lt;/P&gt;&lt;P&gt;         kunnr&lt;/P&gt;&lt;P&gt;         erdat&lt;/P&gt;&lt;P&gt;    FROM vbak&lt;/P&gt;&lt;P&gt;    INTO TABLE t_vbak&lt;/P&gt;&lt;P&gt;   WHERE vkorg IN s_vkorg&lt;/P&gt;&lt;P&gt;     AND vtweg IN s_vtweg&lt;/P&gt;&lt;P&gt;     AND spart IN s_spart&lt;/P&gt;&lt;P&gt;     AND kunnr IN s_kunnr&lt;/P&gt;&lt;P&gt;     AND erdat IN s_erdat&lt;/P&gt;&lt;P&gt;     AND erzet IN s_erzet&lt;/P&gt;&lt;P&gt;     AND vsbed IN s_vsbed&lt;/P&gt;&lt;P&gt;     AND bsark IN s_bsark.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the select statement, I need to modify.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried with the index, which is available in our dev system. Still the issue is not resolved. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select in accordance with the Index,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT vbeln&lt;/P&gt;&lt;P&gt;         erdat&lt;/P&gt;&lt;P&gt;         erzet&lt;/P&gt;&lt;P&gt;         vkorg&lt;/P&gt;&lt;P&gt;         vtweg&lt;/P&gt;&lt;P&gt;         spart&lt;/P&gt;&lt;P&gt;         vsbed&lt;/P&gt;&lt;P&gt;         bsark&lt;/P&gt;&lt;P&gt;    FROM vbak&lt;/P&gt;&lt;P&gt;    INTO CORRESPONDING FIELDS OF TABLE t_vbak&lt;/P&gt;&lt;P&gt;   WHERE vkorg IN s_vkorg&lt;/P&gt;&lt;P&gt;     AND vtweg IN s_vtweg&lt;/P&gt;&lt;P&gt;     AND erdat IN s_erdat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please note that in these select statements, I cannot use VBELN in the where clause, since I need to fetch the orders based on the selection screen criteria. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly sugest me, is there any FM, which I can use to fetch the orders.&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;&lt;/P&gt;&lt;P&gt;dinesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2009 09:42:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-from-vbak-optimization-technique/m-p/5773500#M1307004</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-29T09:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: select statement from vbak - optimization technique</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-from-vbak-optimization-technique/m-p/5773501#M1307005</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;You can craete the secondary indexes for table VBAK as per your selection entry. It will reduce a lot of time while fetching the data from database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nrusingha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2009 09:51:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-from-vbak-optimization-technique/m-p/5773501#M1307005</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-29T09:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: select statement from vbak - optimization technique</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-from-vbak-optimization-technique/m-p/5773502#M1307006</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;The secondary index is already available as it is, I mentioned in the second select statement. Still the performance issue is not resolved .&lt;/P&gt;&lt;P&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;&lt;/P&gt;&lt;P&gt;dinesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2009 09:56:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-from-vbak-optimization-technique/m-p/5773502#M1307006</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-29T09:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: select statement from vbak - optimization technique</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-from-vbak-optimization-technique/m-p/5773503#M1307007</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;There is a standard transaction VA05 where you can get the all your require details. It may some how help you to get the tables from where it is picking. Check this....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nrusingha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2009 10:23:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-from-vbak-optimization-technique/m-p/5773503#M1307007</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-29T10:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: select statement from vbak - optimization technique</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-from-vbak-optimization-technique/m-p/5773504#M1307008</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;Either you can use secondary index or you can create new index as per your query.&lt;/P&gt;&lt;P&gt;Other than this you can minimise the where clause conditions like creation date and time.&lt;/P&gt;&lt;P&gt;use DELETE Command for that after the query as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE T_VBAK where not erdat in s_erdat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will pas load on ABAP and not on DB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds,&lt;/P&gt;&lt;P&gt;Anil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2009 10:46:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-from-vbak-optimization-technique/m-p/5773504#M1307008</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-29T10:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: select statement from vbak - optimization technique</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-from-vbak-optimization-technique/m-p/5773505#M1307009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Dinesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Probably what you can do is declare a variable of type vbeln and write your select query as shown below.&lt;/P&gt;&lt;P&gt;This will eventually decrease the load on the VBAK table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First declare a variable like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data:v_vbeln TYPE vbeln VALUE IS INITIAL.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now write the select query and see the performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT 

vbeln
vkorg
vtweg
spart
kunnr
erdat

FROM vbak

INTO TABLE t_vbak

WHERE 

vbeln ge v_vbeln

AND vkorg IN s_vkorg
AND vtweg IN s_vtweg
AND spart IN s_spart
AND kunnr IN s_kunnr
AND erdat IN s_erdat
AND erzet IN s_erzet
AND vsbed IN s_vsbed
AND bsark IN s_bsark.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you got it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Babu Kilari&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2009 12:12:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-from-vbak-optimization-technique/m-p/5773505#M1307009</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-29T12:12:38Z</dc:date>
    </item>
  </channel>
</rss>

