<?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 Performance in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance/m-p/6517192#M1424484</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;This code can be enhanced in following ways:&lt;/P&gt;&lt;P&gt;1. Define internal table with only desired field.&lt;/P&gt;&lt;P&gt;2. Select only the desired field from table /BI0/PHC_PATCASE. &lt;/P&gt;&lt;P&gt;3. Select the fields in a sequence and hence remove 'into corresponding fields of it_case' to 'into it_case'.&lt;/P&gt;&lt;P&gt;4. If only one record have to be selected, then remove ORDER BY syntax.&lt;/P&gt;&lt;P&gt;4. If you are selecting one row from table, then select the data into work area instead of internal table.&lt;/P&gt;&lt;P&gt;5. Create indexes on table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this will help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;&lt;STRONG&gt;&amp;lt;REMOVED BY MODERATOR - REQUEST OR OFFER POINTS ARE FORBIDDEN&amp;gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alvaro Tejada Galindo on Jan 12, 2010 10:53 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Jan 2010 13:13:12 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-01-12T13:13:12Z</dc:date>
    <item>
      <title>SELECT Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance/m-p/6517191#M1424483</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;&lt;/P&gt;&lt;P&gt;I only one to select the first line:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      select *&lt;/P&gt;&lt;P&gt;      from /BI0/PHC_PATCASE UP TO 1 ROWS&lt;/P&gt;&lt;P&gt;      into corresponding fields of it_case&lt;/P&gt;&lt;P&gt;      where HC_INSTITU = lv_patcase-hc_institu&lt;/P&gt;&lt;P&gt;      AND HC_PATCASE &amp;lt; lv_patcase-hc_patcase&lt;/P&gt;&lt;P&gt;      AND HC_CASETP = lv_patcase-hc_casetp&lt;/P&gt;&lt;P&gt;      AND HC_PATIENT = lv_patcase-hc_patient&lt;/P&gt;&lt;P&gt;      AND OBJVERS = 'A'&lt;/P&gt;&lt;P&gt;      AND hc_disdate &amp;gt; lv_admdate30&lt;/P&gt;&lt;P&gt;      ORDER BY hc_disdate DESCENDING.&lt;/P&gt;&lt;P&gt;      endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But for one month, is spending a lot of time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SOmeone knows some way to performance it? Is not posible to create an index in the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks a lot!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jan 2010 12:39:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance/m-p/6517191#M1424483</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-12T12:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance/m-p/6517192#M1424484</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;This code can be enhanced in following ways:&lt;/P&gt;&lt;P&gt;1. Define internal table with only desired field.&lt;/P&gt;&lt;P&gt;2. Select only the desired field from table /BI0/PHC_PATCASE. &lt;/P&gt;&lt;P&gt;3. Select the fields in a sequence and hence remove 'into corresponding fields of it_case' to 'into it_case'.&lt;/P&gt;&lt;P&gt;4. If only one record have to be selected, then remove ORDER BY syntax.&lt;/P&gt;&lt;P&gt;4. If you are selecting one row from table, then select the data into work area instead of internal table.&lt;/P&gt;&lt;P&gt;5. Create indexes on table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this will help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;&lt;STRONG&gt;&amp;lt;REMOVED BY MODERATOR - REQUEST OR OFFER POINTS ARE FORBIDDEN&amp;gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alvaro Tejada Galindo on Jan 12, 2010 10:53 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jan 2010 13:13:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance/m-p/6517192#M1424484</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-12T13:13:12Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance/m-p/6517193#M1424485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Markus&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before we actually create a secondary index on a table we should consider the overhead involved in maintaining the index. Hence i would suggest you to consider the following options,&lt;/P&gt;&lt;P&gt;1) Retrieve the information from the database table so that it uses the existing index, basically i mean to say re-phrase your where clause. That means remove the date criteria in the select, but once you have the data then filter it on the date criteria.&lt;/P&gt;&lt;P&gt;2) Remove into Corresponding, Order By clauses.&lt;/P&gt;&lt;P&gt;3) Instead of Up to 1 rows, use into table itab and then filter the records in this internal table applying the date logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ranganath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jan 2010 13:18:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance/m-p/6517193#M1424485</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-12T13:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance/m-p/6517194#M1424486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use as many key fields as possible in WHERE clauses of SELECT statements. Sometimes you are not sure about the value of some key fields. They seem to be empty (Initial value) &lt;/P&gt;&lt;P&gt;Using the option GE (greater equal) in your coding can improve your performance considerably without the risk of table lines not being selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES: S001.&lt;/P&gt;&lt;P&gt;CONSTANTS: SSOUR_INI  LIKE S001-SSOUR VALUE   IS INITIAL,&lt;/P&gt;&lt;P&gt;           VRSIO_INI  LIKE S001-VRSIO VALUE   IS INITIAL,&lt;/P&gt;&lt;P&gt;           SPMON_INI  LIKE S001-SPMON VALUE   IS INITIAL,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;           SPTAG_INI  LIKE S001-SPTAG VALUE   IS INITIAL,&lt;/P&gt;&lt;P&gt;           SPWOC_INI  LIKE S001-SPWOC VALUE   IS INITIAL,&lt;/P&gt;&lt;P&gt;           SPBUP_INI  LIKE S001-SPBUP VALUE   IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS:&lt;/P&gt;&lt;P&gt;              SO_SPTAG   FOR S001-SPTAG OBLIGATORY,&lt;/P&gt;&lt;P&gt;              SO_KUNNR   FOR S001-KUNNR OBLIGATORY,&lt;/P&gt;&lt;P&gt;              SO_VKORG   FOR S001-VKORG OBLIGATORY,&lt;/P&gt;&lt;P&gt;              SO_VTWEG   FOR S001-VTWEG OBLIGATORY,&lt;/P&gt;&lt;P&gt;              SO_SPART   FOR S001-SPART OBLIGATORY,&lt;/P&gt;&lt;P&gt;              SO_MATNR   FOR S001-MATNR OBLIGATORY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT        * FROM  S001&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       INTO TABLE TA_S001&lt;/P&gt;&lt;P&gt;       WHERE  SSOUR  GE SSOUR_INI     "Greater Equal initial value&lt;/P&gt;&lt;P&gt;       AND    VRSIO  GE VRSIO_INI     "   idem&lt;/P&gt;&lt;P&gt;       AND    SPMON  GE SPMON_INI     "   idem&lt;/P&gt;&lt;P&gt;       AND    SPTAG  IN SO_SPTAG&lt;/P&gt;&lt;P&gt;       AND    SPWOC  GE SPWOC_INI     "   idem&lt;/P&gt;&lt;P&gt;       AND    SPBUP  GE SPBUP_INI     "   idem&lt;/P&gt;&lt;P&gt;       AND    KUNNR  IN SO_KUNNR&lt;/P&gt;&lt;P&gt;       AND    VKORG  IN SO_VKORG&lt;/P&gt;&lt;P&gt;       AND    VTWEG  IN SO_VTWEG&lt;/P&gt;&lt;P&gt;       AND    SPART  IN SO_SPART&lt;/P&gt;&lt;P&gt;       AND    MATNR  IN SO_MATNR.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jan 2010 13:46:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance/m-p/6517194#M1424486</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-12T13:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance/m-p/6517195#M1424487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Simply put...don't use SELECT-ENDSELECT, don't use SELECT *, don't use INTO CORRESPONDING FIELDS...and look for the table keys...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Blag.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jan 2010 15:56:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance/m-p/6517195#M1424487</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-12T15:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance/m-p/6517196#M1424488</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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before you start with the performance improvement program, first measure the time of the select query. You can use the SQL trace (ST05) to start with the measure. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the ABAP    Performance Guidelines you can use the following things:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Don't use the SELECT *. Mention as many fields in the select options. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Create an internal table with the only needed fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. See whether the Table is buffered or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. Use any existing index with the most of the Primary key fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then after all the changes you have to measure the performance to really see the percentage improvement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Samantak.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jan 2010 16:14:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance/m-p/6517196#M1424488</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-12T16:14:13Z</dc:date>
    </item>
  </channel>
</rss>

