Tuning of Z reports
I am facing a problem. When I login in client & start Z report, it takes more time (aprox. 10 minutes) for its query to run. but after executing, I again run the report, it completes that query in 15 secs.
Pl. help why this happens.
Also help me how I can improve the performance of my z reports so that they extract records fast.
The following are the checks you need to do for performance tuning your report. So check all the conditions.
1) Where possible internal tables are defined as sorted or hashed and binary read used
2) Does the program avoid using too many nested IF statements to make sure that the code is better readable and maintainable? (CASE statement can be used instead of nested IF wherever possible).
3) Does the program ensure the Internal table is not Empty before executing the Select query having u2018FOR ALL ENTRIESu2019 command?
4) SELECT query having FOR ALL ENTRIES addition must use the key field.
5) All the primary keys of the table or index selected (if not reason has been documented)
6) Does the program avoid SELECT statements inside a loop? (Instead, all the data should be fetched at one shot using commands like INTO TABLE ITAB, FOR ALL ENTRIES. Then looping can be done on Internal Tables).
7) Multiple identical selects from the same table avoided.
8)Does the program avoid nested SELECT ENDSELECT statements?
9)Does the program avoid using INTO-CORRESPONDING and MOVE-CORRESPONDING command? (Instead, INTO TABLE can be used or direct assignment to table fields must be used.)
10)Have only the required database fields been retrieved? (Do not use select * always)
11) Are the internal tables used without header line? (Explicit Work areas have to be declared for the table headers)
Is SELECT SINGLE used only if all the keys are provided?
12) Otherwise SELECT UP TO 1 ROWS must be used.
Is the u2018READ internal table...TRANSPORTING fieldsu2019 clause used during u2018MODIFY Internal Tableu2019? (It is preferred so that only the required fields are read.)
13)Runtime analysis (SE30) and extended program check (SLIN) are performed and necessary corrections are made.
In any loop, check for the controlled exit.
14)Ensure that the loop does not go on infinitely unless there is a specific required
if you have followed all these then your code is perfect.
Any doubts please let me know.
Edited by: Shobana k on Sep 12, 2008 9:18 AM