12-08-2005 9:39 AM
Hi Friends
Iam wrking performance tuning. my requirement is to reduce the execution time.
i removed usage os "TYPE and complex innerjoins that is defined on morethan 4 tables"
now if i see in the runtime analysis the databasetime reduced from 90% to 50% and abap time is incresed 5% to 40 % but the toatl cpu time increased from 19540 to 39678. then definetly exection time will increase
could tell me how to decrease the excution time.
thanks in advance.
regards
priya
12-08-2005 9:44 AM
Hi Priya,
Removing joins and putting multiple selects is never a good practice.
try to use tyes and remove "data:begin of" also avoid using loop under loop and select under loop , loop under select,multiple select on same table, slect *,select-endselect, into corresponding fields etc.
You can check your program with SLIN and st05 for more reasons.
Regards,
Amit
12-08-2005 9:45 AM
Hi,
The performance issue is mainly due to the operations performed at the database level.
Once ur performance is well at the database level and application server level then you can go ahead.
I am an SAP document for Performance tuning.
If you provide ur mail then i can forward it to you.
REgards,
Abdul
12-08-2005 9:47 AM
Hi priya,
Performance can be enhanced by applying suitable presummarization :
. Report-specific frozen report data
· Report-specific summarization data
· Summarization datathat is valid across CO-PA
summarization levels are valid throughout Profitability Analysis. As with summarization data, current line items can be read automatically. Summarization levels aggregate the entire database, not just the data that is relevant for a report. You have to build them manually.
Hope this helps u,
Regards,
Nagarajan.
12-08-2005 10:01 AM
Hi Priya,
As u removed usage of TYPE and complex innerjoints to reduce the database time . U have to follow few steps to reduce ABAP time as well.
1. Avoid nested looping ..
2. use where in select query instead of using select * ....
3. use case instead of if.
4. Use aggregate functions for calculations/summations in the SELECT
5. Use SELECT SINGLE instead of SELECT-ENDSELECT whenever possible.
Regards,
Raj
12-08-2005 10:12 AM
Hi,
Try to reduce the number od database interactions.Try running the program in background.
Avoid Select statements inside the loop.This will interact with database multiple times.
Kindly reward points by clicking the star on the left of reply,if it helps you.
12-08-2005 10:28 AM
Hi Priya,
1. Reduce the number of loops and endloops in your program. Make use of <b>Read statement</b> whenever you have a set of primary keys available for search. Use binary search to reduce the processing time furthur. Don't forget to sort the table before using Read with binary search.
2. Avoid going for loop inside a loop. instead you may also use <b>loop ... where <conditions></b>
3. When writing a <b>select...for all entries in</b>, try using all the primary keys. If not, transfer the data to a temporary internal table, and delete all adjacent duplicates comparing the fields that you use for selection condition.
This is my two cents worth suggestion. I hope, you find it useful.
12-08-2005 10:31 AM
Hi,
I think the time is getting increased as you use many loop statements for processing data after removing JOIN statements.
This can be reduced by using sy-tabix.
for example:
loop at itab1.
loop at itab2 where vbeln = itab1-vbeln
and posnr = itab1-posnr.
< ur code >
endloop.
endloop.
This takes a lot of time.
Instead you can use the following code.
sort itab1 by vbeln.
Sort itab2 by vbeln posnr.
loop at itab1.
read table itab2 with key vbeln = itab1-vbeln
posnr = itab1-posnr.
if sy-subrc = 0.
loop at itab2 from gv_tabix.
if itab2-vbeln <> itab1-vbeln or
itab2-posnr <> itab1-posnr.
exit.
else.
< ur code >
endif.
endloop.
endif.
endloop.
This takes very less time. Processing records gets reduced by using this logic.
regards,
Sailaja.
Reward points if answer helps you.
Message was edited by: Sailaja N.L.
12-09-2005 7:34 AM
Hi Folks
Thanks alot for your valuable informations.
i applied the all the tecnics,finally the acess time of database is decreasing but totaly exections time is not changed.and incase of joins execution time is little good than multiple select statements.
but my prblm is to reduce the execution time,and is the time displayed in runtime analysis (se30) tells the execution time?
Thanks in advace.
regards
priya
12-09-2005 7:41 AM
Hi priya,
As u said use ur select statements with care bcoz that reduces a lot of execution time.
statements that reduce ur execution time :
Use select -- into corresponding fields
select -- single ..........
Hope this help u,
Regards,
Nagarajan.
12-09-2005 9:26 AM
hi priya,
try using indexes for tables for faster execution and use search algorithms for retrieving data from tables.
regs,
jaga
12-09-2005 9:34 AM
hi
It is worth analyzing your SQL statements. to do this, you should use the Performance Trace and Runtime Analysis tools (Test menu in the ABAP Workbench). In particular, the SQL Trace in the Performance Trace shows you which parts of Open SQL statements are processed where, and how long they take.
regards
Arun
12-09-2005 9:38 AM
Hi Priya,
Here r some of the points .
1)when ever u use for all entries always check whether it is initial or not.
2)whenever read statement is used,use binary search.
3)sort the internal table with the key field.
4)Dont use select inbetween the loops.
And one more thing is that for best practise always check for sy-subrc.
If these points are helpful to u please reward points....
Thanx n Regards,
Sharath