SAP ABAP Indexes

In SAP ABAP, indexes are used to avoid the duplicate data and improve the performance while accessing the table. The different types of indexes are

  1. Primary Indexes
  2. Secondary Indexes

Primary Indexes: Primary indexes in SAP are created automatically by the SAP system using key fields of database tables.

Secondary Indexes: Secondary Indexes are created manually and managed by the SAP ABAP consultant. We can create up to 9 secondary indexes. In real time, secondary indexes are not advisable, it is allowed based on the requirements of project.

How to Create secondary indexes in SAP ABAP

Transaction codeSE11
SAP Menu PathSAP Menu > Tools > ABAP Workbench > Development > SE11 – ABAP Dictionary

Step 1: Execute tcode “SE11” in the SAP command field.

SAP Tcode SE11

Step 2: In next ABAP Dictionary: Initial screen, enter the database table name and click on change button.

ABAP dictionary - Indexes

Step 3:  In next screen, Dictionary maintain table, click on indexes button as shown below image.

Choose indexes in SAP

Step 4: Now a window opens “Indices for the Table ZEMPLOYEE” click on create icon.

create indexes in SAP

Step 5: Choose “Create Index”

create index

Step 6: Enter the name of index, allowed up to 3 character. Press enter to continue.

create index in sap abap

Step 7: In next screen “Dictionary: Maintain Index” update the following details.

  • Short description: Enter the description of secondary indexes.
  • Choose the table fields for choosing the required fields.
Maintain index in SAP ABAP

Choose the required fields and click on copy button.

Field selection for SAP indexes

Step 8: Now click on activate icon to activate the created indexes in SAP ABAP.

Activate SAP ABAP Indexes

Choose the local object and save the created SAP ABAP indexes.

How to delete secondary indexes in SAP

Step 1: Refer above step 1, step 2 and step 3. i.e enter the database table and click on change option. Now choose the indexes option.

Step 2: Now choose the unwanted indexes and click on delete icon to delete the secondary indexes in SAP.

delete secondary indexes in SAP ABAP

Step 3: A warning message displays on the screen, choose Yes to delete index.

delete index in SAP

Successfully index was deleted in SAP.

ZEM index deleted