How To...Use a Debugging Script to Easily Create a Test Environment for a SQL-Script Planning Function in PAK

Similar documents
How To... Reuse Business Objects and Override Operations of a Business Object

How To Set up NWDI for Creating Handheld Applications in SAP NetWeaver Mobile 7.1

How to Use Function Keys in Mobile Applications for Handhelds

How To Recover Login Module Stack when login to NWA or Visual Administrator is impossible

How To... Configure Integrated Configurations in the Advanced Adapter Engine

How To... Master Data Governance for Material: BADI USMD_SSW_SYSTEM_METHOD_CALLER to create successor change request

SAP NetWeaver How-To Guide

How To... Promote Reports and Input Schedules Through Your System Landscape

How To... Master Data Governance for Material: BADI USMD_SSW_PARA_RESULT_HANDLER to merge result of parallel workflow tasks

How To...Configure Integration of CUP with SPM

Simplified Configuration of Single System Update in Maintenance Optimizer

How-To... Add Sensitive Content into an Area

SAP NetWeaver How-To Guide How to use Process Execution Manager Using SAP Test Data Migration Server

How To Generate XSD Schemas from Existing MDM Repositories

How To...Custom BADI for rounding off values in SAP BUSINESSOBJECTS Planning and Consolidation, version for SAP NetWeaver.

How To... Master Data Governance for Material: File Down- and Upload

MDM Syndicator Create Flat Syndication File

SAP NetWeaver How-To Guide

Visual Composer - Task Management Application

SAP - How-To Guide MDG Custom Object Data Replication How to Configure Data Replication for MDG Custom Objects (Flex Option)

SAP NetWeaver How-To Guide. SAP NetWeaver Gateway Virtualization Guide

Setting Up an Environment for Testing Applications in a Federated Portal Network

Install TREX for CAF Version 1.00 March 2006

SAP Composite Application Framework. Creating a Content Package Object

How To Configure the Websocket Integration with SAP PCo in SAP MII Self Service Composition Environment Tool

How To Customize the SAP User Interface Using Theme Editor

SAP GRC Access Control: Configuring compliant user provisioning (formerly Virsa Access Enforcer) into CUA Systems

How to Set Up and Use the SAP OEE Custom UI Feature

How To Integrate the TinyMCE JavaScript Content Editor in Web Page Composer

Access Control 5.3 Implementation Considerations for Superuser Privilege Management ID-Based Firefighting versus Role-Based Firefighting Applies to:

Process Control 2.5 Implementation Checklist

How To... Use the BPC_NW Mass User Management Tool

Do Exception Broadcasting

How to do Breakdown Validation in SAP BPC 7.0 for the SAP NetWeaver Platform

Integrate a Forum into a Collaboration Room

What s New / Release Notes SAP Strategy Management 10.1

A Step-By-Step Guide on File to File Scenario Using Xslt Mapping

Create Partitions in SSAS of BPC Version 1.00 Feb 2009

How To... Configure Drill Through Functionality

SAP Composite Application Framework. Creating an External Service type Callable Object in Guided Procedures

How to Upgr a d e We b Dynpro Them e s from SP S 9 to SP S 1 0

Web Page Composer anonymous user access

link SAP BPC Excel from an enterprise portal Version th of March 2009

configure an anonymous access to KM

Consuming Web Dynpro components in Visual Composer.

How to... Build a Planning Function that Deletes Comments in BW

SAP Composite Application Framework. Creating a Callable Object in Group: Miscellaneous

How to Set Up and Use the SAP OEE Custom KPI Andons Feature

Integrating a Web Service in a Composite Application. SAP Composite Application Framework

How to Create a New SAPUI5 Development Component

Cache Settings in Web Page Composer

Enterprise Portal Logon Page Branding

Quick Reference Guide SAP GRC Access Control Compliant User Provisioning (formerly Virsa Access Enforcer): HR Triggers

