Skip to Content
0
Former Member
Nov 05, 2004 at 09:49 AM

How to speed up select with join ?

426 Views

Hi

I 'd like to do a selection into Purchasing table EKKO/EKPO/EKBE.

I am searching how I can optimize this select :

If someone have tips and tricks, on the way to speed up my selection ? I've tried to change the order of the table in the From but the response time doesn't really change.

This is my code :

select ekbe~belnr

ekbe~bewtp

ekbe~budat

ekbe~menge

ekbe~dmbtr

ekbe~shkzg

ekbe~lfbnr

ekbe~matnr

ekbe~werks

ekpo~ebeln

ekpo~ebelp

ekpo~matkl

ekpo~meins

ekko~lifnr

ekko~ekorg

ekko~ekgrp

ekko~waers

into table t_ekpo

from ( ekbe inner join ekpo

on ekbeebeln eq ekpoebeln

and ekbeebelp eq ekpoebelp )

inner join ekko

on ekbeebeln eq ekkoebeln

for all entries in t_ekbe

where ekbe~ebeln eq t_ekbe-ebeln

and ekbe~ebelp eq t_ekbe-ebelp

and ekbe~lfbnr eq t_ekbe-belnr

and ( ekbe~bewtp eq 'E'

or ekbe~bewtp eq 'R' )

and ekbe~budat in s_sptag

and ekpo~matkl in s_matkl

and ekpo~matnr in s_matnr

and ekko~lifnr in s_lifnr

and ekko~ekgrp in s_ekgrp

and ekko~ekorg in s_ekorg.

Hope you could help me.

Regards,

Erwan.