SlideShare a Scribd company logo
ABAP Performance Analysis
SCI - Code Inspector ST05 – Performance Trace SE30 ABAP Runtime Analysis Tools of the Trade
Tools of the Trade SCI – Code Inspector Static analysis of the quality of the code.  Scans your program code and reports on potential problems particularly in the area of performance and security. Benefits: Analysis of SQL WHERE clause of SELECT, UPDATE and DELETE statements. Identifies select statements that do not handle sy-subrc return codes Use of statements that infer ominous database access Identifies statements that bypass buffering Drill through support from results screen to program source statement. Etc. Disadvantages: Static checks cannot identify the relevancy of a piece of code Cannot determine the frequency of execution of a statement of code.
ST05 Performance Trace The Performance Trace allows you to record database access, locking activities, and remote calls of reports and transactions in a trace file and to display the performance log as a list. It also provides extensive support for analyzing individual trace records. Benefits: Comprehensive tools set for evaluation of SQL statements Integrated tools for accessing DDIC information Disadvantages: Dynamic analysis requires equivalent production data content Limited to database access analysis, no evaluation of code path execution Tools of the Trade
SE30 ABAP Runtime Analysis The runtime analysis provides an overview of the duration and performance of your source code, from individual statements up to complete transactions. Benefits: Quickly identifies the percentage of time spent in database in contrast to abap code execution. Evaluation of modularization units, modules, performs, functions, etc. Analyze internal table operations Disadvantage: Dynamic analysis requires equivalent production data content Lacks the integration of comprehensive SQL analysis tools Tools of the Trade
Code Inspector Sophisticated static program checks should be part of each development process . Standard Checks Performed  Syntax checks and program generation Normal ABAP syntax check Extended Program Check Program Generation Security checks Use of statements deemed critical Use of statements the infers ominous database access Selected statements that do not handle system return code
Code Inspector Sophisticated static program checks should be part of each development process . Standard Checks Performed (continued) Performance checks Select statements that implicitly bypass SAP table buffers Check statements inside of SELETCT…ENDSELECT loops Nested loops over internal tables and nested SELECT statements Analysis of WHERE clause to determine support database indices Search operations Search for single tokens Search for complete statements
Code Inspector Sophisticated static program checks should be part of each development process . Access directly from the Abap Editor, from SE38 or SE80
Code Inspector Sophisticated static program checks should be part of each development process . 16 31 6 Informational Warnings Error Extended Program Checks Errors: No EXCEPTION to set SY-SUBRC Declared for CALL FUNCTION. Evaluate to remove sy-subrc condition or possibly warrants the review of the function module for modification. This line contains a BREAK-POINT statement. All break points should be removed from production code unless specific reasons warrant their use. Dangerous use of TRANSLATE in a multilingual system. Evaluate to determine if this will have an impact when we implement other languages. Performance Checks Errors: Table VEPO no field from Table Index in WHERE condition Can the format of where clause be changed to use an index Create an index to support where condition if warranted. Warnings: Table KNMT: No First Field from Table Index in WHERE condition Further analysis may be required to determine if this is a problem.  Dynamic analysis that determines frequency of execution can be used to determine impact of the warning.
Transaction ST05 Used to analyze and fine-tune program’s database access Dynamic analysis Must be logged into processor where job is running that is subject to the trace. Should pre-load the application before trace is started. Should strive to use this trace in QA unless production problem cannot be re-created. Types of traces available SQL Trace Enqueue Trace RFC Trace Buffer Trace Performance Trace
Performance Trace Activate Trace with Filter Used to start the trace against another process. Activate Trace Use to start the trace in your current dialog process.  Once activated you may exit the transaction and run the program that you wish to trace. User name  Useful to start a trace another users dialog session. Transaction  Further limits bounder of trace to a tcode. Process ID  Used to activate trace against a batch process.
Performance Trace Display Trace
Performance Trace
Performance Trace  -  SQL Statement Summary
 
 
 
 
Is there any SELECT * statements in use? Change them to SELECT COL1,COL2,COL3 specifying columns Are any CHECK statements embedded in SELECT..ENDSELECTs Incorporate the check statement logic in WHERE clause Do SELECTs use appropriate DB Index or is table buffered? Change logic, create an index, or buffer table Is nested SELECTs being used to retrieve data? Convert to DB join, view or SELECT FOR ALL ENTRIES IN ITAB Are there SELECTs without WHERE clauses, on tables that grow? You need to redesign the solution. Are SELECTs to master data tables buffered? Store master data in itab and use READ TABLE…BINARY SEARCH to eliminate duplicate access with same key Performance Trace -  SQL Statement Evaluation Checklist
Is SELECT…APPEND ITAB…ENDSELECT being used? Change processing to read data immediately into ITAB Is SELECT ORDER BY statements being used? Read data to ITAB and then sort, unless DB Index supports order by. Is program using calculations and summations that can be done on the database via SUM, AVG, MIN or MAX functions of SELECT? Use the calculations available on the SELECT statement. Are ITABs processed using READ TABLE itab WITH KEY? Change table accesses to use BINARY SEARCH method. Performance Trace -  SQL Statement Evaluation Checklist
Tips for Running Trace Limit the duration of the trace to 10 minutes or less Preload the program once to initialize database and cursor buffers To access trace results later Save the trace or.. Record stop and start time of trace Utilize trace SQL statement summary function 5,000ms access per execution, general rule of thumb Make note of the appserver of the job you are tracing Only ONE trace can be active on an appserver. Performance Trace
Transaction SE30 Excessive or unnecessary use of modularization units CPU intensive program functions Inefficient or redundant database access Runtime Analysis Three phases of the ABAP runtime analysis. Setting limits for the data that is measured Measuring the data Analyzing the data.
Runtime Analysis
Runtime Analysis Initial Screen
Runtime Analysis Variant: Statements Filter Limit the trace to specified type of program statements.
Runtime Analysis Variant:  Duration and Type Max File size default is 2meg Aggregation: Full – one trace record for each program part or instruction. By Call – one trace record for every calling position None – one trace record for each call. LARGE FILE!
Runtime Analysis Measurement Overview Abap interpreter Database System Statements Green bar indicates less that 50% of the total runtime. Database bar will be red when more than 25% runtime.
Runtime Analysis Database Table Hit List –  shows table names number of accesses , table type and buffering mode sorted by access time.
Group Hit List Individual call instructions grouped by categories.  Indicates the gross runtime and the number of times executed. Runtime Analysis
Runtime Analysis Internal Table Hit List List of all internal table accesses.  Shows the number of accesses, the gross and net time required and the total memory consumed.
Runtime Analysis Call Hierarchy Shows the chronological sequence of analyzed objects, the gross and net time taken at each call level.
Runtime Analysis - Statistics
Statistics Runtime Analysis Number of form routines called in the specified program Called forms Number of Remote Function Calls RFC call.  Number of function modules called from a module pool   Called F. modules Number of function modules defined within a function group  Defined F modules Number of form routines defined in the specified program Defined forms Number of methods called from the specified program Called methods Number of methods defined in the specified program Defined methods Memory occupied by the global data of the program when loaded (in bytes) Global data def.   Memory occupied by the program when loaded (in bytes) Load Size Program name Program
Always perform static source evaluation Summary Do not leave a trace running for an extended period of time, consume system resources You must be logged in to the same appserver as the process you are tracing. Powerful set of analysis tools With power and the freedom to use them comes responsibility
Questions?

