Reporting Made Easy Report Development Tools Building Custom Reports in the R/3 System Release 4.0B SAP Labs, Inc Palo Alto, California Copyright © 1999 by SAP AG All rights reserved Neither this documentation nor any part of it may be copied or reproduced in any form or by any means or translated into another language, without the prior consent of SAP AG SAP AG makes no warranties or representations with respect to the content hereof and specifically disclaims any implied warranties of merchantability or fitness for any particular purpose SAP AG assumes no responsibility for any errors that may appear in this document The information contained in this document is subject to change without notice SAP AG reserves the right to make any such changes without obligation to notify any person of such revision or changes SAP AG makes no commitment to keep the information contained herein up to date Trademarks SAP, the SAP logo, R/2, R/3, ABAP, and other SAP related products mentioned herein are registered or unregistered trademarks of SAP AG All other products mentioned in this document are registered or unregistered trademarks of their respective companies R/3 Simplification Group SAP Labs, Inc 3475 Deer Creek Road Palo Alto, CA 94304 www.saplabs.com/simple simplify-r3@sap.com Second edition Printed in the United States of America ISBN 1-893570-63-0 This book uses EcoFLEX™ lay-flat binding With this lay-flat feature—developed by and exclusively available at Johnson Printing Service (JPS)—you can open this book and keep it open without it snapping shut on you You need not worry about breaking the spine EcoFLEX makes books like this one easier to use Contents at a Glance About This Guide xi Part 1: Core Report Development Tools Chapter 1: Choosing the Right Report Development Tool 1–1 Chapter 2: ABAP Query 2–1 Chapter 3: Report Painter/Report Writer 3–1 Chapter 4: Drilldown Reporting 4–1 Chapter 5: LIS Standard Analyses 5–1 Chapter 6: LIS Flexible Analyses 6–1 Part 2: Business Information Warehouse Chapter 7: Overview of Reporting in the Business Information Warehouse 7–1 Chapter 8: Creating Workbooks 8–1 Chapter 9: Creating Queries 9–1 Chapter 10: Working With the BEx Browser 10–1 Chapter 11: Business Information Warehouse: Special Topics 11–1 Part 3: Other Report Development Topics Chapter 12: ABAP Report Templates 12–1 Appendix A: The ABAP List Viewer A–1 Appendix B: Extended Export of Lists (XXL) B–1 Appendix C: SAP Open Information Warehouse C–1 Appendix D: Web Reporting D–1 Appendix E: LIS Information Structures E–1 Appendix F: Creating a Drilldown Report in the Executive InformationSystem (EIS) F–1 Appendix G: Glossary G–1 Report Development Tools iii Contents at a Glance iv Reporting Made Easy Acknowledgments The publisher thanks the following individuals who provided time, expertise, and resources to help make the Reporting Made Easy series possible Julie Beehler and John Huck (Anheuser-Busch, Inc.) Ron Greenfield, David Jones, and Ben Matteson (Anthro Corporation) Ann Zediker and Chuck Marx (Arthur Andersen, LLP) Bruce Scott (BrightStar Information Technology Group, Inc.) Amy Vorbeck (CCAi, Inc.) Nancy White (Chevron Corporation) Tom Eisenhart (Lucent Technologies, Inc.) Hans Hess, Sven Jensen (Metamor Enterprise Solutions) Igor Smelansky and Winnie Chang (Network Associates) Erin Andrews (PricewaterhouseCoopers LLP) Mohamad Hakim (Softline, Inc.) Clare Carver (The Pair Group) Margie Coolidge, Ron Giovannelli, and Patrick Zalamea (Ziatech Corporation) Pamela Anderson and Robert Smith (publishing consultants) Werner Aigner, Simone Baeumer, Tami Becker, Randi Bethel, Sylvia Chaudoir, Muge Das, Elisa Davis, Ray Fan, Sampath Gomatam, Maria Gregg, Darrin Griggy, Reiner Herde, Michael Hielbrink, James Hill, Reiner Hoeltke, Claus Horn, Beverly Kennedy, Ruediger Kretschmer, Michael LaStella, Sylvia Lehnen, Robert Loughran, Bob Mackenzie, Rhondda Macleod, Natascha Marienfeld, Steffen Mock, Heinrich Mueller, Rolf Neuhaus, Doug O’Brian, Mary Odabashian, Wolfgang Otter, Brian Potter, Lori Ritzert, L.Kay Roberts, Thomas Rumbach, Sabine Scheppat-Hinze, Stefan Sigg, Donald Silva, Birgit Starmanns, Gerald Steele, Henri Stein, Peter Tillert, Cindy Vineberg, Wolfgang Weiss, Daniela Weckesser, April Wu, Daniel-Benjamin Zaidspiner, Peter Zimmerer, and Theo Zimmermann (SAP) v Reporting Made Easy Detailed Table of Contents About This Guide xiii Why This Guide xv How This Guide Is Organized xv Part 1: Core Report Development Tools xv Part 2: Business Information Warehouse xvii Part 3: Other Report Development Topics xviii Who This Guide Is For xix How to Use This Guide xix Report Examples Use IDES Data xix Training and Documentation xix Navigating the System xix Special Icons xx Typographical Conventions xxi Part 1: Core Report Development Tools Chapter 1: Choosing the Right Report Development Tool 1–1 Choosing the Right Reporting Tool: The Big Picture 1–2 Organization of Report Development Tools 1–3 Using the Application Hierarchy 1–6 Using the Tools Summary Matrix 1–9 Using the Tool Summaries 1–11 Learning More About Report Development Tools 1–12 Review 1–13 Chapter 2: ABAP Query 2–1 Learning the Basics of ABAP Query 2–2 What Is ABAP Query? 2–2 Who Uses ABAP Query? 2–2 Functional Areas 2–3 User Groups 2–4 Queries 2–4 Related Terminology 2–5 How to Access ABAP Query Components? 2–5 How Does ABAP Query Differ from Other Reporting Tools? 2–6 What Are the Prerequisites? 2–6 Creating a Report with ABAP Query 2–7 Step 1: Create a Functional Area 2–8 Step 2: Assign Required Fields to Functional Groups 2–11 Step 3: Generate the Functional Area 2–16 Report Development Tools vi Detailed Table of Contents Step 4: Create User Group 2–17 Step 5: Assign the Functional Area to the User Group 2–17 Step 6: Create the Query 2–18 Running the Query .2–26 Understanding the Report List 2–27 Getting the Most from ABAP Query: Tips & Tricks 2–27 Adding Selection Criteria in a Functional Area .2–27 Using Table Joins in a Functional Area 2–29 Assigning Reports with Report Call Functionality in a Query 2–32 More Helpful Hints for Report Developers 2–32 Review 2–33 Where to Learn More 2–33 Chapter 3: Report Painter/Report Writer 3–1 Learning the Basics of Report Painter/Report Writer 3–2 Overview 3–2 What Is Report Painter? 3–2 What Is Report Writer? 3–2 How Is Report Painter Different From Report Writer? 3–3 How Is Report Painter/Report Writer Organized? 3–5 Related Terminology 3–5 Report Definition 3–5 Key Figures 3–5 Characteristics 3–6 How to Access Report Painter/Report Writer? 3–6 How Does Report Painter Differ from Other Reporting Tools? 3–6 What Are the Prerequisites? 3–6 Creating a Report with Report Painter 3–7 Example 1: Gross Profit Margin Report 3–8 Step 1: Determine the Table 3–9 Step 2: Find the Library 3–9 Step 3: Create Sets 3–9 Step 4: Create Variables 3–9 Step 5: Create Report 3–9 Define Rows 3–10 Define Columns 3–12 General Data Selection 3–14 Change Layout 3–17 Example 2: Billing Report .3–18 Understanding the Report List 3–26 Getting the Most from Report Painter/Report Writer: Tips & Tricks 3–26 LIS Evaluation Structures .3–26 Report/Report Interface 3–28 Background on Using the Report/Report Interface .3–30 Report/Report Interface 3–30 Working With Formula Variables 3–31 Rolling Periods: Fixed Number of Periods up to Period p Across Fiscal Years 3–31 Display Periods of Quarter q 3–32 Display Periods of a Quarter Containing Period p 3–33 Display Variable Number of Columns for Periods p1 to p2 3–33 Working With a Shifted Fiscal Year 3–34 Report Development Tools vii Detailed Table of Contents Creating User Exits for Formula Variables 3–35 Creating a Report With Actual/Budget Values Depending on Period p 3–35 General Notes on Formula Variables 3–36 Web Interface to Report Writer Reports 3–36 More Report Painter/Report Writer Tips & Tricks 3–36 Use Report Groups 3–36 Consider Background Processing 3–37 Copy Before You Create 3–37 Use Variation 3–37 Naming Conventions 3–37 Review 3–38 Where to Learn More 3–38 Chapter 4: Drilldown Reporting 4–1 Learning the Basics of Drilldown Reporting 4–2 What Is Drilldown Reporting? 4–2 Drilldown Functions 4–2 Where Is Drilldown Reporting Used? 4–3 Types of Drilldown Reports 4–3 Basic Report 4–3 Form Report 4–4 How Is Drilldown Reporting Organized? 4–4 Key Figures 4–5 Characteristics 4–5 Forms 4–5 Related Terminology 4–5 How Does Drilldown Reporting Differ From Other Reporting Tools? 4–6 What are the Prerequisites? 4–6 Quick View of the Output 4–7 Creating a Drilldown Report: Profitability Analysis 4–7 Basics Steps in Creating Drilldown Reports in CO–PA 4–9 Creating a Two-axis Form Report With Key Figures (in CO-PA) 4–9 Step 1: Set Operating Concern and Currency 4–10 Step 2: Define the First Axis (Columns) 4–12 Step 3: Define the Second Axis (Rows) 4–15 Step 4: Select General Data and Desired Characteristics 4–17 Step 5: Attach Your Form to a Report 4–19 Step 6: Execute Report and Analyze Data 4–21 Getting the Most from Drilldown Reporting: Tips & Tricks 4–23 Characteristic Variable 4–24 Report/Report Interface 4–25 Exceptions 4–26 Cells 4–27 Freezing Report Data 4–29 Background Processing 4–30 Characteristic Hierarchies 4–32 Review 4–33 Where to Learn More 4–34 viii Reporting Made Easy Detailed Table of Contents Chapter 5: LIS Standard Analyses 5–1 What Is the Logistics Information System (LIS)? 5–2 Learning the Basics of Standard Analyses 5–2 Terminology 5–3 Information Structure 5–3 Characteristic 5–4 Key Figure 5–4 Periodicity (or Period Unit) 5–4 Initial List 5–4 Drilldown List 5–4 How to Access LIS Standard Analyses? 5–5 How Does LIS Standard Analyses Differ from Other Reporting Tools? 5–7 Integration 5–7 Planning 5–7 Graphics 5–7 Exception Analysis (Early Warning System—EWS) 5–7 Enhancements 5–7 Archiving 5–8 User Settings 5–8 What Are the Prerequisites? 5–8 Creating a Standard Analysis 5–9 Step 1: Decide Which Data You Want to See .5–10 Step 2: Determine the Component Information System 5–10 Step 3: Enter the Selection Criteria for the Standard Analysis 5–11 Step 4: Run the Standard Analysis .5–11 Step 5: Create the Initial List .5–12 Step 6: Slice and Dice Data as Needed 5–13 Drilldown 5–13 Key Figures 5–15 Sort Key Figures 5–16 Ranking List 5–17 Settings 5–17 ABC Analyses 5–18 Document Information 5–20 Getting the Most from LIS Standard Analyses: Tips & Tricks 5–22 Information Structures 5–22 Communication Structures 5–23 Miscellaneous .5–23 Troubleshooting Tips 5–24 Review 5–24 Where to Learn More 5–24 Chapter 6: LIS Flexible Analyses 6–1 Learning the Basics of LIS Flexible Analyses 6–2 What Is Flexible Analysis? 6–2 How Is Flexible Analysis Different From Standard Analysis? 6–2 How Is LIS Flexible Analysis Organized? 6–3 Terminology 6–4 Information structure 6–4 Characteristic 6–4 Key figure 6–4 Periodicity (or Period unit) 6–5 Report Development Tools ix Detailed Table of Contents Evaluation structure 6–5 Evaluation 6–5 List 6–5 Formula 6–5 How to Access LIS Flexible Analyses? 6–5 How Does LIS Flexible Analyses Differ from Other Reporting Tools? 6–6 What Are the Prerequisites? 6–6 Creating a Report with Flexible Analyses 6–7 Step 1: Create the Evaluation 6–8 Step 2: Generate the Evaluation 6–14 Step 3: Execute the Evaluation 6–15 Step 4: Modify the Layout .6–16 Getting the Most from LIS Flexible Analyses: Tips & Tricks 6–18 Additional Help to Report Developers 6–18 Review 6–19 Where to Learn More 6–19 Part 2: Business Information Warehouse Chapter 7: Overview of Reporting in the Business Information Warehouse 7–1 What Is the Business Information Warehouse? 7–2 Business Information Warehouse Architecture: An Overview 7–2 What Is the Business Explorer (BEx) ? 7–4 How Is the Business Explorer Organized? 7–4 Business Explorer Browser 7–4 Business Explorer Analyzer 7–4 What Is the Business Information Warehouse Server? 7–5 What Is the Administrator Workbench? 7–5 What Is the Meta Data Repository? 7–5 What Is the Staging Engine? 7–5 What Is an InfoCube? 7–6 What Is the Operational Data Store? 7–6 What Is the OLAP Processor? 7–6 What Are Source Systems? 7–7 Business Content in the Business Information Warehouse 7–7 Business Information Warehouse Terminology 7–8 InfoObject 7–8 InfoSource 7–8 InfoCatalog 7–8 Business Information Warehouse Reporting Environment 7–9 What Is a Query? 7–10 What Is a Workbook? 7–10 Where Do We Go From Here? 7–11 Review 7–12 Chapter 8: Creating Workbooks 8–1 Overview 8–2 Before Getting Started 8–3 Business Scenario 8–3 A Quick Look at the Output 8–4 x Reporting Made Easy Detailed Table of Contents Report 1: Sales Analysis Report 8–4 Report 2: Gross Profit Analysis Report 8–4 Creating a Workbook: An Overview 8–5 Step 1: Starting the BEx Analyzer 8–6 What Is the Business Explorer Toolbar? 8–6 Step 2: Creating a Workbook Template 8–7 Formatting the Workbook Background 8–8 Hiding the Window Views 8–9 Hiding the Microsoft Excel Toolbars .8–10 Inserting Company Logo .8–10 Saving a Local Copy of the Template 8–11 Step 3: Saving the Template to the InfoCatalog .8–12 Step 4: Inserting Queries into the Workbook 8–14 Step 5: Adding Visual Basic Functionality to Workbook 8–16 Creating Pushbuttons 8–16 Creating a Textbox 8–21 Step 6: Saving the Workbook to the InfoCatalog 8–23 Chapter 9: Creating Queries 9–1 Overview 9–2 Before Getting Started 9–2 Creating Queries Based on the SAP DemoCube 9–3 Creating and Saving a New Query 9–3 The Query Toolbar 9–6 Defining a Filter in a Query 9–9 Creating Restricted Key Figures .9–10 Creating a New Formula—Percentage Change InfoObject .9–12 Creating a Calculated Key Figure 9–14 Working with BW Queries: Additional Functions 9–16 Suppressing the Display of Repeated Texts and/or Key Values 9–17 In Queries 9–17 In Workbooks 9–18 Disabling Interactive Drilldown 9–19 Selecting Filter Values for Characteristics 9–20 Slice & Dice: Drilling Down 9–21 Slice & Dice: Drilling Across 9–22 Sorting Data 9–23 Positioning/Hiding the Totals Row 9–24 Converting Currencies 9–25 Displaying Reports Graphically: Using Charts 9–27 Modifying an Existing Query 9–32 Review 9–34 Chapter 10: Working With the BEx Browser 10–1 Overview 10–2 Creating Channels in the InfoCatalog .10–3 Assigning Users to Channels 10–5 Adding Workbooks to the Favorites Channel 10–6 Report Development Tools xi Detailed Table of Contents Executing Workbooks in the BEx Browser 10–6 BEx Browser Toolbar 10–7 Creating and Populating a Cluster 10–7 Previewing the Structure of a Workbook Query 10–9 Copying Workbooks 10–9 Using Shortcuts in the BEx Browser 10–10 SAP Transaction Shortcuts (R/3 Release 4.0) 10–10 Internet Shortcuts .10–11 Workbook Shortcuts 10–11 Moving Shortcuts from the Desktop to the BEx Browser 10–12 Review .10–13 Chapter 11: Business Information Warehouse: Special Topics 11–1 Using the Administrator Workbench 11–2 Working with SAP DemoCubes 11–3 Activating the SD DemoCube .11–3 Loading Data into SD DemoCube 11–4 Activating the SD DemoCube Channel .11–5 Assigning Users to the SD DemoCube Channel 11–6 Viewing Data in the SAP DemoCube 11–7 Using the InfoCatalog .11–10 Accessing the InfoCatalog 11–10 From the BW Main Screen 11–10 From the BW Administrator Workbench 11–11 Arranging Workbooks in the Enterprise InfoCatalog 11–12 Creating Directories in the Enterprise InfoCatalog 11–12 Getting the Most out of BW: Tips & Tricks 11–14 Predefining Options in Queries not Workbooks 11–14 Protecting Workbooks .11–14 Checking Version Information for the BEx Analyzer 11–15 Using Percentage Functions in Queries .11–15 Disabling Interactive Drilldown 11–18 Using Visual Basic: API-Calls .11–19 Creating a Drilldown Pushbutton 11–19 Automatically Refreshing Workbook Data 11–20 Embedding a Logo in the BEx Browser 11–22 Step 1: Save Logo as a Bitmap (BMP) 11–22 Step 2: Define the Logo Characteristics in the BW System 11–23 Using the Style Tool 11–25 Part 3: Other Report Development Topics Chapter 12: ABAP Report Templates 12–1 First Things First 12–2 Before You Consider ABAP 12–2 Before You Start 12–2 ABAP Reporting Basics .12–3 Basic Structure .12–3 Types of ABAP Reports 12–4 Traditional Reports 12–4 xii Reporting Made Easy Detailed Table of Contents Interactive Reports 12–5 Traditional Versus Interactive Reports 12–6 Template Approach to Report Development 12–7 Why Use a Report Template? 12–7 Working With Report Templates .12–8 Report Specification Form and Report Templates 12–8 Traditional Report Template 12–9 Interactive Report Template 12–15 Getting the Most from ABAP Report Development: Tips & Tricks .12–17 General Programming Hints .12–18 Where to Learn More 12–18 Appendix A: ABAP List Viewer A–1 Overview A–2 What Is The ABAP List Viewer? A–2 ABAP List Viewer: Cost Versus Benefit Analysis A–3 Report Lists Without ABAP List Viewer A–4 Report Lists With ABAP List Viewer A–5 Technical Notes A–9 Sample Code Using ALV (Release 4.0B) A–10 Review A–15 Where to Learn More A–15 Appendix B: Extended Export of Lists (XXL) B–1 Overview B–2 Functional Areas B–3 XXL Support in the R/3 System B–3 The XXL List Viewer B–4 Where to Learn More B–7 Appendix C: SAP Open Information Warehouse C–1 What Is the SAP Open Information Warehouse? C–2 Basic Terminology C–3 OIW Information Catalog C–3 OIW Browser C–3 Information Object C–3 Add-In .C–3 Data Sources C–3 OIW Frontend for Microsoft Excel C–4 The OIW BAPI .C–4 Working With OIW Source and Meta Data C–5 Defining the OIW Meta Data C–5 Display Standard OIW Information Catalog C–7 Creating a Self-Defined OIW Information Catalog C–8 Activating the OIW Browser in Excel C–10 Downloading/Refreshing the OIW Information Catalog in Excel C–11 Defining and Fine-tuning OIW Reports in Excel C–12 Running OIW Reports in Excel C–15 Report Development Tools xiii Detailed Table of Contents Running an OIW Report With Automatic Update C–15 Running an OIW Report Without Automatic Update/Calculation C–17 Saving and Running an OIW Report as a Snapshot Version C–18 Getting the Most from SAP OIW: Tips & Tricks C–20 Review C–20 Creating Reports with OIW C–21 Where to Learn More C–21 Appendix D: Web Reporting D–1 Overview D–2 Web Reporting: First Things First D–2 Executing Reports .D–2 Web Reporting Browser .D–2 Customizing D–2 Web Reporting: First Things First D–3 The Web Reporting Environment D–3 WebRFC Function Modules for Web Reporting D–3 WWW_GET_REPORT .D–4 WWW_GET_SELSCREEN D–4 WWW_GET_TREE_LIST D–4 WWW_GET_TREE_NODE D–4 WWW_GET_NODE_LIST D–4 Executing Reports D–5 Executing Reports Without a Selection Screen D–5 Executing Reports with a Selection Screen D–6 Using WWW_GET_SELSCREEN D–6 Specifying Report Variants in URLs D–8 Executing Reports with WWW_GET_REPORT D–8 Specifying Select-Options D–8 Specifying Report Parameters D–9 Specifying Checkboxes D–9 Specifying Radio Buttons D–10 Report Parameter Syntax in URLs D–10 URL Syntax for Report Variants D–10 URL Syntax for Select-options D–10 URL Syntax for Parameters .D–11 URL Syntax for Checkboxes .D–12 URL Syntax for Radio Buttons D–12 Interactive Web Reporting D–12 Processing Interactive Events D–12 AT LINE-SELECTION D–13 AT PF D–13 AT USER-COMMAND .D–13 Linking URLs to SAP Web Lists .D–15 Linking R/3 Function Calls to SAP Web Lists D–16 WWW_SET_URL .D–21 WWW_GET_URL D–22 WWW_LIST_TO_HTML D–22 Starting the Web Reporting Browser D–23 Customizing Reports D–25 xiv Reporting Made Easy Detailed Table of Contents Enabling Report Trees D–25 Standard Templates for Web Reporting D–25 Placeholders in Web Reporting Templates D–26 WEBREPORTING_TREELIST D–26 WEBREPORTING_TREENODE .D–26 WEBREPORTING_SELSCREEN .D–27 WEBREPORTING_REPORT D–27 Customizing Web Reporting Templates D–28 The _TEMPLATE parameter D–28 The _TEMPLATE_SET Parameter D–28 Where to Learn More D–29 Appendix E: LIS Information Structures E–1 Overview E–2 Sales Information System E–2 Purchasing Information System E–3 Inventory Controlling E–3 Shop Floor Information System E–4 Quality Management Information System E–4 Plant Maintenance Information System E–5 Retail Information System E–5 Where to Learn More E–5 Appendix F: Creating a Drilldown Report in the Executive Information System (EIS) F–1 Creating a Drilldown Report in EIS F–2 Quick View of the Output F–2 Basic Steps F–2 Step 1: Create a Form for the EIS Report F–4 Step 2: Create the Drilldown Report Using the Form F–12 Step 3: Execute Report and Analyze the Output F–15 Where to Learn More F–18 Appendix G: Glossary G–1 Appendix H: Index H–1 Report Development Tools xv Detailed Table of Contents xvi Reporting Made Easy ... Core Report Development Tools Chapter 1: Choosing the Right Report Development Tool 1–1 Choosing the Right Reporting Tool: The Big Picture 1–2 Organization of Report Development Tools. .. Access Report Painter /Report Writer? 3–6 How Does Report Painter Differ from Other Reporting Tools? 3–6 What Are the Prerequisites? 3–6 Creating a Report with Report Painter... Self-Defined OIW Information Catalog C–8 Activating the OIW Browser in Excel C–10 Downloading/Refreshing the OIW Information Catalog in Excel C–11 Defining and Fine-tuning