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

ABAP select optimization

Former Member
0 Likes
906

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.

1 ACCEPTED SOLUTION
Read only

FredericGirod
Active Contributor
0 Likes
759

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

3 REPLIES 3
Read only

FredericGirod
Active Contributor
0 Likes
760

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

Read only

0 Likes
759

Hi Frederic.

Thank you for your hint I will remove the VLPMA from the select.

Best regards.

V

Read only

ravish_ranka
Product and Topic Expert
Product and Topic Expert
0 Likes
759

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).