Application Development 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: 

performnce qustion

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

prabhu_s2
Active Contributor
0 Kudos

try to query based on the index seqeunce

6 REPLIES 6

prabhu_s2
Active Contributor
0 Kudos

try to query based on the index seqeunce

Former Member
0 Kudos

Hi,

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

Thanks,

Sriram.

Former Member
0 Kudos

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

former_member194613
Active Contributor
0 Kudos

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

prabhu_s2
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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