Skip to Content
0
Former Member
Oct 18, 2007 at 11:35 PM

Performance Impovement for Join

167 Views

I have the following join statement. I have 220,000 records ... when I run this program, it times out. Can any one suggest performance impovement?

SELECT vbapvbeln vbapposnr vbapkwmeng vbapmatnr

vbapwerks vbapkdmat vbapposex vbakauart

vbakkunnr vbakvdatu vbepedatu lipsvbeln

lipsposnr lipslfimg marcdispo marcbeskz "--> PV

maktmaktx marameins vbkdihrez vbkdempst

vbkdbstkd vbkdbstkd_e vbpa~ablad

INTO TABLE lt_orders_t

FROM vbak INNER JOIN vbap

ON ( vbakvbeln = vbapvbeln )

INNER JOIN vbep

ON ( vbapposnr = vbepposnr AND vbapvbeln = vbepvbeln )

LEFT OUTER JOIN lips

ON ( vbapvbeln = lipsvgbel AND vbapposnr = lipsvgpos )

LEFT OUTER JOIN marc

ON ( vbapmatnr = marcmatnr AND vbapwerks = marcwerks )

LEFT OUTER JOIN makt

ON ( vbapmatnr = maktmatnr AND makt~spras = 'E' )

LEFT OUTER JOIN mara

ON ( vbapmatnr = maramatnr )

LEFT OUTER JOIN vbkd

ON ( vbapvbeln = vbkdvbeln AND vbapposnr = vbkdposnr )

LEFT OUTER JOIN vbpa

ON ( vbapvbeln = vbpavbeln AND vbpa~posnr = '000010' AND

vbpa~parvw = 'WE' )

WHERE vbak~vbeln IN s_vbeln AND

vbep~etenr = '0001' AND

vbap~posnr IN s_posnr AND

vbap~werks IN s_werks AND

vbak~auart IN s_auart AND

vbak~kunnr IN s_kunnr AND

vbak~vbtyp IN s_vbtyp AND

vbap~matnr IN s_matnr AND

vbep~ettyp IN s_ettyp AND

vbep~edatu IN s_edatu.