Data Validation in Visual Composer for SAP NetWeaver Composition Environment

How to View Dashboards in the Self Service Composition Environment with Additional Metadata

How To Extend User Details

How To Enable Business Workflow for SAP NetWeaver Gateway 2.0

How To Troubleshoot SSL with BPC Version 1.01 May 2009

Configure SSO in an SAP NetWeaver 2004s Dual Stack

How to Translate a Visual Composer Model Part I

Building a Tax Calculation Application

Configure UD Connect on the J2EE Server for JDBC Access to External Databases

SAP How-To Guide. Master Data Governance for Material. How To... Adjust MDG Homepage. Applicable Releases: EhP6, MDG 6.1

Extract Archived data from R3

How to Browse an Enterprise Services Registry in Visual Composer

WDA - Custom themes for Web Dynpro ABAP applications without SAP Enterprise Portal integration

SDN Contribution HOW TO CONFIGURE XMII BUILD 63 AND IIS 6.0 FOR HTTPS

How To Configure IDoc Adapters

Configure TREX 6.1 for Efficient Indexing. Document Version 1.00 January Applicable Releases: SAP NetWeaver 04

Transport in GP. How-to Guide Beginning with SAP NetWeaver 2004s SPS06. Version 2.00 January 2006

Installation Guide Business Explorer

Use Business Objects Planning and Consolidation (version for the Microsoft platform) BPF services in Xcelsius

View Time Security for crystalreports.com

How To Develop a Simple Web Service Application Using SAP NetWeaver Developer Studio & SAP XI 3.0

SAP MII: Leveraging the Data Buffering Feature for Connection Error Handling.

Work with Variables in SAP NetWeaver Visual Composer Version 1.00 May 2006

xmii UDS Overview and Troubleshooting

Create Monitor Entries from an update routine

Preview of Web Services Reliable Messaging in SAP NetWeaver Process Integration 7.1

How to Install SAP Netweaver 2004s ABAP Edition on Your Local PC

Create Monitor Entries from a Transformation routine

Visual Composer Build Process

How to Set Up Data Sources for Crystal Reports Layouts in SAP Business One, Version for SAP HANA

Consuming Directory API in ABAP

How To... Transport Forum Content Between SAP NetWeaver Systems

How to Fast-Switch Integration Scenarios between SAP PI Runtimes Part II: Web Dispatcher

Authentication of a WS Client Using a SAP Logon Ticket

Using Business Graphics

Extracting Product Attributes in XML using Web Service

Monitoring System Landscapes Using the DBA Cockpit

SAP Centralized Electronic Funds Transfer 1.8

How To Create Publications with SAP NetWeaver MDM Using MDM Publisher- Advanced Topics

Value Help in Web Dynpro ABAP - Tutorial.

How To Set Up and Use the SAP ME Work Instructions Feature

Web Dynpro for ABAP: Tutorial 4 - Display Bookings of Selected Flight

Configure Peripheral Drivers with Mobile Infrastructure

Send Multiple IDocs Within One XI Message

SAP BW 3.3 April 2004 English. General Ledger Analysis. Business Process Procedure. SAP AG Neurottstr Walldorf Germany

Introducing SAP Enterprise Services Explorer for Microsoft.NET

Working with Select Options in Web Dynpro for ABAP

Transcription:

SAP NetWeaver SAP How-To NetWeaver Guide How-To Guide How To...Use a Debugging Script to Easily Create a Test Environment for a SQL-Script Planning Function in PAK Applicable Releases: SAP NetWeaver BW 7.30, SP10; BW 7.31, SP 9 and higher Notes 1923579, 2026219, 2039102, 2049576, 2096811 SAP HANA 1.0 Topic Area: Business Information Management Version 1.2 March 2015

