Role and Scope of ABAP in SAP BI

Similar documents
Data Extraction & DS Enhancement in SAP BI Step by Step

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

Reading Enhanced DataSource fields for the Remote Cube

Step-By-Step guide to Virtual InfoCube Implementation

Routines in SAP BI 7.0 Transformations

Replacement Path: Explained with an Illustrated Example

Data Source Replication and Activation of Transfer Structures

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

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

Step by Step Procedure for DSO Creation

Performance Tuning in SAP BI 7.0

Step by Step Method for File Archival in BW

Loading the Data for Time Dependent Hierarchy in SAP BI

Standalone BW System Refresh

Using Rule Group in SAP-BI. Part - 1

Using Customer Exit Variables in BW/BI Reports Part - 1

DB Connect with Delta Mechanism

How to Work with F4 Input Help Effectively in BEX

Reporting Duplicate Entries

SAP BI Analysis Authorization (Customer Exit Variables)

Linking Documents with Web Templates

Step by Step Guide to Enhance a Data Source

How to Check BW system Before Go-Live

Step by Step Guide on How to Use Cell Definition in BEx Query

Generate Export Data Source

SAP BI Global Report Variable user exit modularization

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

This article explains the steps to create a Move-in letter using Print Workbench and SAPScripts.

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

Using Customer Exit Variables in BW/BI Reports: Part - 14

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

Maintaining Roles and Authorizations in BI7.0 - RSECADMIN

POWL: Infoset Generation with Web Dynpro ABAP

Analysis Process Designer (APD) Step by Step Business Intelligence

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

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

Deploying BusinessObjects Explorer on Top of a SAP BI Query

Using Customer Exit Variables in BW/BI Reports: Part - 4

Data Mining: Scoring (Linear Regression)

Download SAP Query Output to Local/ Network Folders in Background

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

Server Connectivity and Data Load from Non SAP System to BW

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

Graphical Mapping Technique in SAP NetWeaver Process Integration

Implementing Customer Exit Reporting Variables as Methods

Easy Lookup in Process Integration 7.1

Data Mining: Decision Trees

Recreating BIA Indexes to Address the Growth of Fact Index Table

Changing the Source System Assignments in SAP BW Objects without Affecting the Data Modeling

Database Statistics During ODS Activation

MDM Syndicator: Custom Items Tab

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

Extraction of Hierarchy into Flat File from R/3 and Loading in BW System

Material Listing and Exclusion

Using Radio Buttons in Web Template

Developing Crystal Reports on SAP BW

SAP BW Copy Existing DTP for Data Targets

SDN Community Contribution

Information Broadcasting Part 3 Scheduling the First Report

Custom BADI Using Function Module UJQ_RUN_AXIS_QUERY

Process Chain Log Deletion

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

Transfer Material Attributes (Material Type) from R/3 to SAP GRC Global Trade Services (GTS)

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

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

Triggering the Process Chains at Particular Date using Events

Using Nested Exception Aggregation in BEx Reports- Scenario

Roadblocks During SAP BI 7.0 Upgrade and Their Resolutions

Performance Management in Data Loading: an Overview

Customized Transaction to Trigger Process Chain from Failed Step

Load Info Cube in SCM 5.0 (BI 7.0)

Planning Functions and Characteristic Relationship in Integrated Planning

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

SAP Net Weaver 400s BI 7.0For more information, visit the Business Intelligence homepage.

Creating Custom SU01 Transaction Code with Display and Password Reset Buttons

Open Hub Destination - Make use of Navigational Attributes

Data Flow During Different Update Mode in LO Cockpit

Performance Optimization of Long Running Queries Using OLAP Cache

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

Solution to the Challenges in Pivoting

Currency Translation in SAP BI Step by step Guide

About ITAB Duplicate_Key (SAP lrsaods) Runtime Error

Web Dynpro: Coloring Table Conditionally

SAP BW vs. SAP BusinessObjects Web Intelligence Functionalities

Displaying SAP Transaction as Internet Application in Portal

Cut Over Activities Specific for LIS* Data Sources

Step by Step Approach for End Routine with Look Up

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

Material Master Archiving in Simple Method

Custom Process types Remote Trigger and End Time

Managing Transports in SAP BW 3.5 and BI 7.0

Validity Table in SAP BW/BI

All about Compression

SAP BI BO Unit/Currency Logic for Unknown Units Case Study

