ABAP Performance: Analysis and Optimization SAP NetWeaver Application Server - ABAP Course Version: 93 Course Duration: 5 Day(s) Publication Date: 18-10-2012 Publication Time: 1025
Copyright Copyright SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. Additionally this publication and its contents are provided solely for your use, this publication and its contents may not be rented, transferred or sold without the express permission of SAP AG. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. Trademarks Microsoft, WINDOWS, NT, EXCEL, Word, PowerPoint and SQL Server are registered trademarks of Microsoft Corporation. IBM, DB2, OS/2, DB2/6000, Parallel Sysplex, MVS/ESA, RS/6000, AIX, S/390, AS/400, OS/390, and OS/400 are registered trademarks of IBM Corporation. ORACLE is a registered trademark of ORACLE Corporation. INFORMIX -OnLine for SAP and INFORMIX Dynamic ServerTM are registered trademarks of Informix Software Incorporated. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, the Citrix logo, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, MultiWin and other Citrix product names referenced herein are trademarks of Citrix Systems, Inc. HTML, DHTML, XML, XHTML are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology. JAVA is a registered trademark of Sun Microsystems, Inc. JAVASCRIPT is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. SAP, SAP Logo, R/2, RIVA, R/3, SAP ArchiveLink, SAP Business Workflow, WebFlow, SAP EarlyWatch, BAPI, SAPPHIRE, Management Cockpit, mysap.com Logo and mysap.com are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other products mentioned are trademarks or registered trademarks of their respective companies. Disclaimer THESE MATERIALS ARE PROVIDED BY SAP ON AN "AS IS" BASIS, AND SAP EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR APPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THESE MATERIALS AND THE SERVICE, INFORMATION, TEXT, GRAPHICS, LINKS, OR ANY OTHER MATERIALS AND PRODUCTS CONTAINED HEREIN. IN NO EVENT SHALL SAP BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES OF ANY KIND WHATSOEVER, INCLUDING WITHOUT LIMITATION LOST REVENUES OR LOST PROFITS, WHICH MAY RESULT FROM THE USE OF THESE MATERIALS OR INCLUDED SOFTWARE COMPONENTS. g201471433036
Contents Contents Course Overview... v Course Goals... v Course Objectives...vi Unit 1: Fundamentals of SAP Basis... 1 SAP Web Application Server Basics... 1 Unit 2: Memory Management... 2 Web Application Server Memory Areas... 2 Web Application Server Memory Allocation... 2 Work Process Memory... 2 Analyzing Memory Consumption... 2 Unit 3: Introduction to Performance Analysis... 3 Components of a Dialog Step... 3 Analyzing the Components of a Single Dialog Step... 3 Analyzing Workload and Performance of an SAP System... 3 Measuring Times in ABAP Reports... 3 Analyzing ABAP Reports at Design Time... 4 Unit 4: Understanding Database Accesses... 5 Performance Aspects of a Database... 5 Analyzing Expensive SQL Statements at Runtime... 5 Using Database Indexes... 5 Creating Database Indexes... 5 Analyzing Previous Database Accesses... 6 Unit 5: Programming Database Accesses... 7 Accessing Single Database Tables... 7 Accessing Single Special Tables... 7 Accessing Multiple Database Tables... 7 Unit 6: Data Buffering... 8 Buffering Database Tables... 8 Analyzing Table Buffering... 8 Buffer Modules... 8 Shared Memory, Shared Buffer, and Shared Objects... 8 18-10-2012 SAP AG. All rights reserved. iii
Contents Unit 7: Internal Tables... 9 Definition of Internal Tables... 9 Efficient Access to Internal Tables... 9 Advanced Topics with Internal Tables... 9 Analyzing ABAP Reports at Runtime... 9 Unit 8: Remote Function Calls...10 Basics of Remote Function Calls... 10 Analyzing Remote Function Calls... 10 18-10-2012 SAP AG. All rights reserved. iv
Course Overview Course Overview This course gives ABAP developers an introduction into the reasons why ABAP reports have to be developped in special ways regarding to database and memory accesses. It explains memory consumption of an ABAP instance as well as different ways to access data, both of a database table or an internal table. Tools to understand the program flow, data accesses or memory consumption are also explained. Target Audience This course is intended for the following audiences: Experienced ABAP programmers Experienced ABAP consultants Performance officers Hotline and support officers Administrators Course Prerequisites Required Knowledge BC400 ABAP Workbench Programming experience in ABAP Programming experience in relational databases Recommended Knowledge SAPTEC Fundamentals of SAP NetWeaver Application Server BC401 ABAP Objects BC430 ABAP Data Dictionary Course Goals This course will prepare the participant to: Learn to monitor and analyze the performance of ABAP programs in context with the system. resources Learn to optimize database accesses and ABAP processing Learn to work with essential tools like run time analysis, SQL and system trace, workload analysis, code inspector, etc Learn the essentials of SAP Memory Management 18-10-2012 SAP AG. All rights reserved. v
Course Overview Course Objectives After completing this course, the participant will be able to: Memory areas and memory allocation Analyzing workload and performance of an SAP system Performance aspects of databases Analyzing expensive SQL statements Using and creating indexes Accessing database tables Buffering strategies Definition and usage of internal tables Analyzing Remote Function Calls 18-10-2012 SAP AG. All rights reserved. vi
Unit 1 Fundamentals of SAP Basis Unit Overview Lesson: SAP Web Application Server Basics Learn about the technical basics of an SAP system based on SAP NetWeaver Understand the role of work processes during the processing of ABAP reports 18-10-2012 SAP AG. All rights reserved. 1
Unit 2 Memory Management Unit Overview Lesson: Web Application Server Memory Areas Distinguish between the different memory areas of an SAP instance Lesson: Web Application Server Memory Allocation Describe the sequence of how memory is allocated by a work process during program processing Explain how, for example, the used operating system may influence memory allocation Analyze the memory allocation of an SAP instance Lesson: Work Process Memory Explain how a work process handles ABAP reports Know how data can be shared between different user and session contexts Lesson: Analyzing Memory Consumption Analyzing Memory Consumption 18-10-2012 SAP AG. All rights reserved. 2
Unit 3 Introduction to Performance Analysis Unit Overview Lesson: Components of a Dialog Step Name the different parts of the Dialog Response Time of a dialog step Explain first performance relevant rules for data access and data processing Lesson: Analyzing the Components of a Single Dialog Step Analyzing the Components of a Single Dialog Step Lesson: Analyzing Workload and Performance of an SAP System Work with the Workload Monitor to analyze an SAP system Lesson: Measuring Times in ABAP Reports Work with an ABAP framework that allows you to measure the processing time of ABAP subroutines 18-10-2012 SAP AG. All rights reserved. 3
Lesson: Analyzing ABAP Reports at Design Time Analyze ABAP Reports at Design Time 18-10-2012 SAP AG. All rights reserved. 4
Unit 4 Understanding Database Accesses Unit Overview This unit should be more or less database independent. But VERY often it is necesary to demonstrate an explainde theoretical concpt with an example. And because Oracle is still the most used database with SAP systems, Oracle is used for that demonstration. That could give some participants the impression that this is an Oracle based course. Well, that we can t prevent. But make clear at the very beginning of this course and this unit, that the concepts of the different database vendors are similar, but the techniques are different. Lesson: Performance Aspects of a Database Describe the typical architecture of a database Discuss the processing of an SQL request in an Oracle database Lesson: Analyzing Expensive SQL Statements at Runtime Analyze Expensive SQL Statements at Runtime Lesson: Using Database Indexes Explain how indexes are used and how they can improve access to database data Analyze the usage of indexes for accessing database data Lesson: Creating Database Indexes Create database indexes based on basic rules 18-10-2012 SAP AG. All rights reserved. 5
Lesson: Analyzing Previous Database Accesses Analyze expensive SQL statements in the Shared Cursor Cache Identify the ABAP coding causing expensive SQL statements 18-10-2012 SAP AG. All rights reserved. 6
Unit 5 Programming Database Accesses Unit Overview Lesson: Accessing Single Database Tables List the different statements that read data in OPEN SQL Explain the rules to optimize read accesses to the database Explain the rules to optimize change accesses to the database Lesson: Accessing Single Special Tables Work with pooled and clustered tables to access data from the database Lesson: Accessing Multiple Database Tables Work with database views Work with ABAP JOINs 18-10-2012 SAP AG. All rights reserved. 7
Unit 6 Data Buffering Unit Overview Lesson: Buffering Database Tables Explain how and why data from database tables is buffered in the memory of SAP instances Describe the problems that may occur with data buffering Lesson: Analyzing Table Buffering List the tools for analyzing table buffering Describe the criteria for buffering tables Lesson: Buffer Modules Explain how transactional and master data may be buffered and accessed in local objects at program runtime Lesson: Shared Memory, Shared Buffer, and Shared Objects Explain the shared memory and the shared buffer in ABAP programming Work with ABAP shared objects 18-10-2012 SAP AG. All rights reserved. 8
Unit 7 Internal Tables Unit Overview Lesson: Definition of Internal Tables Describe the different types of internal tables Lesson: Efficient Access to Internal Tables List the access strategies to internal tables Explain the scaling behavior of READ TABLE... WITH KEY Program efficient accesses to internal tables by avoiding nonlinear operations Lesson: Advanced Topics with Internal Tables Work with secondary indexes for internal tables Explain the difference between the READ into a work area and the assigning of field symbols Lesson: Analyzing ABAP Reports at Runtime Analyze ABAP Reports at Runtime 18-10-2012 SAP AG. All rights reserved. 9
Unit 8 Remote Function Calls Unit Overview Lesson: Basics of Remote Function Calls Explain the available RFC techniques in ABAP Lesson: Analyzing Remote Function Calls Explain the different time contributions to RFC communication Analyze the RFC workload to an SAP instance 18-10-2012 SAP AG. All rights reserved. 10