More Related Content

What's hot (20)

PPT
Introduction to ABAP
sapdocs. info
 
PDF
Line item dimension and high cardinality dimension
Praveen Kumar
 
PPT
List Processing in ABAP
sapdocs. info
 
PDF
SAP ABAP data dictionary
Revanth Nagaraju
 
PPT
Alv theory
Phani Kumar
 
PDF
Beginner's Guide: Programming with ABAP on HANA
Ashish Saxena
 
PPTX
SAP BADI Implementation Learning for Functional Consultant
Ankit Sharma
 
PDF
Session 14 validation_steps_sap
Amitava Saha, PMP®
 
PDF
Sap abap material
Kranthi Kumar
 
PDF
SAP ODATA Overview & Guidelines
Ashish Saxena
 
DOC
Important tables for sap sd
Roshan Prasad
 
PDF
Smartforms interview questions with answers
Uttam Agrawal
 
PDF
Table maintenance generator and its modifications
scribid.download
 
PDF
Introducing enhancement framework.doc
Kranthi Kumar
 
PDF
S4 HANA Business Partner Configuration@Ganesh Tarlana
Ganesh Tarlana
 
PDF
SAP BI Generic Extraction Using a Function Module.pdf
KoushikGuna
 
PDF
Beginner’s guide to sap abap 1
Panduka Bandara
 
PDF
BADI IMPLEMENTATION.pdf
ssuser08365f
 
DOCX
Field symbols
skumar_sap
 
PPTX
Sap abap
Jugul Crasta
 
Introduction to ABAP
sapdocs. info
 
Line item dimension and high cardinality dimension
Praveen Kumar
 
