If there are many indexes that contain common fields, the database optimizer cannot decide the right index to be used for particular query and then use a wrong index that may not be of optimal performance. Hints can be provided using the %_HINTS parameter.
You need to create secondary index, please go to tutorial of How to create secondary index . for this example we will use the index ( ZDO ) in table VBAK that we created before.
For creating program containing the SELECT with HINT parameter, you can follow this .
1. SELECT statement with HINT parameter, the addition %_HINTS followed by the database name, the table and the table index name is made to SELECT clause.
SELECT VBELN into ls_vbeln FROM vbak
WHERE aufnr = p_aufnr %_HINTS DB6 'TABLE VBAK ABINDEX(ZSDO).
This %_HINTS special syntax used for specifying the name of the database index to be used for particular SELECT statement. The syntax checker does not check the index name. Therefore if a wrong index is used the corresponding query will not give syntax error but the result for performance is not achieved.