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

INDEX

Former Member
0 Likes
778

Plz find my SELECT query below:

select w~mandt

wvbeln wposnr wmeins wmatnr wwerks wnetwr

wkwmeng wvrkme wmatwa wcharg w~pstyv

wposar wprodh wgrkor wantlf wkztlf wlprio

wvstel wroute wumvkz wumvkn wabgru wuntto

wawahr werdat werzet wfixmg wprctr wvpmat

wvpwrk wmvgr1 wmvgr2 wmvgr3 wmvgr4 wmvgr5

wbedae wcuobj w~mtvfp

xetenr xwmeng xbmeng xettyp xwepos xabart

x~edatu

xtddat xmbdat xlddat xwadat xabruf xetart

x~ezeit

into table t_vbap

from vbap as w

inner join vbep as x on xvbeln = wvbeln and

xposnr = wposnr and

xmandt = wmandt

for all entries in t_vbak

where

w~vbeln in s_ordno and

w~vbeln = t_vbak-vbeln and

  • ( ( werdat > pre_dat ) and ( werdat <= w_date ) ) and

( ( ( erdat > pre_dat and erdat < p_syndt ) or

( erdat = p_syndt and erzet <= p_syntm ) ) ) and

w~matnr in s_matnr and

w~pstyv in s_itmcat and

w~lfrel in s_lfrel and

w~abgru = ' ' and

w~kwmeng > 0 and

w~mtvfp in w_mtvfp and

x~ettyp in w_ettyp and

x~bdart in s_req_tp and

x~plart in s_pln_tp and

x~etart in s_etart and

x~abart in s_abart and

( ( xlifsp in s_lifsp ) or ( xlifsp = ' ' ) ).

Could u please suggest an Index that can reduce the DB Access time for the above Query?

On what fields I should specify the Index

Thx

6 REPLIES 6
Read only

Former Member
0 Likes
758

Hi,

If u have check the where contion without primary key u may create index. that is called the secondary index.

Regards,

S.Nehru.

Read only

0 Likes
758

Understand My QUERY plz!

Read only

Former Member
0 Likes
758

instead of using joins between vbap and vbep

fecth VBAP entries for all the selected entries in VBAK

and then fecth VBEP entries for all the selected entires in VBAP. Then club both vbap and vbep entires into single internal table.

Read only

0 Likes
758

Understand My QUERY plz!

Read only

Former Member
0 Likes
758

No useful answers!

Read only

Former Member
0 Likes
758

Hi Santo,

I understand that your VBAP table is w in the query.

Now try creating a secondary index for VBAP.

Go to se11 and create index for VBAP in the order of your query. This will surely speed up DB access.

On what fields I should specify the Index?

maintain the same query sequence.

Edited by: rohitaash sharma on Feb 6, 2008 9:56 AM