List Processing in ABAP
sapdocs. info
 
SAP ABAP data dictionary
Revanth Nagaraju
 
Alv theory
Phani Kumar
 
Beginner's Guide: Programming with ABAP on HANA
Ashish Saxena
 
SAP BADI Implementation Learning for Functional Consultant
Ankit Sharma
 
Session 14 validation_steps_sap
Amitava Saha, PMP®
 
Sap abap material
Kranthi Kumar
 
SAP ODATA Overview & Guidelines
Ashish Saxena
 
Important tables for sap sd
Roshan Prasad
 
Smartforms interview questions with answers
Uttam Agrawal
 
Table maintenance generator and its modifications
scribid.download
 
Introducing enhancement framework.doc
Kranthi Kumar
 
S4 HANA Business Partner Configuration@Ganesh Tarlana
Ganesh Tarlana
 
SAP BI Generic Extraction Using a Function Module.pdf
KoushikGuna
 
Beginner’s guide to sap abap 1
Panduka Bandara
 
BADI IMPLEMENTATION.pdf
ssuser08365f
 
Field symbols
skumar_sap
 
Sap abap
Jugul Crasta
 

Viewers also liked (18)

PPT
Sap abap ale idoc
Bunty Jain
 
DOC
Badi document
hamisha_malik
 
PPTX
SAP ABAP using OOPS - JH Softech
Vikram P Madduri
 
PPT
The ABAP Query
PeterHBrown
 
PDF
Exercise in alv
Kranthi Kumar
 
PDF
Dialog programming ABAP
Jefferson Mutuva
 
PPTX
SAP ALE Idoc
Jugul Crasta
 
PDF
Abap reports
Milind Patil
 
PPT
SAP ABAP Latest Interview Questions with Answers by Garuda Trainings
Garuda Trainings
 
PPT
SAP ABAP - Needed Notes
Akash Bhavsar
 
DOC
SAP ABAP Material
renterpserver
 
PPT
Batch input session
Kranthi Kumar
 
DOCX
Badis
Rajesh Kumar
 
PPT
BATCH DATA COMMUNICATION
Kranthi Kumar
 
PPT
Call transaction method
Kranthi Kumar
 
PPTX
Smart form
Tarek Yehia
 
PPTX
Sap abap online training By Keylabstraining
keylabstraining
 
PPTX
Sap abap
Goodrich IT Solutions
 
Sap abap ale idoc
Bunty Jain
 
Badi document
hamisha_malik
 
SAP ABAP using OOPS - JH Softech
Vikram P Madduri
 
The ABAP Query
PeterHBrown
 
Exercise in alv
Kranthi Kumar
 
Dialog programming ABAP
Jefferson Mutuva
 
SAP ALE Idoc
Jugul Crasta
 
Abap reports
Milind Patil
 
SAP ABAP Latest Interview Questions with Answers by Garuda Trainings
Garuda Trainings
 
SAP ABAP - Needed Notes
Akash Bhavsar
 
SAP ABAP Material
renterpserver
 
Batch input session
Kranthi Kumar
 
Badis
Rajesh Kumar
 
BATCH DATA COMMUNICATION
Kranthi Kumar
 
Call transaction method
Kranthi Kumar
 
Smart form
Tarek Yehia
 
Sap abap online training By Keylabstraining
keylabstraining
 
Ad

Similar to Maximizing SAP ABAP Performance (20)

PPT
2007 SAPTech Ed
Michelle Crapo
 
PPT
Test Director Ppt Training
shrikantg
 
PPT
Test automation process _ QTP
Bharathi Krishnamurthi
 
PPT
Test automation process
Bharathi Krishnamurthi
 
PDF
End to-end root cause analysis minimize the time to incident resolution
Cleo Filho
 
PPTX
Practical SPARQL Benchmarking Revisited
Rob Vesse
 
PDF
Hovitaga OpenSQL Editor - Overview
Hovitaga Kft.
 
PDF
Test automation
Jitendra Malviya
 
PPT
Basic software-testing-concepts
medsherb
 
PPTX
Sql server lesson12
Ala Qunaibi
 
PPSX
Sql server lesson12
Ala Qunaibi
 
PDF
OORPT Dynamic Analysis
lienhard
 
PDF
Performance testing checklist.pdf
AnuSelvaraj2
 
PPT
Automation tips
Ritu Mangla
 
PPT
Sd Revision
mrsmackenzie
 
PPTX
CTFL chapter 06
Davis Thomas
 
PPS
Sanjeevi's SDLC Guest Lecture in Anna University campus at AU-PERS Centre (Ye...
Sanjeevi Prasad
 
