Skip to Content
author's profile photo Former Member
Former Member

performance improvement for select query

Hi all,

need to improve performace for the below select query as it is taking long time

SELECT vbeln pdstk

FROM vbuk INTO TABLE it_vbuk1 FOR ALL ENTRIES IN it_likp

WHERE vbeln = it_likp-vbeln AND

wbstk = 'C' AND "pdstk = ' ' AND

vbtyp IN gr_delivery AND

( fkstk = 'A' OR fkstk = 'B' ) OR

( fkivk = 'A' OR fkivk = 'B' ).

Regards,

Kumar

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Posted on Oct 12, 2010 at 06:10 AM

    An extra parenthesis will solve the problem

    SELECT vbeln pdstk
    FROM vbuk INTO TABLE it_vbuk1 FOR ALL ENTRIES IN it_likp
    WHERE vbeln = it_likp-vbeln 
    AND wbstk = 'C' 
    AND pdstk = ' ' 
    AND vbtyp IN gr_delivery 
    AND(( fkstk = 'A' OR fkstk = 'B' )   
     OR
    ( fkivk = 'A' OR fkivk = 'B' )).

    Also ensure IT_LIKP is not initial before using in FOR ALL ENTRIES IN

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 12, 2010 at 06:11 AM

    Hi,

    Check if it_likp is sorted on vbeln.

    SELECT vbeln pdstk

    FROM vbuk INTO TABLE it_vbuk1 FOR ALL ENTRIES IN it_likp

    WHERE vbeln = it_likp-vbeln AND

    wbstk = 'C' AND

    vbtyp IN gr_delivery AND

    ( ( fkstk = 'A' OR fkstk = 'B' ) OR <-- check this condition , if ( ) is needed ...

    ( fkivk = 'A' OR fkivk = 'B' ) ) .

    Regards,

    Srini.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 12, 2010 at 01:53 PM

    Moderator message - Please see before posting - post locked Rob

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.