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

QUESTION ON OPEN SQL.

Former Member
0 Likes
478

how 2 use secondary index 4 data retrival in case of SELECT STATEMENT?

4 REPLIES 4
Read only

anversha_s
Active Contributor
0 Likes
450

hi,

chk this excellent link.

http://help.sap.com/saphelp_47x200/helpdata/en/cf/21eb2d446011d189700000e8322d00/content.htm

You can force the sql statement to use a particular index by using %_HINTS parameter.

For eg:

SELECT carrid connid cityfrom
FROM spfli INTO (xcarrid, xconnid, xcityfrom)
WHERE carrid = 'LH ' AND cityfrom = 'FRANKFURT'
%_HINTS ORACLE 'INDEX("SPFLI" "SPFLI~001")'.
WRITE: / xcarrid, xconnid, xcityfrom.
ENDSELECT.

Refer to the SAP Note #129385 and related notes for further information

rgds

Anver

Read only

Former Member
0 Likes
450

hi

good

You should ensure that fields in a where clause are always supported by an index, either a primary index or a secondary index. Secondary indexes are not available for cluster tables such as BSEG or pooled tables such as configuration tables & match code ids.

The columns belonging to a primary index have an 'X' under "Key" in the Dictionary: Table/Strucutre: Display Fields screen (SE11). They will always be the initial columns in a table.

Secondary indexes can be found from:

Dictionary: Table/Strucutre: Display Fields screen (SE11)->Indexes...Indexes for Table->choose an index and press enter- this will list the fields involved with a specific secondary index.

SE11 (Dictionary: Table/Strucutre: Display Fields screen)->Utilities->Database Utility->Extras->Database Object->Display will list all the fields and indexes for a table. Navigate to the bottom for the indexes.

http://web.mit.edu/sapr3/dev/select_examples.htm

thanks

mrutyun^

Read only

Former Member
0 Likes
450
Read only

Former Member