PPTX
Modeling and Testing Dovetail in MagicDraw
Gregory Solovey
 
PPT
Software development slides
iarthur
 
PPTX
Database Testing.pptx
ssuser88c0fd1
 
2007 SAPTech Ed
Michelle Crapo
 
Test Director Ppt Training
shrikantg
 
Test automation process _ QTP
Bharathi Krishnamurthi
 
Test automation process
Bharathi Krishnamurthi
 
End to-end root cause analysis minimize the time to incident resolution
Cleo Filho
 
Practical SPARQL Benchmarking Revisited
Rob Vesse
 
Hovitaga OpenSQL Editor - Overview
Hovitaga Kft.
 
Test automation
Jitendra Malviya
 
Basic software-testing-concepts
medsherb
 
Sql server lesson12
Ala Qunaibi
 
Sql server lesson12
Ala Qunaibi
 
OORPT Dynamic Analysis
lienhard
 
Performance testing checklist.pdf
AnuSelvaraj2
 
Automation tips
Ritu Mangla
 
Sd Revision
mrsmackenzie
 
CTFL chapter 06
Davis Thomas
 
Sanjeevi's SDLC Guest Lecture in Anna University campus at AU-PERS Centre (Ye...
Sanjeevi Prasad
 
Modeling and Testing Dovetail in MagicDraw
Gregory Solovey
 
Software development slides
iarthur
 
Database Testing.pptx
ssuser88c0fd1
 
Ad