Copyright 2015 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. 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. Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400, iseries, pseries, xseries, zseries, z/os, AFP, Intelligent Miner, WebSphere, Netfinity, Tivoli, Informix, i5/os, POWER, POWER5, OpenPower and PowerPC are trademarks or registered trademarks of IBM Corporation. Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks of Adobe Systems Incorporated in the United States and/or other countries. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C 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. MaxDB is a trademark of MySQL AB, Sweden. SAP, R/3, mysap, mysap.com, xapps, xapp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ( SAP Group ) for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty. These materials are provided as is without a warranty of any kind, either express or implied, including but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement. SAP shall not be liable for damages of any kind including without limitation direct, special, indirect, or consequential damages that may result from the use of these materials. SAP does not warrant the accuracy or completeness of the information, text, graphics, links or other items contained within these materials. SAP has no control over the information that you may access through the use of hot links contained in these materials and does not endorse your use of third party web pages nor provide any warranty whatsoever relating to third party web pages. SAP NetWeaver How-to Guides are intended to simplify the product implementation. While specific product features and procedures typically are explained in a practical business context, it is not implied that those features and procedures are the only approach in solving a specific business problem using SAP NetWeaver. Should you wish to receive additional information, clarification or support, please refer to SAP Consulting. Any software coding and/or code lines / strings ( Code ) included in this documentation are only examples and are not intended to be used in a productive system environment. The Code is only intended better explain and visualize the syntax and phrasing rules of certain coding. SAP does not warrant the correctness and completeness of the Code given herein, and SAP shall not be liable for errors or damages caused by the usage of the Code, except if such damages were caused by SAP intentionally or grossly negligent. Disclaimer Some components of this product are based on Java. Any code change in these components may cause unpredictable and severe malfunctions and is therefore expressively prohibited, as is any decompilation of these components. Any Java Source Code delivered with this product is only to be used by SAP s Support Services and may not be modified or altered in any way.

Document History Document Version Description 1.00 First official release of this guide 1.10 Corrections delivered with note 2096811 1.20 Correction of typo in note number (206811 instead of correct number 2096811)

Typographic Conventions Type Style Example Text Description Words or characters quoted from the screen. These include field names, screen titles, pushbuttons labels, menu names, menu paths, and menu options. Cross-references to other documentation Icons Icon Description Caution Note or Important Example Recommendation or Tip Example text Example text Example text <Example text> EXAMPLE TEXT Emphasized words or phrases in body text, graphic titles, and table titles File and directory names and their paths, messages, names of variables and parameters, source text, and names of installation, upgrade and database tools. User entry texts. These are words or characters that you enter in the system exactly as they appear in the documentation. Variable user entry. Angle brackets indicate that you replace these words and characters with appropriate entries to make entries in the system. Keys on the keyboard, for example, F2 or ENTER.

Table of Contents 1. Scenario... 2 2. General Description of the Solution... 2 3. Step by Step Solution... 3 3.1 Set a Break-Point in the ABAP Service Class... 3 3.2 Create the Tables and the Debug Procedure... 3 3.3 Test Your SQL-Script Function... 5

