‎2007 Jul 16 7:44 AM
hi,
In performance tunning
how wiil help "CHECK" instead of IF/ENDIF and "CASE" instead of IF/ENDIF
Thank you
ASHOK KUMAR
‎2007 Jul 16 7:49 AM
Hi,
<b>Check in debug mode when you are using IF ENDIF if the condition is false in a LOOP ENDLOOP, you will still goto ENDLOOP statement and then back to LOOP. Where as when you use CHECK its again back to LOOP statement.</b>
CHECK is very usfeul when you want ALL THAT CODE BELOW THE CHECK statement to be executed only when the condition is correct.
So when you use CHECK it will come out of the current loop pass and continues with the next loop pass.
WHERE as IF is like next statements will be checked. or executed.
CHECK Is more useful but needs to be used carefully as it skips all the code after that.
Regards,
Sesh
‎2007 Jul 16 7:49 AM
Hi,
<b>Check in debug mode when you are using IF ENDIF if the condition is false in a LOOP ENDLOOP, you will still goto ENDLOOP statement and then back to LOOP. Where as when you use CHECK its again back to LOOP statement.</b>
CHECK is very usfeul when you want ALL THAT CODE BELOW THE CHECK statement to be executed only when the condition is correct.
So when you use CHECK it will come out of the current loop pass and continues with the next loop pass.
WHERE as IF is like next statements will be checked. or executed.
CHECK Is more useful but needs to be used carefully as it skips all the code after that.
Regards,
Sesh
‎2007 Jul 16 7:50 AM
Hi
instead of writing multiple IF/ENDIF it is better to write CASE...WHEN..ENDCASE.
Betetr not to use CHECK use if..
If it is one or two or three times it doesn't effect the performance much
say if there are some 30 if..endif statements it looks ackward and ugly to see so many if..endif..and performance also not so good
see the doc
1) Dont use nested select statements
2) If possible use for all entries in addition
3) In the where addition make sure you give all the primary key
4) Use Index for the selection criteria.
5) You can also use inner joins
6) You can try to put the data from the first select statement into an Itab and then in order to select the data from the second table use for all entries in.
7) Use the runtime analysis SE30 and SQL Trace (ST05) to identify the performance and also to identify where the load is heavy, so that you can change the code accordingly
ABAP performance depends upon various factors and in devicded in three parts:
1. Database
2. ABAP
3. System
Run Any program using SE30 (performance analys) to improve performance refer to tips and trics section of SE30, Always remember that ABAP perfirmance is improved when there is least load on Database.
u can get an interactive grap in SE30 regarding this with a file.
also if u find runtime of parts of codes then use :
Switch on RTA Dynamically within ABAP Code
*To turn runtim analysis on within ABAP code insert the following code
SET RUN TIME ANALYZER ON.
*To turn runtim analysis off within ABAP code insert the following code
SET RUN TIME ANALYZER OFF.
Always check the driver internal tables is not empty, while using FOR ALL ENTRIES
Avoid for all entries in JOINS
Try to avoid joins and use FOR ALL ENTRIES.
Try to restrict the joins to 1 level only ie only for tables
Avoid using Select *.
Avoid having multiple Selects from the same table in the same object.
Try to minimize the number of variables to save memory.
The sequence of fields in 'where clause' must be as per primary/secondary index ( if any)
Avoid creation of index as far as possible
Avoid operators like <>, > , < & like % in where clause conditions
Avoid select/select single statements in loops.
Try to use 'binary search' in READ internal table. Ensure table is sorted before using BINARY SEARCH.
Avoid using aggregate functions (SUM, MAX etc) in selects ( GROUP BY , HAVING,)
Avoid using ORDER BY in selects
Avoid Nested Selects
Avoid Nested Loops of Internal Tables
Try to use FIELD SYMBOLS.
Try to avoid into Corresponding Fields of
Avoid using Select Distinct, Use DELETE ADJACENT
Check the following Links
http://www.sapgenie.com/abap/performance.htm
http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp
check the below link
http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm
See the following link if it's any help:
http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp
Check also http://service.sap.com/performance
and
books like
http://www.sap-press.com/product.cfm?account=&product=H951
http://www.sap-press.com/product.cfm?account=&product=H973
http://www.sap-img.com/abap/more-than-100-abap-interview-faqs.htm
http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp
Performance tuning for Data Selection Statement
http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm
Debugger
http://help.sap.com/saphelp_47x200/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm
http://www.cba.nau.edu/haney-j/CIS497/Assignments/Debugging.doc
http://help.sap.com/saphelp_erp2005/helpdata/en/b3/d322540c3beb4ba53795784eebb680/frameset.htm
Run Time Analyser
http://help.sap.com/saphelp_47x200/helpdata/en/c6/617cafe68c11d2b2ab080009b43351/content.htm
SQL trace
http://help.sap.com/saphelp_47x200/helpdata/en/d1/801f7c454211d189710000e8322d00/content.htm
<b>Reward points for useful Answers</b>
Regards
Anji
‎2007 Jul 16 3:24 PM
HI
IN THE PERFORMANCE POINT OF VIEW CHECK MUST NOT BE USED
IF AND ENDIF IS BETTER THAN CHECK
CASE IS BETTER THAN IF AND ENDIF
IN THE PERFORMANCE POINT OF VIEW
REWARD IF USEFUL
REGARDS
NARESH