How to Write Inverse Routine with Expert Routine

Table Row Popup in Web Dynpro Component

Universal Worklist - Delta Pull Configuration

Freely Programmed Help- Web Dynpro

Implementation and Usage of Transformation End Routine in SAP BI 7.0

Totals in Adobe forms

Transcription:

Role and Scope of ABAP in SAP BI Applies to: SAP NetWeaver BW. For more information, visit the EDW homepage Summary The document provides a detailed description of the usage of APAP in SAP BI. Author: Adlin Sundararaj & Kavita Srivastava Company: Accenture Services Pvt. Ltd. Created on: 10 March 2011 Author Bio Adlin Sundararaj is working as SAP-BI Consultant in Accenture Services Private Ltd and has experience of working on implementation and maintenance projects. Kavita Srivastava is working as SAP-BI Consultant in Accenture Services Private Ltd and has rich project experience in SAP-BI domain. 2011 SAP AG 1

Table of Contents Routines... 3 Start Routine... 3 End Routine... 4 Expert Routine... 4 InfoPackage Routine... 5 Characteristic Routine... 5 ABAP in Process Chains... 6 Customer Exit Variable (BEx)... 9 Data Extraction... 10 Enhancing a Datasource in ECC/SRM using Tcode RSA6... 10 Related Content... 18 Disclaimer and Liability Notice... 19 2011 SAP AG 2

Routines The different Routines Available in SAP BI are as follows: Start Routine End Routine Expert Routine InfoPackage Routine Characteristic Routine Start Routine The start routine is run for each data package at the start of the transformation. The start routine has a table in the format of the source structure as input and output parameters. It is used to perform preliminary calculations and store these in a global data structure or in a table. This structure or table can be accessed from other routines. You can modify or delete data in the data package. Click on Start Routine button (Circled in Red)to create Start Routine. SOURCE_PACKAGE contains contents of source data. SOURCE_PACKAGE has same structure as that of Source of the Transformation. 2011 SAP AG 3

End Routine End Routine is available with Transformation. It is triggered after Transformation. Generally End user is used for updating data based on existing data. An end routine is a routine with a table in the target structure format as input and output parameters. You can use an end routine to postprocess data after transformation on a package-by-package basis. For example, you can delete records that are not to be updated, or perform data checks. Click on End Routine button to create End Routine. RESULT_PACKAGE contains process data i.e. processed via start routine and transformation. RESULT_PACKAGE has same structure as that of target Object. Expert Routine To create an Expert routine go to Edit menu and select Expert Routine. Expert Routine will trigger without any transformation Rule. All existing Rules will be deleted once you develop Expert Routine. This is used generally for customizing rules. This type of routine is only intended for use in special cases. You can use the expert routine if there are not sufficient functions to perform a transformation. The expert routine should be used as an interim solution until the necessary functions are available in the standard routine. You can use this to program the transformation yourself without using the available rule types. You must implement the message transfer to the monitor yourself. If you have already created transformation rules, the system deletes them once you have created an expert routine. SOURCE_PACKAGE has same structure as that of Source of the Transformation. RESULT_PACKAGE has same structure as that of target Object. You can manipulate values from SOURCE_PACKAGE and append them in RESULT_PACKAGE. 2011 SAP AG 4

InfoPackage Routine Info Package routine is available with Info Package of Flat file Datasource. This routine enables us to give dynamic filename to IP. To Create Routine for filename, click the button circled in red in the image below. You need to create a routine by clicking on the Routine button. Give a name to routine. Write a code inside this routine to derive file name and assign it to variable p_filename. Characteristic Routine Characteristic Routine is inside Transformation. This routine will be triggered inside the Transformation based on the characteristic or key figure. If rule is for Characteristic, then Characteristic transformation routine will trigger. If rule is for key figure, then key figure transformation routine will trigger. This routine is available as a rule type; you can define the routine as a transformation rule for a key figure or a characteristic. The input and output values depend on the selected field in the transformation rule In Rule details of transformation select Routine to create a Characteristic Routine. Here you can do calculation of InfoObject value and assign value to variable Result, which in turn will get assigned to InfoObject. Characteristic routine is executed after Start routine and before End Routine. All global objects declared in Start Routine are available in Characteristic Routine. 2011 SAP AG 5

