Skip to Content
avatar image
Former Member

SAP ABAP

Hi All,

I had to improve the performance of one code i.e.

SELECT vbeln posnr

FROM lips

INTO TABLE t_lines

WHERE vbeln = i_delivery

AND posnr = i_delivery_line

AND kcmeng = 0.

OR vbeln = i_delivery

AND uecha = i_delivery_line

AND kcmeng = 0 .

can any please suggest me the best possible way to write the code .

the Position of fields in Table lips are

vbeln

posnr

kcmeng

uecha.

thanks

himanshu

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Feb 28, 2008 at 10:29 AM

    Hi,

    SELECT vbeln posnr

    FROM lips

    INTO TABLE t_lines

    WHERE vbeln = i_delivery

    AND posnr = i_delivery_line

    AND kcmeng = 0.

    as you are using Key fields in where condition, the above code will give you very good result.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 28, 2008 at 11:17 AM

    Hi

    correct one is

    select vbeln posnr

    from lips

    into corresponding fields of table t_lines

    where vbeln = i_delivery and

    (posnr = i_delivery_line or

    uecha = i_delivery_line) and

    kcmeng = 0.

    Thanks

    Aditya

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 28, 2008 at 11:26 AM

    Hi Himanshu,

    Either use the key fields of the table for fetching the data or if you have the values of the index fields then use them in your where condition. You can see the index fields by clicking on the indexes tab which is present in se11.

    Regards,

    Priyanka.

    Add comment
    10|10000 characters needed characters exceeded