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: 

hw to reduce the report execution time?

Former Member
0 Kudos

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 REPLIES 12

amit_khare
Active Contributor
0 Kudos

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

abdul_hakim
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi priya,

Performance can be enhanced by applying suitable presummarization :

. Report-specific frozen report data



You create report-specific frozen report data by executing the report in the background and by choosing the Rebuild frozen report data option in the selection

· Report-specific summarization data



Report-specific summarization data is created automatically the first time you call up a report using the Use summarization data option. The initial execution of the report should be performed in the background. The next time you execute the report, the summarization data is read and, if necessary, supplemented by current data, that is, current line items (if the appropriate option has been selected for the report). This current status is displayed in the report. In addition, the summarization data is updated accordingly.

· 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.

justin_santhanam
Active Contributor
0 Kudos

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

jayanthi_jayaraman
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

0 Kudos

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.

Former Member
0 Kudos

hi priya,

try using indexes for tables for faster execution and use search algorithms for retrieving data from tables.

regs,

jaga

Former Member
0 Kudos

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

Former Member
0 Kudos

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