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

query taking long time

hi this query taking long time,

what is the proper way to select the data.

CALL FUNCTION 'LE_MOB_SHIPMENT_FOR_DELIVERY'
          EXPORTING
            delivery_header      = delivery_header
          IMPORTING
            shipment_header      = shipment_header
          EXCEPTIONS
            no_data_found        = 1
            delivery_not_planned = 2
            OTHERS               = 3.

         ivbeln-tknum = shipment_header-tknum.

     SELECT SINGLE knumv FROM vfkp
          INTO (knuft)
          WHERE exti1 = ivbeln-tknum.          "This Query taking long time

      SELECT SINGLE netpr FROM vfsi
        INTO (netft)
        WHERE knumv = knuft.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jul 27, 2009 at 07:32 AM

    HI,

    
    ivbeln-tknum = shipment_header-tknum
    
    "in the below code EXTI1 is not the Primary key..so try to create Index or using the Primary key combination to avoid long run
          SELECT SINGLE knumv FROM vfkp
               INTO (knuft)                                   
               WHERE exti1 = ivbeln-tknum.          "This Query taking long time
                        
    
    "New Query..
    
    data : w_FKNUM type FKNUM,
              w_exti1 type  EXTI1_P.
    
    w_tknum = shipment_header-tknum.
    w_exti1   = shipment_header-exti1.
    
    
    SELECT SINGLE knumv FROM vfkp
               INTO (knuft)                                   
               WHERE FKNUM = w_tknum 
                    and exti1 = w_EXti1.          "Now works Fine
                                    
    

    Prabhudas

    Edited by: Prabhu Das on Jul 27, 2009 1:02 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 27, 2009 at 07:39 AM

    hi...........

    use the field exti1 with primary key..............

    it will avoid the extra time

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 27, 2009 at 07:50 AM

    Hello Mr Tomar ,

    Try this query

    Constant c_FKNUM type FKNUM VALUE IS INITIAL,

    c_FKPOS type FKPOS VALUE IS INITIAL.

    SELECT SINGLE knumv FROM vfkp INTO (knuft)

    WHERE FKNUM GE c_FKNUM

    FKPOS GE c_ FKPOS

    exti1 = ivbeln-tknum.

    Logic behind it is ....here we are using all primery key to make serch faster ( using Primery INDEX) .

    Always Try to use all primery key ...this will make your search faster

    Thanks and Regards ...

    Priyank Dixit

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 17, 2009 at 08:01 AM

    NO REPLY A LONG TIME. SO, I STOP.

    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.