05-12-2010 2:17 PM
Hi Forum,
I've just started learning ABAP and thankfull for any help.
When do a selection over the DFKKOP Table by using one of its Indizes (AUGST, VKONT, BUKRS and AUGDT) it still takes 2 Minutes to get results when testing in a real-data-environment.
CODE
select * from dfkkop into table tab_dfkkop
where augst ne 9
and vkont = p_vkont
and bukrs = p_bukrs
and augdt <= sy-datum.
ENDCODE
What can I do to get my code more efficient?
Thanks a lot for your help in advance,
best regards,
beckersk
05-12-2010 2:33 PM
The augst ne 9 is probably causing the problem. Change this to augst eq space and see what happens.
Rob
05-12-2010 2:22 PM
Hi,
please post your execution plan and table and index statistics.
Runtime figures from ST05 (number of records selected, time, ...) would be interesting as well.
Kind regards,
Hermann
05-12-2010 2:29 PM
Hi Hermann,
thanks a lot for your fast help.
What do you mean with "execution plan and table and index statistics"?
Best regards,
beckersk
05-12-2010 2:34 PM
Hi,
> What do you mean with "execution plan and table and index statistics"?
all the content you get when you click on "explain" for the statement in the SQL trace.
Here is a little description how and where to get an execution plan generally:
/people/hermann.gahm/blog/2010/03/04/explaining-the-explain-plan
Kind regards,
Hermann
05-12-2010 2:36 PM
>
> What do you mean with "execution plan and table and index statistics"?
Moderator message - Welcome to SCN. Unfortunately, this forum is not a place to learn ABAP. I suggest that you get one of the good ABAP books that are out there and maybe join an internet forum that caters to beginners Also please read and before posting Rob
05-12-2010 2:33 PM
The augst ne 9 is probably causing the problem. Change this to augst eq space and see what happens.
Rob
05-12-2010 2:43 PM
Hi Rob,
> "The augst ne 9 is probably causing the problem. Change this to augst eq space and see what happens."
says the experienced developer with application knowledge.
I like those situations where try to apply pure "dumb" technical analysis and methods and then an experienced
developer with application knowledge says something like you did. Often enough they know quick and efficient
changes (e.g. seleting other tables, not selecting tables at all, ...) that are just not "visible" for us technology guys
Kind regards,
Hermann
05-12-2010 2:50 PM
Hey Rob,
thanks a lot - your "space-tip" worked perfectly. Now the selection needs only 1 -1 2 secs.
Thanks both of you for your help. If I might have posted in a wrong manner or way, I'm sorry and I'll try to obey the rules the next time.
Cheers,
beckersk