Custom BADI Using Function Module UJQ_RUN_AXIS_QUERY

Similar documents
Customized Transaction to Trigger Process Chain from Failed Step

Procedure to Trigger Events in Remote System Using an ABAP Program

Triggering the Process Chains at Particular Date using Events

Easy Lookup in Process Integration 7.1

Role and Scope of ABAP in SAP BI

POWL: Infoset Generation with Web Dynpro ABAP

Step by Step Method for File Archival in BW

Creation of Sets in SAP-ABAP, How to Read them INI SAP-ABAP Reports

Reporting Duplicate Entries

SDN Community Contribution

How to Reference External JAR Files in Web Dynpro DC in SAP NW Portal 7.3

Data Extraction & DS Enhancement in SAP BI Step by Step

Table Row Popup in Web Dynpro Component

Routines in SAP BI 7.0 Transformations

Dynamically Enable / Disable Fields in Table Maintenance Generator

Standalone BW System Refresh

Step By Step: the Process of Selective Deletion from a DSO

Freely Programmed Help- Web Dynpro

Process Chain Log Deletion

SAP BW Copy Existing DTP for Data Targets

Database Statistics During ODS Activation

Recreating BIA Indexes to Address the Growth of Fact Index Table

Step by Step Guide to Creating a Process Type to Close an Open Request in a Cube in BI 7.0

MDM Syndicator: Custom Items Tab

How to Default Variant Created for Report Developed In Report Painter/Writer

Extracting Missing Fields of Data Source Which Are Present In Their Extract Structure

Step by Step Procedure for DSO Creation

Using Query Extract to Export Data from Business warehouse, With Pros and Cons Analyzed

Custom Process types Remote Trigger and End Time

Using Radio Buttons in Web Template

Graphical Mapping Technique in SAP NetWeaver Process Integration

Reading Enhanced DataSource fields for the Remote Cube

Linking Documents with Web Templates

How to Write Inverse Routine with Expert Routine

ABAP Code - Recipients (Specific Format) SAP BW Process Chain

How to Create Top of List and End of List of the ALV Output in Web Dynpro for ABAP

Material Master Extension for New Plant

Integration of Web Dynpro for ABAP Application in Microsoft Share Point Portal

SMT (Service Mapping Tool)

Validity Table in SAP BW/BI

How to use Boolean Operations in the Formula as Subsidiary for IF Condition

DB Connect with Delta Mechanism

Step-By-Step guide to Virtual InfoCube Implementation

Analysis Process Designer (APD) Step by Step Business Intelligence

Customizing Characteristic Relationships in BW-BPS with Function Modules

Real Time Data Acquisition (RDA) Overview and Step-by-Step Guide (SAPI and Web Services)

How to Create View on Different Tables and Load Data through Generic Datasource based on that View

Material Listing and Exclusion

Performance Optimization of Long Running Queries Using OLAP Cache

Implementing Customer Exit Reporting Variables as Methods

Maintaining Roles and Authorizations in BI7.0 - RSECADMIN

Loading the Data for Time Dependent Hierarchy in SAP BI

Generate Export Data Source

Currency Translation in SAP BI Step by step Guide

Replacement Path: Explained with an Illustrated Example

Applies To:...1. Summary...1. Table of Contents...1. Procedure..2. Code... Error! Bookmark not defined.0

Steps to Activate ALE Delta for Custom Master Datasource Created on ZTable

Hierarchy in Business Objects with Expanded Hierarchy Logic

List of Values in BusinessObjects Web Intelligence Prompts

How to Broadcast BEx Workbooks using BW Pre-calculation Server and through Process Chains

Step by Step Guide How to Use BI Queries in Visual Composer

Template Designer: Create Automatic PDF Documents for Attachment or Print Purpose

Common Queries/Errors while working with Adobe Print PDF Forms

Open Text DocuLink Configuration - To Access Documents which are Archived using SAP

A Step-by-Step Guide on IDoc-ALE between Two SAP Servers

Creating Custom SU01 Transaction Code with Display and Password Reset Buttons

Restricting F4 (Input Help) Values While Running a SAP BW Query

Explore to the Update Tab of Data Transfer Process in SAP BI 7.0

SDN Community Contribution

Developing Crystal Reports on SAP BW

SAP BI Global Report Variable user exit modularization

How to Distribute and Collect Offline Data in SAP BPC 7.0 MS and NW

BAPI Execution in offline Adobe Form

MDM Import Manager - Taxonomy Data (Attribute Text Values) Part 3

Easy Application Integration: How to use the Records Management Call Handler Framework

Information Broadcasting Part 3 Scheduling the First Report

Cut Over Activities Specific for LIS* Data Sources

Planning Functions and Characteristic Relationship in Integrated Planning

Financial Statement Version into PDF Reader

Creating, Configuring and Testing a Web Service Based on a Function Module

Download SAP Query Output to Local/ Network Folders in Background

Extractor for Multi Value Class Characteristic Values using Function Module

How to Integrate BPC NW to BI7x Technically using ABAP?

SAP BPC 7.0: How to configure the work status feature in BPC MS?