Maximizing SAP ABAP Performance

  • 2. SCI - Code Inspector ST05 – Performance Trace SE30 ABAP Runtime Analysis Tools of the Trade
  • 3. Tools of the Trade SCI – Code Inspector Static analysis of the quality of the code. Scans your program code and reports on potential problems particularly in the area of performance and security. Benefits: Analysis of SQL WHERE clause of SELECT, UPDATE and DELETE statements. Identifies select statements that do not handle sy-subrc return codes Use of statements that infer ominous database access Identifies statements that bypass buffering Drill through support from results screen to program source statement. Etc. Disadvantages: Static checks cannot identify the relevancy of a piece of code Cannot determine the frequency of execution of a statement of code.
  • 4. ST05 Performance Trace The Performance Trace allows you to record database access, locking activities, and remote calls of reports and transactions in a trace file and to display the performance log as a list. It also provides extensive support for analyzing individual trace records. Benefits: Comprehensive tools set for evaluation of SQL statements Integrated tools for accessing DDIC information Disadvantages: Dynamic analysis requires equivalent production data content Limited to database access analysis, no evaluation of code path execution Tools of the Trade
  • 5. SE30 ABAP Runtime Analysis The runtime analysis provides an overview of the duration and performance of your source code, from individual statements up to complete transactions. Benefits: Quickly identifies the percentage of time spent in database in contrast to abap code execution. Evaluation of modularization units, modules, performs, functions, etc. Analyze internal table operations Disadvantage: Dynamic analysis requires equivalent production data content Lacks the integration of comprehensive SQL analysis tools Tools of the Trade
  • 6. Code Inspector Sophisticated static program checks should be part of each development process . Standard Checks Performed Syntax checks and program generation Normal ABAP syntax check Extended Program Check Program Generation Security checks Use of statements deemed critical Use of statements the infers ominous database access Selected statements that do not handle system return code
  • 7. Code Inspector Sophisticated static program checks should be part of each development process . Standard Checks Performed (continued) Performance checks Select statements that implicitly bypass SAP table buffers Check statements inside of SELETCT…ENDSELECT loops Nested loops over internal tables and nested SELECT statements Analysis of WHERE clause to determine support database indices Search operations Search for single tokens Search for complete statements
  • 8. Code Inspector Sophisticated static program checks should be part of each development process . Access directly from the Abap Editor, from SE38 or SE80
  • 9. Code Inspector Sophisticated static program checks should be part of each development process . 16 31 6 Informational Warnings Error Extended Program Checks Errors: No EXCEPTION to set SY-SUBRC Declared for CALL FUNCTION. Evaluate to remove sy-subrc condition or possibly warrants the review of the function module for modification. This line contains a BREAK-POINT statement. All break points should be removed from production code unless specific reasons warrant their use. Dangerous use of TRANSLATE in a multilingual system. Evaluate to determine if this will have an impact when we implement other languages. Performance Checks Errors: Table VEPO no field from Table Index in WHERE condition Can the format of where clause be changed to use an index Create an index to support where condition if warranted. Warnings: Table KNMT: No First Field from Table Index in WHERE condition Further analysis may be required to determine if this is a problem. Dynamic analysis that determines frequency of execution can be used to determine impact of the warning.
  • 10. Transaction ST05 Used to analyze and fine-tune program’s database access Dynamic analysis Must be logged into processor where job is running that is subject to the trace. Should pre-load the application before trace is started. Should strive to use this trace in QA unless production problem cannot be re-created. Types of traces available SQL Trace Enqueue Trace RFC Trace Buffer Trace Performance Trace
  • 11. Performance Trace Activate Trace with Filter Used to start the trace against another process. Activate Trace Use to start the trace in your current dialog process. Once activated you may exit the transaction and run the program that you wish to trace. User name Useful to start a trace another users dialog session. Transaction Further limits bounder of trace to a tcode. Process ID Used to activate trace against a batch process.
  • 14. Performance Trace - SQL Statement Summary
  • 15.  
  • 16.  
  • 17.  
  • 18.  
  • 19. Is there any SELECT * statements in use? Change them to SELECT COL1,COL2,COL3 specifying columns Are any CHECK statements embedded in SELECT..ENDSELECTs Incorporate the check statement logic in WHERE clause Do SELECTs use appropriate DB Index or is table buffered? Change logic, create an index, or buffer table Is nested SELECTs being used to retrieve data? Convert to DB join, view or SELECT FOR ALL ENTRIES IN ITAB Are there SELECTs without WHERE clauses, on tables that grow? You need to redesign the solution. Are SELECTs to master data tables buffered? Store master data in itab and use READ TABLE…BINARY SEARCH to eliminate duplicate access with same key Performance Trace - SQL Statement Evaluation Checklist
  • 20. Is SELECT…APPEND ITAB…ENDSELECT being used? Change processing to read data immediately into ITAB Is SELECT ORDER BY statements being used? Read data to ITAB and then sort, unless DB Index supports order by. Is program using calculations and summations that can be done on the database via SUM, AVG, MIN or MAX functions of SELECT? Use the calculations available on the SELECT statement. Are ITABs processed using READ TABLE itab WITH KEY? Change table accesses to use BINARY SEARCH method. Performance Trace - SQL Statement Evaluation Checklist
  • 21. Tips for Running Trace Limit the duration of the trace to 10 minutes or less Preload the program once to initialize database and cursor buffers To access trace results later Save the trace or.. Record stop and start time of trace Utilize trace SQL statement summary function 5,000ms access per execution, general rule of thumb Make note of the appserver of the job you are tracing Only ONE trace can be active on an appserver. Performance Trace
  • 22. Transaction SE30 Excessive or unnecessary use of modularization units CPU intensive program functions Inefficient or redundant database access Runtime Analysis Three phases of the ABAP runtime analysis. Setting limits for the data that is measured Measuring the data Analyzing the data.
  • 25. Runtime Analysis Variant: Statements Filter Limit the trace to specified type of program statements.
  • 26. Runtime Analysis Variant: Duration and Type Max File size default is 2meg Aggregation: Full – one trace record for each program part or instruction. By Call – one trace record for every calling position None – one trace record for each call. LARGE FILE!
  • 27. Runtime Analysis Measurement Overview Abap interpreter Database System Statements Green bar indicates less that 50% of the total runtime. Database bar will be red when more than 25% runtime.
  • 28. Runtime Analysis Database Table Hit List – shows table names number of accesses , table type and buffering mode sorted by access time.
  • 29. Group Hit List Individual call instructions grouped by categories. Indicates the gross runtime and the number of times executed. Runtime Analysis
  • 30. Runtime Analysis Internal Table Hit List List of all internal table accesses. Shows the number of accesses, the gross and net time required and the total memory consumed.
  • 31. Runtime Analysis Call Hierarchy Shows the chronological sequence of analyzed objects, the gross and net time taken at each call level.
  • 32. Runtime Analysis - Statistics
  • 33. Statistics Runtime Analysis Number of form routines called in the specified program Called forms Number of Remote Function Calls RFC call. Number of function modules called from a module pool Called F. modules Number of function modules defined within a function group Defined F modules Number of form routines defined in the specified program Defined forms Number of methods called from the specified program Called methods Number of methods defined in the specified program Defined methods Memory occupied by the global data of the program when loaded (in bytes) Global data def. Memory occupied by the program when loaded (in bytes) Load Size Program name Program
  • 34. Always perform static source evaluation Summary Do not leave a trace running for an extended period of time, consume system resources You must be logged in to the same appserver as the process you are tracing. Powerful set of analysis tools With power and the freedom to use them comes responsibility