To learn more about standard tables and non-unique keys, I suggest you to read the following [Special Features of Standard Tables|http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3646358411d1829f0000e829fbfe/frameset.htm].
Read this if it helps..
You can specify the key key of an internal table as follows:
UNIQUE KEY col1 ... coln
In tables with a structured line type, all of the components col1 coln belong to the key as long as they are not internal tables or references, and do not contain internal tables or references. Key fields can be nested structures. The substructures are expanded component by component when you access the table using the key. The system follows the sequence of the key fields.
UNIQUE KEY table_line
If a table has an elementary line type (c, d, f, i, n, p, t, x), you can define the entire line as the key. If you try this for a table whose line type is itself a table, a syntax error occurs. If a table has a structured line type, it is possible to specify the entire line as the key. However, you should remember that this is often not suitable.
UNIQUE DEFAULT KEY
This declares the fields of the default key as the key fields. If you have a structured line type, the standard key is build from all columns of the internal table that have a character-type type (c, d, t, n, x, string, xstring). Internal tables with a nested row structure have a standard key built by linearization of the row structure. At elementary row types, the standard key is the row itself. Elementary tables with an internal table as row type have an empty standard key.
Specifying a key is optional. If you do not specify a key, the system defines a table type with an arbitrary key. You can only use this to define the types of field symbols and the interface parameters of procedures . For exceptions, refer to Special Features of Standard Tables).
The optional additions UNIQUE or NON-UNIQUE determine whether the key is to be unique or non-unique, that is, whether the table can accept duplicate entries. If you do not specify UNIQUE or NON-UNIQUE for the key, the table type is generic in this respect. As such, it can only be used for specifying types. When you specify the table type simultaneously, you must note the following restrictions:
· You cannot use the UNIQUE addition for standard tables. The system always generates the NON-UNIQUE addition automatically.
· You must always specify the UNIQUE option when you create a hashed table.
Hi bo zhang
As you know unique keys are used as primary indexes in the where clause of a select statement.
To have secondary indexes in the where clause, we've to make use of non-unique keys.
But in performance view, we should not use, since as it is a non-unique, we come across many duplicates, so generally we use it as the situation demands.
At max., we can make 16 secondary indexes.
Here i like to differentiate b/w index and keys to clear the confusion. At the creation of database table through se11, we've to position the unique key fields at top of the table fields to clarify the entries to be identified.
About Indexes, after activating the table in se11, the system implicitly creates indexes for the table based on primary keys and secondary indexes based on non-unique keys.
For further doubts feel free to contact me.
If it helpful to you, reward me plz.