How to Perform Intercompany Elimination and Data Validation with SAP BPC 7.0 MS

Limitation in BAPI Scheduling Agreement (SA) Create or Change

Xcelsius Tricks Part 5 Create a Loading Bar in SAP Crystal Dashboard and Presentation Design (Xcelsius 2008)

Universal Worklist - Delta Pull Configuration

SAP BW vs. SAP BusinessObjects Web Intelligence Functionalities

Errors while Sending Packages from OLTP to BI (One of Error at the Time of Data Loads through Process Chains)

Deploying BusinessObjects Explorer on Top of a SAP BI Query

ABAP Code - Read SAP BW Infoprovider (Infocube, DSO, Multiprovider) Data using ABAP Code

Fetching User Details from the Portal and Displaying it in Web Dynpro with Authentication in the Portal

Displaying SAP Transaction as Internet Application in Portal

Performance Management in Data Loading: an Overview

How to Create your Own Rule in Workflow?

Implying Security on Business Object XI 3.1 Universe having SAP BW as Source

Solution to the Challenges in Pivoting

How to Display Result Row in One Line While Reporting On Multiproviderer

Open Hub Destination - Make use of Navigational Attributes

Transcription:

Custom BADI Using Function Module UJQ_RUN_AXIS_QUERY Applies to: SAP Business Planning and Consolidation for NetWeaver 7.0. Summary This Guide covers how to use Custom BADI and the functionality of the Function module UJO_RUN_AXIS_QUERY. Author: Sakthi Jaganathan Company: Infosys Technologies Limited Created on: 22 April 2010 Author Bio Sakthi Jaganathan has been working for Infosys Technologies Limited for the past 2.3 years and has experience in SAP BI 7.0 and SAP BPC MS and NW Versions. 2010 SAP AG 1

Table of Contents Introduction... 3 Scenario... 3 Step by Step Procedure... 4 Appset Creation and Data upload... 4 Custom BADI implementation... 4 Process Chain Creation... 6 Calling the BADI from BPC... 6 Creation of New Package in BPC... 7 Execution of BADI through Data Manager in BPC... 8 Validation of Data in Reports... 11 Appendix... 12 Sample BADI Code:... 12 Disclaimer and Liability Notice... 15 2010 SAP AG 2

Introduction Custom BADI will be used to implement our own logic through the ABAP programming. For example reading data from one application and updating the same application with the modified data or reading data from one application and updating another application within the modified data etc. To read the cube (i.e. application), we can use different Function Modules like UJQ_RUN_RSDRI_QUERY, UJQ_RUN_AXIS_QUERYetc. To know the list of Function modules used for reading the cube data, go to SE37 tcode and by giving input as UJQ*, Press F4. This document will describe the functionality of the Function Module UJQ_RUN_AXIS_QUERY.This will be used to fetch the data from the cube for the Base members. This is very useful when to find the total value of a particular Parent member. Instead of adding each value of the base member, if we pass the required parent Member, this function module adds up all the base members of that Parent Member. Scenario To find the Savings for a particular month based on Personal Costs which is a parent member, then it will be easy to use this function module UJQ_RUN_AXIS_QUERY in the custom BADI, to get the corresponding BASE members data. From the above Screenshot, Total Personal costs i.e. CE0004000 = CE0004010+CE0004020+CE0004030 Total Personal Costs will get from the Planning Application by FM UJQ_RUN_AXIS_QUERY and then we will get the Budget Value for that Month from the user. Savings Amount will get from the calculations on total Personal costs and Budget value for the month which is entered by user. 2010 SAP AG 3

Step by Step Procedure The procedure for creation of Custom BADI, Cube data access, data update in cube will be described in the below steps. Appset Creation and Data upload Create an Appset with the required Applications. To load the Planning Application i.e Cube, through the Data Manager, we will be using Standard Package Import Transaction data. Sample File to be uploaded:- After successful running of the Package, the data in the Cube:- Custom BADI implementation In SE19, Create an Implementation for the BADI UJ_CUSTOM_LOGIC. 2010 SAP AG 4

Once done with the creation of Implementation Class, create a filter to call a Custom BADI from BPC.In the below screenshots, a filter keyword Value_1 is created. Once Filter is created, go the implementation class ->IF_UJ_CUSTOM_LOGIC~EXECUTE, to write our logic. A sample code is written to fetch the data for the Parent Member i.e. CE0004000. The output of the function module will be the aggregation of the base members (CE0004010, CE0004020, CE0004030) corresponding to the parent member, which is the Total Personal Costs. From the user entered Budget value, we will find the savings by subtracting the total personal costs from the budget value. If there is any Savings for that Month, it will create a new account Savings for that month. The code for the above logic is attached in the Appendix. Once done with the code, activate the BADI. 2010 SAP AG 5

Process Chain Creation In RSPC, Create a Process chain ZBPC_BUDGET to run the Custom BADI through the Data manager in BPC. Calling the BADI from BPC After activation of BADI, call the BADI from BPC using the keyword created in the Filter section. To pass any parameters from the BPC to the BADI, we can use the *START_BADI command, otherwise, we can use the *CALL_CUSTOM_LOGIC Command. Create a new Logic file BUDGET.LGF to call the BADI in BPC Admin.We can call from DEFAULT.LGF also. 2010 SAP AG 6

