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: 

How to Improve the Performance of Reports

VijayaKrishnaG
Active Contributor
0 Kudos

Hi Experts,

I have an issue to improve the performance of some reports. Those of 3000 and 3000+ lines each. What should I do or is there any approach to follow in improving performance of reports. And if I go through line-by-line, it may take months to complete.

Please suggest me any solution or approach to follow.

Thanks & Regards,

-Vijay

10 REPLIES 10

former_member195402
Active Contributor
0 Kudos

Hi,

one idea is to start with SE30 runtime analysis to find the performance issues.

SQL trace in ST05 also may be a good idea after that.

Regards,

Klaus

Former Member
0 Kudos

Hi Vijay,

       

          Please follow these steps.

    Avoid using SELECT...ENDSELECT... construct and use SELECT ... INTO TABLE.

    Use WHERE clause in your SELECT statement to restrict the volume of data retrieved.

    Design your Query to Use as much index fields as possible from left to right in your WHERE          statement

    Use FOR ALL ENTRIES in your SELECT statement to retrieve the matching records at one shot.

    Avoid using nested SELECT statement, SELECT within LOOPs.

    Avoid using INTO CORRESPONDING FIELDS OF TABLE. Instead use INTO TABLE.

    Avoid using SELECT * and Select only the required fields from the table.

    Avoid nested loops when working with large internal tables.

    Use assign instead of into in LOOPs for table types with large work areas

    When in doubt call transaction SE30 and use the examples and check your code

    Whenever using READ TABLE use BINARY SEARCH addition to speed up the search. Be sure to sort the internal table before binary search. This is a general thumb rule but typically if you are sure that the data in internal table is less than 200 entries you need not do SORT and use BINARY SEARCH since this is an overhead in performance.

    Use "CHECK" instead of IF/ENDIF whenever possible.

    Use "CASE" instead of IF/ENDIF whenever possible.

    Use "MOVE" with individual variable/field moves instead of "MOVE-CORRESPONDING", creates more coding but is more efficient (in ECC6 MOVE-CORRESPONDING is faster in almost all the cases).

    TABLE BUFFERING :  This can help in improving the performance but this has to be used with caution. Buffering of tables leads to data being read from the buffer rather than from table. Buffer sync with table happens periodically. If this table is a transaction table chances are that the data is changing for a particular selection criteria. Using table buffering in such cases is not recommended. Use Table Buffering for Master Data or data which is having low transaction. Also, when using a table with buffering ensure that the general criteria which is used for buffering is also being used. If the criteria of buffering is not same as the one used in your code, it has no effect and buffering will not be useful instead it will cause a overhead on performance since evrytime it will fill the buffer. In such cases use 'BYPASSING BUFFER' to speed up the SQL's.

    INDEX: Creation of Index for improving performance should not be taken without thought. Index speeds up the performance but at the same time adds two overheads namely;  memory and insert/append performance. When INDEX is created, memory is used up for storing the index and index sizes can be quite big on large transaction tables! When inserting new entry in the table, all the index's are updated. More index more time. More the amount of data, bigger the indices, larger the time for updating all the indices.

    PERFORM : When writing a subroutine, always provide type for all the paramters. This reduces the overhead which is present when system determines on it's own each type from the formal parameters that are passed.

    Updating/Modifying internal tables: In case the amount of entries are more than 200 in an internal table and some field's are being manipulated or some column of the internal table being filled based on some logic, usage of FIELD-SYMBOLS is recommended. This removes the overhead of moving the operation via a seperate memory area (work area).

AbhishekV
Explorer
0 Kudos

Hi VijayKrishna,

Se30 and St05 indeed would be a good starting point.

Please proceed as follows:

1) Check for any Nested loop usage in the report and avoid Nested Loop usage(this is would significantly increase the performance).

2) Have a look at the results from se30 and st05 and make changes accordingly.

shashi_thirus
Participant
0 Kudos

Hi Vijay Krishna,

As of my knowledge, Go to SE30 Transaction then Click on Tips and Tricks.

You will find the Tips & Tricks, how to improve the performance of Report. As per Klaus Babi suggestion also helpful to you ST05 Transaction.


Regard's,

Shashi Kanth.

Former Member
0 Kudos

Hi Vijaykrishna,

In addition to above given ways you can also go for Code Inspector and Extended Program Check(For Extended Program Check your report should be active). Using these, you can check for the errors and ways to resolves those errors and improve your code.

Regards,

PS

gaurab_banerji
Active Participant
0 Kudos

check the technical spec first to understand what the report is doing. this will help you to chalk out which areas can be optimized. if you dont do this you will spend too much time reading code and this will spoil your day.

avoid repititive selects on same table as much as possible. make sure all the selects are outside of loops. try to select data at one go for a table. if selects are slow try creating table indexes to make selects faster.

n.b.... avoiding CORRESPONDING FIELDS OF doesnt help.. in fact using it is better. I have read a blog on this... sap handles things better than us so you can use it safely.

try using field symbols .. use sorted internal tables if possible... specially the ones you will search into

most performance issues can be solved by non repititive calls to function modules / table selects which can be done in one go..

Former Member
0 Kudos

Hello Vijay,

The following link will be useful to you.

http://scn.sap.com/thread/856474

Regards,

Nagalakshmi.

Former Member
0 Kudos

Hi,

The major thing you want to find is Read table statement.

If binary search is not used or that table is not sorted before used first sort it.

Avoid Loop inside loops use read.

Also use code inspector and se30.

Also before for all entries check for data in that table.

sort the int tables based on key and delete adjacent duplicates where ever required.

These are the main factors which will help you in reports..

Last but not least try using Field symbols instead of work area where you can find a significance in performance.

Thanks,

Dinesh.

former_member200434
Participant
0 Kudos

Hi,

use extended program and code inspector to check performance issues.

former_member184958
Active Participant
0 Kudos

Hi Gudala,

You don't bother about the line of coding, but try to use code inspector and extended program check and sql trace sql05, runtime analysis se30.

And also don't use the following statement,

Select... endselect.

Nested select statement.

Nested loop.

Move-corresponding.

Try to use the following,

Field-symbols.

For all entries.

read statement.

Kind & Regards,

John.