Archived discussions are read-only. Learn more about SAP Q&A

How can i use index in select query.. facing problem with the select query.

Hi Friends,

I am facing a serious problem in one of the select query. It is taking a lot of time to fetch data in Production Scenario.

Here is the query:

SELECT * APPENDING CORRESPONDING FIELDS OF TABLE tbl_summary

FROM ztftelat LEFT JOIN ztfzberep

ON ztfzberep~gjahr = st_input-gjahr

AND ztfzberep~poper = st_input-poper

AND ztfzberepcntr = ztftelatrprctr

WHERE rldnr = c_telstra_accounting

AND rrcty = c_actual

AND rvers = c_ver_001

AND rbukrs = st_input-bukrs

AND racct = st_input-saknr

AND ryear = st_input-gjahr

And rzzlstar in r_lstar

AND rpmax = c_max_period.

There are 5 indices present for Table ZTFTELAT.

Indices of ZTFTELAT:

Name Description

0 Primary key( RCLNT,RLDNR,RRCTY,RVERS,RYEAR,ROBJNR,SOBJNR,RTCUR,RUNIT,DRCRK,RPMAX)

005 Profit (RCLNT,RPRCTR)

1 Ledger, company code, account (RLDNR,RBUKRS, RACCT)

2 Ledger, company code, cost center (RLDNR, RBUKRS,RCNTR)

3 Account, cost center (RACCT,RCNTR)

4 RCLNT/RLDNR/RRCTY/RVERS/RYEAR/RZZAUFNR

Z01 Activity Type, Account (RZZLSTAR,RACCT)

Z02 RYEAR-RBUKRS- RZZZBER-RLDNR

Can anyone help me out why it is taking so much time and how we can reduce it ? and also tell me if I want to use index number 1 then how can I use?

Thanks in advance.

Not what you were looking for? View more on this topic or Ask a question