1. Scenario In the Planning Application Kid it is possible to use planning functions that are written as SQL-Script procedures. These procedures can replace planning functions that are created using ABAP, as ABAP based planning functions cannot run in memory. These SQL-Script procedures are created directly in the HANA Studio. [With Sap NetWeaver 7.40 SP6 these SQL-Scripts can also be created in an ABAP environment but still for testing it can make sense to develop then directly in the HANA studio and later create them in the ABAP environment.] When creating those procedures it surely is possible to test them directly as part of the PAK planning function. It is even possible to stop inside the debugger of a SQL-Script procedure when the procedure is started from ABAP. Still it is way more convenient to have a test environment during creation of the procedure which does not require the use of the planning function on the ABAP server but works directly in HANA. You can also easily use the enhanced debugging possibilities in the HANA studio (SP7 and up) directly. In an older How to Paper (https://scn.sap.com/docs/doc-53377) we have already described a solution how such a test environment can be created using a planning function. In the current paper we want to explain a more recent and easier method to reach the same goal. 2. General Description of the Solution When executing a planning function that is realized as an SQL-Script then the SQL-Script procedure receives the data that lies in the filter selection and that should be changed in a temporary table that cannot be stored directly. In our paper we show how we can create a data table in SAP HANA that has the structure that is expected by the procedure and fill it with data corresponding to the data in the selection of the filter we use for testing. The procedure can then be directly tested with this table in the HANA Studio. In this paper we show how you can use a debug procedure in PAK that creates - in a namespace specified by the user - a snapshot of all necessary data used in the planning function (transaction data, reference data, reference data from other aggregation levels) and - a debug procedure that uses these tables and calls the original SQL-Script procedure containing the planning function logic. In our example we will use a procedure that is realized as an AMDP (ABAP Managed Database Procedure). The same technique works also when you have implemented your SQL-Script logic directly in HANA studio.

3. Step by Step Solution 3.1 Set a Break-Point in the ABAP Service Class If you want to execute a planning function that is using SQL-Script in order to define the planning function logic you have to create a wrapper ABAP class. You can use report RSPLS_SQL_SCRIPT_TOOL for creating a template for this class. Go to transaction se80 and navigate to the class that implements the wrapper for the SQL-Script procedure you want to debug. If you have implemented the planning function as an AMDP (ABAP managed database procedure) then this class also contains the implementation of your SQL-Script. Open the method IF_RSPLFA_SRVTYPE_TREX_EXEC~TREX_EXECUTE and set a break-point. You can set it at the call where your SQL-Script method is called. 3.2 Create the Tables and the Debug Procedure Now execute the planning function. It is preferable to execute the planning function from a planning sequence from transaction rsplan or transaction rsa1. In case you want to execute the planning function from an Excel client or a Web client you have to set an EXTERNAL break-point in the step above. The execution of the planning function stops at the break-point and shows the ABAP debugger. In the debugger change to the tab strip Script. Now press the button Load Script.

In the popup enter the name RSR_DEBUGGING_SCRIPT_STORE and press ok. Now press the button Start Script. On the popup select the last option and press ok.

The system will prompt you for a names space. The tables and the debug procedure will have a name starting with this prefix so you can find them more easily in HANA Studio. Again press ok. Now you can finish the execution of the planning function and leave the debugger by pressing F8. On the popup press F8 again or the button Continue. 3.3 Test Your SQL-Script Function All necessary objects have now been created. You can now go to HANA studio and test your SQL- Script procedure. Open the HANA Studio and expand the node for your current system. Under the Catalog folder locate the BW schema of your system (SAP + name of the system).

On the node Tables call the context menu and choose the option Filters. Enter the prefix you have specified when creating the tables and press ok. Now expand the node Tables (if you do not restrict the tables by the filter you will see all tables in the system and probably will have problems to find your table). The table name consists of the prefix you have specified, some explanatory text, and a time stamp. Thus you can run the debugging script several times using the same prefix and can get different versions of the table (possibly filled with different data). The time stamp also makes sure that existing test tables do not get overwritten. From the context menu on the table you can select the entries open content or open data preview to check the data in the table.

Now expand the node Procedures. Probably you have fewer procedures than tables in your system so you should find your procedure quite easily. If this is not the case you can use a filter just as with the tables. The naming convention for the procedures is similar to the naming conventions of the tables. Now double click on the procedure name and display it. As you can see the procedure reads the data from the snapshot table we have created and then calls your SQL-Script procedure that contains the planning logic. You can now easily test your SQL-Script planning function by simply opening an SQL-Script console, inserting a call of the debug procedure, and pressing F8. You can also set break-points in the debug procedure or in the procedure containing the planning logic and debug your procedure. Please find further information on debugging on SDN: http://www.saphana.com/docs/doc-4473.