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
- Primary Indexes
- 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
|SAP Menu Path||SAP Menu > Tools > ABAP Workbench > Development > SE11 – ABAP Dictionary|
Step 1: Execute tcode “SE11” in the SAP command field.
Step 2: In next ABAP Dictionary: Initial screen, enter the database table name and click on change button.
Step 3: In next screen, Dictionary maintain table, click on indexes button as shown below image.
Step 4: Now a window opens “Indices for the Table ZEMPLOYEE” click on create icon.
Step 5: Choose “Create Index”
Step 6: Enter the name of index, allowed up to 3 character. Press enter to continue.
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.
Choose the required fields and click on copy button.
Step 8: Now click on activate icon to activate the created indexes in SAP ABAP.
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.
Step 3: A warning message displays on the screen, choose Yes to delete index.
Successfully index was deleted in SAP.