Creation of New Package in BPC In BPC EXCEL, Create a new Package BUDGETPACKAGE for the Process chain ZBPC_BUDGET which is created in Step3.3. Once the above Package is created, Modify the Package in the Advance Tab as below. Add the below code in the Advance Tab. 2010 SAP AG 7

The above code will prompt the user for Member selection, Logic File selection and Budget value. In addition, it will pass the Runtime Parameters like Appset name, Application name etc. to the Process Chain. Save the Package at last. Execution of BADI through Data Manager in BPC Run the Package which is created in the above step. It will prompt for the Logic File name and Members selection. 2010 SAP AG 8

By confirming the above, it will execute the Process Chain with the below message. 2010 SAP AG 9

Check the status of the Package: Now the data in Cube: A new Record is added in the cube with the Account CE071000-Savings. Total Personal costs = 4000+25000+2500 = 31500 Budget Value = 40000 p.m. (Which is hardcoded in the BADI, else we can pass this value through the Parameter to the BADI by prompting the user) Savings = 40000-31500 = 8500 2010 SAP AG 10

Validation of Data in Reports Before executing the BADI, the report:- After executing Custom BADI, the report looks like: 2010 SAP AG 11

Appendix Sample BADI Code: METHOD if_uj_custom_logic~execute. " Structure for Internal table for cube data TYPES: BEGIN OF cube_data, brand(20) TYPE c, category(20) TYPE c, entity(20) TYPE c, p_acct(20) TYPE c, time(20) TYPE c, signeddata TYPE /b28/oisdata, END OF cube_data. " internal table and workarea declarations DATA : it_cube_data TYPE STANDARD TABLE OF cube_data, wa_cube_data TYPE cube_data, wa_cube_data1 TYPE cube_data, it_axis TYPE ujq_t_query_dim, wa_axis TYPE ujq_s_query_dim, wa_member TYPE ujq_s_dim_member, wa_param TYPE ujk_s_script_logic_hashentry. *" declaration of the budget value variable. DATA : v_budget TYPE i. " for population internal table to pass the RUN_AXSIS query " Personal costs for the Jan month wa_axis-dimension = 'P_ACCT'. wa_member-dimension = 'P_ACCT'. wa_member-member_name = 'CE0004000'. APPEND wa_member TO wa_axis-member_list. APPEND wa_axis TO it_axis. wa_axis-dimension = 'TIME'. wa_member-dimension = 'TIME'. wa_member-member_name = '2009.JAN'. APPEND wa_member TO wa_axis-member_list. APPEND wa_axis TO it_axis. wa_axis-dimension = 'ENTITY'. wa_member-dimension = 'ENTITY'. wa_member-member_name = 'E_H1'. APPEND wa_member TO wa_axis-member_list. APPEND wa_axis TO it_axis. wa_axis-dimension = 'BRAND'. wa_member-dimension = 'BRAND'. wa_member-member_name = 'BRAND_ALL'. APPEND wa_member TO wa_axis-member_list. 2010 SAP AG 12

APPEND wa_axis TO it_axis. wa_axis-dimension = 'CATEGORY'. wa_member-dimension = 'CATEGORY'. wa_member-member_name = 'ACTUAL'. APPEND wa_member TO wa_axis-member_list. APPEND wa_axis TO it_axis. " To get the Overall Personal Costs parent member value CALL FUNCTION 'UJQ_RUN_AXIS_QUERY' EXPORTING i_appset_id = 'ZAPP_BADI' i_appl_id = 'PLANNING' it_axis = it_axis if_check_member_failed = space IMPORTING et_data = it_cube_data. " reading the Budget value entered by user. READ TABLE it_param WITH KEY hashkey = 'BUDGET' INTO wa_param. IF sy-subrc EQ 0. v_budget = wa_param-hashvalue. ENDIF. *"if the overall personal costs less than the budget value for Jan month, *" then add to the SAvings account. LOOP AT it_cube_data INTO wa_cube_data. IF wa_cube_data-signeddata LT v_budget. ENDIF. ENDLOOP. ENDMETHOD. wa_cube_data1-p_acct = 'CE071000'. wa_cube_data1-time = '2009.JAN'. wa_cube_data1-entity = 'E_H1'. wa_cube_data1-category = 'ACTUAL'. wa_cube_data1-brand = 'Brand'. wa_cube_data1-signeddata = v_budget - wa_cube_data-signeddata. APPEND wa_cube_data1 TO ct_data. 2010 SAP AG 13

Related Contents: How to Pass Parameters to Custom Logic BADI http://help.sap.com/saphelp_bpc70sp02/helpdata/en/66/ac5f7e0e174c848b0ecffe5a1d7730/frameset.htm Enterprise Performance Management homepage 2010 SAP AG 14

Disclaimer and Liability Notice This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade. SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk. SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document. 2010 SAP AG 15