2009 Oct 19 10:50 AM
Hi Guys,
I have just received an email from our basis team where they said I am using an expensive SQL statement.
There is a loop on a table of people with the following statement
SELECT * FROM catsdb INTO TABLE w_cats
WHERE arbid EQ i_data-arbid
AND raufpl EQ i_data-aufpl
AND raplzl EQ i_data-aplzl
AND workdate IN s_wdate
AND status EQ '30'.
Is it me or is this the quickest way possible??
Can anyone think of a better way to do this??
Thanks Experts
2009 Oct 19 1:25 PM
First of all, did you ever hear about indices? Please check whether there is an index (SE11) with has fields of your WHERE-condition.
=> if this is not the case the it will be slow, until an index is created.
Second, change the LOOP into a FOR ALL ENTRIES, don't forget to check whether the itab is initial.
2009 Oct 19 1:41 PM