‎2008 Jun 02 9:45 AM
Hi,
Do you have any suggestion on how to improve the performance of this code? It is taking 3 minutes and returns only one record.
SELECT DISTINCT vbak~vbeln
vbkd~zzvextzau
vbak~auart
INTO TABLE zauth_itab
FROM vbak
INNER JOIN vbap
ON vbapmandt = vbakmandt
AND vbapvbeln = vbakvbeln
INNER JOIN vbup
ON vbupmandt = vbakmandt
AND vbupvbeln = vbakvbeln
INNER JOIN vbkd
ON vbkdmandt = vbakmandt
AND vbkdvbeln = vbakvbeln
AND vbkd~posnr = 0
WHERE vbak~vbeln IN s_vbeln
AND vbap~matnr IN s_matnr
AND vbap~kondm IN s_kondm
AND vbak~auart IN s_auart
AND vbak~vkorg IN s_vkorg
AND vbak~guebg IN r_guebg
AND ( vbak~gueen > sy-datum OR
vbak~gueen = 0 )
AND vbup~rfsta EQ 'C'.
Thanks!
Che
‎2008 Jun 02 9:54 AM
Hi,
Avoid SELECT DISTINCT....instead delete the duplicates after data fetch.
OR condition canbe avoided.
check if u r populating all the select options....
regards,
madhu
‎2008 Jun 02 10:17 AM
Hi Cherryl Ann Cruz,
First Select all the VBELN into correspodning fields ZAUTH_ITAB from VBAK,
Then sort ZAUTH_ITAB internal table and DELETE Adjacent duplicates.
Then Get data ZZEXTZAU from VBUP based on Internal table ZAUTH_ITAB and MODIFY the internal table ZAUTH_ITAB for field ZZEXTZAU where VBELN = ZAUTH_ITAB-VBELN.
Similarly get data for AUART from VBKD based on internal table ZAUTH_ITAB and modify the internal table ZAUTH_ITAB for field AUART where VBELN = ZAUTH_ITAB-VBELN.
This would definitely reduce your accessibility time.
Hope this reduces the time taken helps you.
if yes reward suitably.
Thanks
Venugopal
‎2008 Jun 02 10:36 AM