Index is the entry point for a table. Let say for a particular table, how will you look for a data selection. You should have some fields which are primary keys/unique so that you can enter that field and get the complete details. SAP automatically create the index for the primary keys assigned to a transparent table.
Let say, in your requirement you found there can be one more field added based on which also table can return unique entries. Might be based on fields combination. In that case you can also define your own secondary indexes for transparent tables.
Indexes accelerate the reading of tables when the system looks for records satisfying specific search criteria. The system determines the most efficient index by which to select data for the specific request.
Database indexes are defined ABAP Dictionary and stored in the physical database.
We can easily create a secondary index for a table. From the ABAP table maintenance screen use the menu path GoTo ® Indexes. A pop-up window appears. Assign a 3-character id to your index. Provide a short text and select the field(s) by which the table needs to be indexed.
Go to transaction SE11.
For our demo purpose, we have considered the table ZAUTHOR.
To know if there are any secondary indexes available, click on Goto à Indexes
Following popup appears:
From the above screenshot, it is evident that there are no secondary indexes already created.
Click on Create à Create Index
Enter the name of the index.
Fill in the details – Short description and the fields in the index.
Save and activate.
Now you can observe the index created above in the list now:
Maximum number of secondary indexes we can have are 9.
0 comments:
Post a Comment