Comprehensive Guide to SAP Indexing: Creation, Types, and Best Practices, Including Step-by-Step Instructions for Secondary Index Creation and Search Help Introduction

 

  • Suppose, I have a book and the book does not have any index and I want to read a particular topic, So basically I will have to start reading the book from the beginning. But if, the book have some index and we can directly refer the topic.
  • An index is given to give the high performance.
  • An index always stores data in the sorted order.
  • If there will be no index, then SAP will have to go to each data one by one and it will be very time consuming.

Types of Index :-

  1. Primary Index :- Primary key will act as a primary index.
  2. Secondary Index :- Based upon the requirement, We will create secondary indexes.

Disadvantage of Indexes :-

  • Index will always occupy space on the database layer.

How to create a index ?

Requirement :- Create a secondary Index on ‘Order Header Table’ for field ‘Order date’.

Steps :-

  • Step 1:- go to SE11 and open our already create Order header table (ZAR_HEADER ) in change mode.

    • Note :- we had already created this table in our previous blogs, So if you are new here kindly read the previous blogs also
  • Step 2 :- Click on indexes .



  • Step 3:- Click on create index.



  • Step 4:- Name the index and press enter.



  • Step 5:- Provide a short description, and in the field name choose the field for which you want to create the index.



    • A message will popup that the index does not occupy in the database.

  • Step 6 :- Save and activate the index → a message will popup that the index is present in the database.






Q. How index is stored at the database layer ?

  • TABLE_NAME~INDEX_NAME
    • ZAR_HEADER~ODT { you can see in the above image }



  1. Index on all database systems :- If we have multiple databases, then index will occupy on all database systems.

  2. For Selected database :- You can select the database for which you want this index.



  3. No database index :- Since index will always occupy space on the database layer, so if we will not specify a database to the index then index will not exist. When you save activate the index, you will see this message.



Note :-

  • Suppose in nearby future, we don’t need this index. So never delete the index just select the radio button no database index, so that if in future you require this index then you can come again and add it to database again.

Search Help Introduction :-

  • Search Help is also called as F4 help.
  • It is also known as Value help.
  • It’s purpose is to display the various possible values for any input fields.
  • Every time we create a table we can see there is some search help available on each field to help us.

Types of Search Help :-

  1. Elementary Search Help:- Single Search Help { Whenever we will create a single search help }.

    • Purpose: Elementary search helps are simple search tools designed for a single field in a selection screen or a screen field.
    • Characteristics:
      • Typically associated with a single input field.
      • Helps users find values for that specific field.
      • The search help can be defined using a list of possible values or by fetching values from a database table.
    • Example: When entering a customer code, an elementary search help can be activated to display a list of valid customer codes.
  2. Collective Search Help:- It is a combination of elementary search helps.

    • Purpose: Collective search helps are more complex search tools that involve multiple input fields and are used to search for values based on a combination of criteria.
    • Characteristics:
      • Can involve multiple input fields, and users can search based on various criteria.
      • Provide a way to search for data using a combination of fields, enhancing the specificity of the search.
      • Can be based on a combination of database tables.
    • Example: A collective search help might be used to search for materials in a sales order by specifying criteria such as material type, plant, and description.

    Thanx for being a part of this journey,

    We will start with Search help implementation from the next blog.

Comments

  1. Hello, thanks for the post it’s really interesting. One doubt, if I create a index in a table with existing data the index affect only new data added or apply for the previous data too? Thanks!

    ReplyDelete
  2. Can you please give demo/example how index helps

    ReplyDelete

Post a Comment

Popular posts from this blog

Understanding Different Types of SAP Function Modules: Normal, RFC, and Update

Unlocking SAP ABAP Secrets: Interactive Classical Reports with GET CURSOR, At User Command, and a Comparison of HIDE Statements

Mastering ABAP: A Step-by-Step Guide to Function Modules and Groups for Modularized Programming