<?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 indexes in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/indexes/m-p/2809002#M656593</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;I am working on a report,where in I have to select the data from rbkp table.So I have coded a select statement which selects some fields from rbkp table using for all entries from gt_output(internal table).In the where conditons if I use key fields from rbkp table,values are not getting stored for these fields in gt_output table.In this case can I use indexes in where condition?if so,how can we know which is the suitable index to be used?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Hema&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Oct 2007 10:43:58 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-05T10:43:58Z</dc:date>
    <item>
      <title>indexes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/indexes/m-p/2809002#M656593</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;I am working on a report,where in I have to select the data from rbkp table.So I have coded a select statement which selects some fields from rbkp table using for all entries from gt_output(internal table).In the where conditons if I use key fields from rbkp table,values are not getting stored for these fields in gt_output table.In this case can I use indexes in where condition?if so,how can we know which is the suitable index to be used?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Hema&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2007 10:43:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/indexes/m-p/2809002#M656593</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-05T10:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: indexes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/indexes/m-p/2809003#M656594</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;In Se11 do to RBKP table..... On the application toolbar u have a button Index...clk....u will see all the available indexes.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if there r no indexes...u can create ur own....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2007 10:48:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/indexes/m-p/2809003#M656594</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-05T10:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: indexes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/indexes/m-p/2809004#M656595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;user has nothing to do when assiging secondary indexes&lt;/P&gt;&lt;P&gt;abap optimizer take care of those things&lt;/P&gt;&lt;P&gt;if ther is no index for non primary key fields .fields which u r using in where condition of select statement u shoud create secondary indexes in the sequence as they appear in where condition&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;nagesh.Paruchuri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2007 10:50:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/indexes/m-p/2809004#M656595</guid>
      <dc:creator>paruchuri_nagesh</dc:creator>
      <dc:date>2007-10-05T10:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: indexes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/indexes/m-p/2809005#M656596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;whenever u r using non primary key fields in where condition of a select staement u have to create secondary indexes for that fields in se11&lt;/P&gt;&lt;P&gt;optimizer will assign the indexes &lt;/P&gt;&lt;P&gt;user has nothing to do with that&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just write a simple select statement using non primary key fields in where condition&lt;/P&gt;&lt;P&gt;without secondary indexes it wont fetch data once u craete index for particular fields of select statement it will fetch data&lt;/P&gt;&lt;P&gt;******************&lt;/P&gt;&lt;P&gt;When a base table has multiple indices, the where clause should be in the order of the index, either a primary or a secondary index. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To choose an index, the optimizer checks the field names specified in the where clause and then uses an index that has the same order of the fields . In certain scenarios, it is advisable to check whether a new index can speed up the performance of a program. This will come handy in programs that access data from the finance tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;indexes&lt;/P&gt;&lt;P&gt;INDEXES help to speed up selection from the database. The primary index is always created automatically in the SAP System. It consists of the primary key fields of the database table. If you cannot use the primary index to determine a selection result (for example, WHERE condition may not contain any primary index fields), you can create a secondary index. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use Select Single if all primary key fields are supplied in the Where condition .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If all primary key fields are supplied in the Where condition you can even use Select Single. Select Single requires one communication with the database system, whereas Select-Endselect needs two. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To read data from several logically connected tables use a join instead of nested Select statements. Joins are preferred only if all the primary key are available in WHERE clause for the tables that are joined. If the primary keys are not provided in join the Joining of tables itself takes time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM EKKO INTO EKKO_WA.&lt;/P&gt;&lt;P&gt;SELECT * FROM EKAN INTO EKAN_WA&lt;/P&gt;&lt;P&gt;WHERE EBELN = EKKO_WA-EBELN.&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;The above code can be much more optimized by the code written below.&lt;/P&gt;&lt;P&gt;SELECT P&lt;SUB&gt;F1 P&lt;/SUB&gt;F2 F&lt;SUB&gt;F3 F&lt;/SUB&gt;F4 INTO TABLE ITAB&lt;/P&gt;&lt;P&gt;FROM EKKO AS P INNER JOIN EKAN AS F&lt;/P&gt;&lt;P&gt;ON P&lt;SUB&gt;EBELN = F&lt;/SUB&gt;EBELN.&lt;/P&gt;&lt;P&gt;******************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An index helps to speed up selection from the database. An index is a sorted copy of selected database table fields. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The primary index is always automatically created in an ABAP-based SAP system. It consists of the primary key fields of the database table. This means, for each combination of the index fields exists a maximum of one record in the table. This kind of index is called a UNIQUE index. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the primary index cannot be used to determine selection result, (for example, the WHERE condition does not contain any primary index fields), the system searches the whole table. To prevent this, and determine the selection result by searching through a restricted number of database records, you can create a secondary index. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, you should not define an index for all possible fields in the WHERE condition. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Creating a secondary index &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the transaction ABAP Dictionary Change &amp;amp;#8594; Indexes... &amp;amp;#8594; Create to create an index. To make the index unique, select UNIQUE. To specify the fields that will comprise the index, choose "Choose fields". Then save and activate the index. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When to create an index &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is worth creating a secondary index when: &lt;/P&gt;&lt;P&gt;You want to select table entries based on fields that are not contained in an index, and the response times are very slow. &lt;/P&gt;&lt;P&gt;The EXPLAIN function in the SQL trace shows which index the system is using. You can generate a list of the database queries involved in an action by entering Transaction ST05 and choosing Trace on &amp;amp;#8594; Execute action &amp;amp;#8594; Trace off &amp;amp;#8594; List trace. If you execute the EXPLAIN SQL function on a EXEC, REEXEC, OPEN, REOPEN or PREPARE statement, the system returns a list containing the index used in the database query. &lt;/P&gt;&lt;P&gt;The field or fields of the new secondary index are so selective that each index entry corresponds to at most 5% of the total number of table entries. Otherwise, it is not worth creating the index. &lt;/P&gt;&lt;P&gt;The database table is accessed mainly for reading entries. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vasu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2007 10:51:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/indexes/m-p/2809005#M656596</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-05T10:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: indexes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/indexes/m-p/2809006#M656597</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;How can we see both primary and secondary indexes of a table?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2007 11:17:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/indexes/m-p/2809006#M656597</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-05T11:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: indexes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/indexes/m-p/2809007#M656598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In SE11, choose your table and press the indexes button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2007 13:27:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/indexes/m-p/2809007#M656598</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-05T13:27:25Z</dc:date>
    </item>
  </channel>
</rss>

