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: 

Tuning of Z reports

former_member227596
Participant
0 Kudos

Dear Ababpers,

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.

thanks

Vikas Puri

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Vikas,

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

3 REPLIES 3

Former Member
0 Kudos

Hi,

First Check with the BASIS Team, whether any problem on the server side if any performance issue is there.

Other wise if only your program query is taking time.Put a trace in St05 and SE30 and test which query is taking time and then debug the program and see why the query is taking time and go with SAP standards to rectify the query .

Thanks and Regards,

Harsh

Former Member
0 Kudos

Hi Vikas,

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

Former Member
0 Kudos

It's likely that the database has cached both the query plan and the result set.