‎2020 Jan 07 8:56 AM
Dear Colleagues.
I have this select:
SELECT likp~vkorg likp~kunag lips~vtweg lips~werks lips~vbeln lips~posnr likp~wadat_ist lips~matnr lips~arktx
lips~charg lips~lfimg lips~vrkme lips~umvkz lips~umvkn lips~meins lips~vgbel lips~vgpos lips~vgtyp
INTO CORRESPONDING FIELDS OF TABLE lt_deli
FROM ( ( vlpma INNER JOIN lips ON vlpma~vbeln = lips~vbeln AND vlpma~posnr = lips~posnr )
INNER JOIN likp ON vlpma~vbeln = likp~vbeln )
WHERE lips~lfimg > 0
AND vlpma~vbeln IN lrt_vbeln
AND likp~wadat_ist NE '00000000'
AND vlpma~vkorg NE w_vkorg_exc
AND likp~vbtyp = 'J'
AND (l_where).
But is running quite slow. Can you give a hint on how to improve it?
Thanks and regards.
‎2020 Jan 07 8:59 AM
Why did you use the VLPMA index table ? You don't need this table if you make an inner join between LIKP & LIPS
1st point: remove this table
‎2020 Jan 07 8:59 AM
Why did you use the VLPMA index table ? You don't need this table if you make an inner join between LIKP & LIPS
1st point: remove this table
‎2020 Jan 07 9:26 AM
Hi Frederic.
Thank you for your hint I will remove the VLPMA from the select.
Best regards.
V
‎2020 Jan 07 9:26 AM
Try putting where condition in ON like below and remove MOVE-CORRENSPONDING -
SELECT likp~vkorg likp~kunag lips~vtweg lips~werks lips~vbeln lips~posnr likp~wadat_ist lips~matnr lips~arktx
lips~charg lips~lfimg lips~vrkme lips~umvkz lips~umvkn lips~meins lips~vgbel lips~vgpos lips~vgtyp
INTO TABLE lt_deli
FROM (
( vlpma INNER JOIN lips
ON vlpma~vbeln = lips~vbeln
AND vlpma~posnr = lips~posnr
AND lips~lfimg > 0
AND vlpma~vkorg NE w_vkorg_exc
AND vlpma~vbeln IN lrt_vbeln)
INNER JOIN likp ON vlpma~vbeln = likp~vbeln
AND likp~vbtyp = 'J'
AND likp~wadat_ist NE '00000000')
WHERE
(l_where).