Skip to Content
avatar image
Former Member

performnce qustion

hallow

i doing this code and i wont to now if i can improve this select

SELECT pernr

endda

begda

kostl

ename

FROM pa0001

INTO CORRESPONDING FIELDS OF TABLE lt_pa0001

WHERE begda LE gdate

AND endda GE gdate_13

AND kostl NE '' "

AND persk NE 'ZZ'

AND persg NE '5'.

Regards

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • Best Answer
    Aug 20, 2007 at 03:27 PM

    try to query based on the index seqeunce

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 20, 2007 at 03:31 PM

    Hi,

    Try to avoid using into corresponding fields instead use into table statement. And If possible use Pernr in select statement.

    Thanks,

    Sriram.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 20, 2007 at 03:36 PM

    HI ,

    declare the it_pa0001 filed in the same sequence as in select and remove that into corresponding option in the select statement.

    Thanks

    Mahesh

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 20, 2007 at 03:38 PM

    Are you familiar with indexes? What index do you have on PA0001?

    The statement will not be very performant anyway

    begindate is smaller something, and enddate is larger something, so not in an interval,

    non-equal can of course not be supported by indexes.

    AND kostl NE '' "

    AND persk NE 'ZZ'

    AND persg NE '5'.

    So your statement is very likely to be a full scan on PA0001, hopefully, there are not many records in this table.

    Siegfried

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 20, 2007 at 03:42 PM

    following are the index avaiable:

    ABK

    BUK

    KST

    ORG

    PBR

    PGR

    PKR

    PTB

    SAZ

    VDS

    maybe check which can be used efficeintly ir ur query. also as checked by other restrict in using coressponding and check ur intervals

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 20, 2007 at 03:53 PM

    Hi,

    Try to use all Key fields as declared in table.

    Like :

    Select Key1

    Key2

    Key3

    From Mara

    where matnr.........ect

    Thanks and Regards,

    Thrivikram

    Add comment
    10|10000 characters needed characters exceeded