- Run-time analysis is used to check the efficiency of a program or function module or t-code in terms of what is the load on the database server, application server, presentation server etc.
- The run-time analysis will display the load in a graph with %'s and the time in micro seconds.
- The graph will be displayed with either red color or green color.
- If the graph contains green color, then the program execution time is very good or very less.
- If the graph contains red color, the program execution time is very bad or very long .
- Always make sure the the load on database server should be less than 40% and should be green.
T-code for run-time analysis is SE30 or SAT(Latest Versions).
Example program on run time analysys in SAP ABAP
Program1: Create a program to get MARA details and display as below.
REPORT ZSAN_SE30. **Runtime analysis using SE30 DATA : IT_MARA TYPE TABLE OF MARA. DATA : WA_MARA TYPE MARA. SELECT * FROM MARA INTO TABLE IT_MARA UP TO 500 ROWS. LOOP AT IT_MARA INTO WA_MARA. WRITE:/ WA_MARA-MATNR, WA_MARA-MTART, WA_MARA-MBRSH, WA_MARA-MATKL, WA_MARA-MEINS. ENDLOOP.
Go to SE30, provide program name, click on execute button, the out put will bi displayed, click on back and click on evaluate to see run-time analysis.
The result will be like below(may vary based on server capacity).
In the above image you can see ABAP and database layers are in red color, means the time taken to process these layers is more.
Now change the above program like below and test again.
REPORT ZSAN_SE30. TYPES: BEGIN OF TY_MARA, MATNR TYPE MARA-MATNR, MTART TYPE MARA-MTART, MBRSH TYPE MARA-MBRSH, MATKL TYPE MARA-MATKL, MEINS TYPE MARA-MEINS, END OF TY_MARA. **Runtime analysis using SE30 DATA : IT_MARA TYPE TABLE OF TY_MARA. DATA : WA_MARA TYPE ty_MARA. SELECT MATNR MTART MBRSH MATKL MEINS FROM MARA INTO TABLE IT_MARA UP TO 500 ROWS. LOOP AT IT_MARA INTO WA_MARA. WRITE:/ WA_MARA-MATNR, WA_MARA-MTART, WA_MARA-MBRSH, WA_MARA-MATKL, WA_MARA-MEINS. ENDLOOP.Now go to SE30 and follow the above process.
Now the evaluation will be like below.
You can see the database layer is in green color means the standards are good.