ABAP in Process Chains Use the ABAP Program process type if you want to use a simple, independent program in a chain or if you want to use a program scheduled by a user or another program in the background. This allows you to schedule a program of your choice (ABAP report) in the process chain management, with or without program variants. To add a ABAP Program process type: Go to RSPC. Click on the Process Types button circled in red below. Here you can also see the ABAP Program process variant in the General Services list. Drag and drop the variant into the process chain build pane. You will get the following pop-up asking for the program name. You can either use a pre-existing program by pressing Alternatively, you can create a new program by pressing In our example we will be using a pre-existing program ZTESTOSC.Press to confirm. 2011 SAP AG 6

You will see that the new ABAP Program process block has appeared. It is circled in red below. 2011 SAP AG 7

Now, Connect it to the process chain flow. 2011 SAP AG 8

Customer Exit Variable (BEx) Customer Exit Variable created in BEx query provides means to do complex calculation (not possible with BEx) in ABAP. Coding for Customer Exit variable is done in EXIT_SAPLRRS0_001 Function Module. Data records from BEx query are passed in I_T_VAR_RANGE internal table. Structure of this internal table is as follows: Field Description VNAM IOBJNM SIGN OPT LOW HIGH Variable name InfoObject name (I)ncluding or (E)xcluding Operators: EQ =, BT Between, LE <=, LT <, GE >=, GT >, CP and so on. Characteristic value Upper limit characteristic value for intervals/the node-infoobject for hierarchy nodes. I_STEP parameter from the Exit Function Module determines when customer exit code will be executed. Depending upon i_step values we can populate values in variable during different steps of BEx execution. I_STEP has values from 0-3, most commonly used values are explained below. I_STEP = 0 When i_step has value 0, the enhancement has been called via authorization check or from the monitor and not from variable screen. I_STEP = 1 When i_step has value 1 the enhancement call takes place directly before variable entry. This can be used to populate variable with some default values. I_STEP = 2 When i_step has value 2 the enhancement call takes place directly after variable entry. This step is only started up when the same variable is not input ready and could not be filled at I_STEP=1. This step can be used to validate user input. I_STEP = 3 When i_step has value 3 you can check the values of the variables. Triggering an exception here (RAISE) causes the variable screen to appear once more. Afterwards, I_STEP=2 is also called again. 2011 SAP AG 9

Data Extraction Enhancing a Datasource in ECC/SRM using Tcode RSA6 The first step involves logging onto Tcode RSA6 and finding the relevant datasource which will then be enhanced as per the additional requirements. Search for the required Datasource in the datasource list: 2011 SAP AG 10

Click on enhance extraction structure: An append structure needs to be created which will contain all the enhanced fields along with their metadata definition. Give a name to the append structure starting with Z : 2011 SAP AG 11

Define the structure with the fields: Activate the append structure and save the datasource: 2011 SAP AG 12

Click on change datasource and unhide the new fields if required: Post activation, one needs to write the exit code in the source system to populate the source fields. The same is done through Tcode CMOD wherein you can then refer to the associated project and log onto enhancement RSAP0001. The following four exits exists and will be enhanced depending on the requirements: EXIT_SAPLRSAP_001 Transaction data EXIT_SAPLRSAP_002 Master Data Attributes EXIT_SAPLRSAP_003 Master Data Text EXIT_SAPLRSAP_004 Master Data Hierarchy Tcode: CMOD: 2011 SAP AG 13

Enhancement for writing code for enhanced fields of datasource: Different User Exits: 2011 SAP AG 14

The include as shown below will contain all the relevant code controls which define the field population. This is a generic include and the code piece needs to be controlled through datasource name as shown below in the sample code (screenshot). The existing fields along with their values are stored in the internal table C_T_Data which is to be further modified to also include and populate values for the newly enhanced and added fields. Further modularization can be done by creating datasource specific includes. The technique also helps in better readability of the code. 2011 SAP AG 15

2011 SAP AG 16

Once the changes are done & new fields are fetched, internal table C_T_Data needs to be modified accordingly. The modifications and the new fields population is then automatically transferred to the fields of the datasource. The same can then be validated by executing the datasource through Tcode RSA3. 2011 SAP AG 17

Related Content http://wiki.sdn.sap.com/wiki/display/bi/abap+in+bw ABAP Development for SAP NetWeaver BI User Exits and BAdIs (2nd Edition) http://forums.sdn.sap.com/thread.jspa?threadid=6021 For more information, visit the EDW homepage 2011 SAP AG 18

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. 2011 SAP AG 19