Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Indexes in Data dictionary

Former Member
0 Likes
3,823

Hi,

what is the main use of primary and secondary indexes in Data dictionary,in which case we use indexes.

1 ACCEPTED SOLUTION
Read only

former_member195270
Active Participant
0 Likes
2,690

Hi Sravani,

    Indexes are use for fast retrieval of data from database.

    Primary Index:

  

          Primary index is created automatically on key fields of data when table is created in SAP.

   Secondary Index:

         The secondary idex is required when there is retrieval of data on non-key fields.Secondary index is not created automatically.It is created menually depends on the requirement.

Hi,

what is the main use of primary and secondary indexes in Data dictionary,in which case we use indexes.

5 REPLIES 5
Read only

former_member195270
Active Participant
0 Likes
2,691

Hi Sravani,

    Indexes are use for fast retrieval of data from database.

    Primary Index:

  

          Primary index is created automatically on key fields of data when table is created in SAP.

   Secondary Index:

         The secondary idex is required when there is retrieval of data on non-key fields.Secondary index is not created automatically.It is created menually depends on the requirement.

Read only

0 Likes
2,690

hi umar,

thanxs, what is the main use of includes in data dictionary...how they differ from structure...

Read only

0 Likes
2,690

Hi Sravani,

    Customizing includes are used for extending table and will start with name CI_  and customizing included can only be attached with one table. append structure will start customer name space zz or YY.Append structure can be attached with multiple table.

Read only

0 Likes
2,690

Hi

There are two type of indexes in ddic i,e primary index,seconadary index

primary index- PI is automatically created by system using primary key of table.

seconadry index-In some case primary index not work due to huge no data or we have to search some record based on non primary key so at that time we create secondary index...

when we create secondary index system will generate one table in backend which is combination of some field (which are selected by us)+some of the filed system will take their own+pointer(which point to real position of record) and while searching record secondary index follow binary search(it will sort the record in asending order use divide and conqure method) to search record faster

Read only

susmita21
Explorer
0 Likes
2,690

Hi,

  • An index is a sorted copy of database table field which is help to speed up the selection of data.
  • There are two type of indexes available in DDIC. such as primary index and secondary index.

Primary index : -

  • Primary index is created automatically by the SAP system using key fields of the table.

Secondary index : -

  • Secondary index is created manually and managed by SAP ABAP Consultant using non primary key field.
  • secondary index used Binary Search for that reason searching also faster as compare to primary index.
  • maximum 6 secondary index we can create for a particular database table.
  • syntax for secondary index select query :

example for Oracle database

select * from <table name>

into table <internal table name>

%_HINTS ORACLE ' index ' ('table name', 'secondary index').