Application Development and Automation 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: 
Read only

Need help in Performance tuning

Former Member
0 Likes
695

Hi All,

I am facing some performance issues in my program. The program taking a hell lot of time to execute and some times timing out without giving the out put. This is a report program with ALV output. It is handling mainly Sales related data.

The program is fetching a huge volume of data from different tables and processing this bulk data inside the loops several times. In most of the queries I am unable to supply all key fields, because my requirement is like that only. I have many places in my program i am using inner loop and function modules inside loop etc.

Any pointers on this will be a great help.

Regards,

Jijeesh P G

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
668

Hi,

Use SE30 and ST05 for better analysis.

SE30 will give u the time taken by ABAP, DB and APPL respectively. The bar in red will indicate the most time consumed area. Then start looking into it.

ST05 will give the analysis of SELECTs in your prog.

The Tool details are available in the forum

Do you have Unnecessary Select in the loop??

Try to combine the loops, if possible. It may save a bit.

Regards,

Madhu

6 REPLIES 6
Read only

Former Member
0 Likes
668

Hi,

Because we dont know how you implemented the code, these are some suggestions.

Avoid MOVE-CORRESPONDING instead create the internal table in the order of fields specified in the SELECT query.

Avoid SELECT stmts in LOOP. or LOOPS in LOOPs.

Better to use READ stmts after sorting tables.

Instead of JOINS go for FOR ALL ENTRIES.

Use more subroutines .

Thanks and regards.

Read only

Former Member
0 Likes
669

Hi,

Use SE30 and ST05 for better analysis.

SE30 will give u the time taken by ABAP, DB and APPL respectively. The bar in red will indicate the most time consumed area. Then start looking into it.

ST05 will give the analysis of SELECTs in your prog.

The Tool details are available in the forum

Do you have Unnecessary Select in the loop??

Try to combine the loops, if possible. It may save a bit.

Regards,

Madhu

Read only

alison_lloyd
Active Participant
0 Likes
668

See tips and tricks in se30

If database access is the issue use st05 - combined table access then aggregate by table then look at which tables use the most percentage of the time then look for the selections to these tables in your program and optimise.

Things to keep in mind:

Make sure you aren't retrieving the same data more than once from the database - read instead

If using for all entries sort the table used by the fields you are using first.

Check for all entries table is not empty.

Delete adjacent duplicates from the for all entries table

Run SCI on your program

FM inside loops - can the data be don 'on change on' or equivalent i.e. are you calling more than absolutely necessary

Read only

Former Member
0 Likes
668

1) Make sure that any READ or LOOP inside an outer LOOP accesses the inner table with an appropriate key (either using BINARY search when reading a standard table or using sorted/hashed tables for inner tables only). This helps in most cases.

2) If the tables witdh is more than aprox. 30 bytes LOOP ASSIGNING <wa> may help a bit. Declare <wa> for each table separately using the tables line type (otherway type casting would cost some additional time).

3) You may use FM SAPGUI_PROGRESS_INDICATOR in the outer loops to inform the user while he is waiting.

4) A COMMIT from time to time will reset the measured time for timeout ( and therefore avoids timeouts - do NOT use without checking step 1) ).

4) The programm may use virtual memory if a huge amount of data is selected ( I have seen dumps in due to the fact that nor more disk space was available). So - if STEPS 1)-3) failed - look a the process for rollling in/out).

Read only

Former Member
0 Likes
668

/people/hema.rao/blog/2006/09/25/performance-tuning--an-overlooked-activity

Read only

Former Member
0 Likes
668

Hi,

Please find below the links to tips on Performance Tuning.

https://wiki.sdn.sap.com/wiki/display/ABAP/Performance

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/abapPerformanceand+Tuning

Reward if found helpful.

Warm Regards,

R Adarsh