Customizing Characteristic Relationships in BW-BPS with Function Modules

Similar documents
Using Radio Buttons in Web Template

Graphical Mapping Technique in SAP NetWeaver Process Integration

Step-By-Step guide to Virtual InfoCube Implementation

Reporting Duplicate Entries

Linking Documents with Web Templates

Easy Lookup in Process Integration 7.1

SDN Community Contribution

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

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

POWL: Infoset Generation with Web Dynpro ABAP

Procedure to Trigger Events in Remote System Using an ABAP Program

Customized Transaction to Trigger Process Chain from Failed Step

MDM Syndicator: Custom Items Tab

Freely Programmed Help- Web Dynpro

DB Connect with Delta Mechanism

Triggering the Process Chains at Particular Date using Events

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

Information Broadcasting Part 3 Scheduling the First Report

Creation of Key Figures with Higher Decimal Place Precision

Data Flow During Different Update Mode in LO Cockpit

Dynamically Enable / Disable Fields in Table Maintenance Generator

Creating Custom SU01 Transaction Code with Display and Password Reset Buttons

Step by Step Method for File Archival in BW

About ITAB Duplicate_Key (SAP lrsaods) Runtime Error

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

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

Routines in SAP BI 7.0 Transformations

Open Hub Destination - Make use of Navigational Attributes

Implementing Customer Exit Reporting Variables as Methods

Replacement Path: Explained with an Illustrated Example

Standalone BW System Refresh

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

Limitation in BAPI Scheduling Agreement (SA) Create or Change

SAP BW Copy Existing DTP for Data Targets

Displaying SAP Transaction as Internet Application in Portal

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

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

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

Developing Crystal Reports on SAP BW

Table Row Popup in Web Dynpro Component

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

Data Extraction & DS Enhancement in SAP BI Step by Step

How to Work with F4 Input Help Effectively in BEX

Step by Step Procedure for DSO Creation

Custom Process types Remote Trigger and End Time

Hierarchy in Business Objects with Expanded Hierarchy Logic

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

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

Maintaining Roles and Authorizations in BI7.0 - RSECADMIN

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

Web Dynpro ABAP: Dynamic Table

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

ecatt Part 6 System Data Container

Validity Table in SAP BW/BI

Setting up Connection between BW and R/3 for Data Load

Currency Translation in SAP BI Step by step Guide

List of Values in BusinessObjects Web Intelligence Prompts

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

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

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

Database Statistics During ODS Activation

Generate Export Data Source

Download SAP Query Output to Local/ Network Folders in Background

Custom Password Reset Tool in SAP Enterprise Portal Using Web Dynpro for Java

Recreating BIA Indexes to Address the Growth of Fact Index Table

Process Chain Log Deletion

SDN Community Contribution

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

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

How to Write Inverse Routine with Expert Routine

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

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

Exception Handling in Web Services exposed from an R/3 System

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

Using Nested Exception Aggregation in BEx Reports- Scenario

SMT (Service Mapping Tool)

Material Listing and Exclusion

Load Info Cube in SCM 5.0 (BI 7.0)

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

Adding Custom Fields to Contract Account Screen

SDN Community Contribution

Web Dynpro ABAP: Changing ALV Contents and Saving in Database

Using Rule Group in SAP-BI. Part - 1

Data Mining: Scoring (Linear Regression)

ABAP HR: Standard Info Type Enhancement

All about Compression

How to Create your Own Rule in Workflow?

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

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

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

Deploying BusinessObjects Explorer on Top of a SAP BI Query

Role and Scope of ABAP in SAP BI

Function Module to Create Logo

Web Dynpro: Coloring Table Conditionally

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

Methods of Selecting BOM Variant Parts in Variant Configuration

Dialog Windows in WebDynpro ABAP Applications

Material Master Archiving in Simple Method

Creating Rules in Process Composer and using them in Process

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

Transcription:

Customizing Characteristic Relationships in BW-BPS with Function Modules Applies to: BW-BPS (Ver. 3.5 and BI 7.0) SEM-BPS (Ver 3.2 onwards) Summary This paper discusses the definition of a exit type characteristic relationship in BW-BPS using ABAP function modules and its functional application through a practical example. Author: Aditya Naik Created on: 23 August 2006 Author Bio Aditya Naik is a BI Analyst having worked on BW and BPS projects. He is a certified Business Intelligence Solution Consultant (NetWeaver 04) and has over 4 years of experience in the SAP BI space. He has worked as a BW and BPS Analyst on various assignments as well as a faculty at SAP Labs. 2006 SAP AG 1

Table of Contents Applies to:... 1 Summary... 1 Author Bio... 1 Introduction... 3 Business Scenario... 3 Solution Overview... 3 Background... 4 Characteristic Relationships... 4 Derivation, Proposal and Combination Check.... 5 Reposting Data... 6 Step by step solution overview... 7 Reference Data... 7 Characteristic Relationship... 7 Planning function Repost (Characteristic Relationship)... 8 Function Modules... 11 Derivation... 11 Proposal... 12 Combination Check... 12 Related Content... 14 Disclaimer and Liability Notice... 15 2006 SAP AG 2

Introduction Characteristic Relationships are used in BPS in order to define dependencies between the values of the masterdata that characterize the business scenario. In many cases, these dependencies are a bit more complicated than can be easily defined and are the result of programmed logic. The Repost function is the only function that allows you to change the values of the characteristics and is thus a pretty powerful function. Utilizing the power of ABAP to determine the characteristic relationships, and the Repost function to assign the values, we can automate the assignment of characteristic values in a planning area. In this paper, we shall take a look at the definition of characteristic relationships through ABAP as well as glance through the two important functions that utilize characteristic relationships. Business Scenario The Profit Center is determined on the basis of the CSR (Customer Sales Representative) and the Material. This reference data is loaded into an ODS in BW from the source system. Planning is however not done at the profit center level. In other words, the planner does not enter the Profit Center; it needs to be determined automatically by the system while saving the data in a BPS Planning Layout. Solution Overview We define a characteristic relationship on the basis of the Material and the CSR fields, to derive the Profit Center, reading data from the ODS. We then utilize the planning function Repost (Characteristic Relationship) in order to utilize the defined char. relationship and populate the Profit Center field in the planning data. This planning function is then utilized in a planning sequence in addition to other functions. The planning sequence is fired off before the data is saved so as to calculate the values for the characteristics in the transaction data. 2006 SAP AG 3

Background Characteristic Relationships Characteristic relationships are built in order to restrict the combinations occurring through the transaction data to a valid set as defined by the business rules. For example: Consider Material and Material group are two characteristics. Material Group is defined as an attribute of Material in BW. The Masterdata looks like the table below: Material M0001 M0002 M0003 M0004 M0005 Material Group While defining manual planning layouts, there could be situations, where you would want to display all the possible combinations even though they do not contain any transaction data. In this case, characteristic relationships help to restrict the combinations to only those that are functionally possible, providing a correct business perspective. Thus, in case we were using these two characteristics in a manual planning layout with the option All Possible Characteristic Combinations, Fig 1 shows the layout as it would appear with characteristic relationships defined for proposal and Fig 2 shows the layout without the characteristic relationships. Fig 1 Material Material Group Key Fig 1 Key Fig 2 Key Fig 3 M0001 M0002 M0003 M0004 M0005 Fig 2 Material Material Group Key Fig 1 Key Fig 2 Key Fig 3 M0001 M0002 2006 SAP AG 4

M0003 M0004 M0005 M0001 M0002 M0003 M0004 M0005 If, there are no characteristic relationships defined, the combination of the two characteristics could result in transaction data having 10 different combinations instead of the 5 mentioned above (each material with each material group). This would result in erroneous transaction data. In this case, we define a characteristic relationship of the type attribute. The other types possible are Reference Data and Hierarchy. When the relationship defined cannot be represented by these, we can use the type Exit to determine the same through function modules. Derivation, Proposal and Combination Check. The restrictions defined in the characteristics relationships are used in three modes: Derivation, Proposal and Combination Check. In Derivation, values are determined for those target characteristics using the values of the source characteristics. Proposals are used to calculate the valid combinations while populating the manual planning layouts when the option All Possible Characteristic Combinations is chosen. Combination Check is used to check whether the existing combinations that have either been generated through the planning function or through user entries are correct. Characteristic Relationships are thus used mainly To generate correct characteristic combinations using planning function REPOST (Characteristic Relationships) To generate valid combinations of characteristic data in manual planning layouts Delete invalid combinations that exist in the transaction data using the planning function DELETE (Invalid Combinations). 2006 SAP AG 5

Reposting Data The planning function REPOST allows you to change the values of the characteristics in the planning package. In all the other functions, you re allowed to change the values of the key figures and this is where the Repost function is different from others. Repost has two variants: Repost and Repost (Characteristic Relationships). You can choose which fields are to be changed and also select conditions under which they can be changed. Functionally, both are similar and both alter the values of the characteristics in the planning package. However, there are differences between the two in terms of the restrictions on the usage of the Repost (Characteristic Relationships) function. Firstly, you can only create a function of the type Repost (Characteristic Relationships) in a planning level that contains all the characteristics and key figures. With the Repost function, you can also restrict which key figures the function works on by choosing the field Key figure name in the Selections. This is not possible in the Repost (Characteristic Relationships) function. Also, only those fields which are derived in the characteristic relationships in the planning area, are available in the field list for Repost (Characteristic Relationships). You can also check the details of the derived fields using a pushbutton provided In the Parameter group for Repost, you define the selections, and the actual values to be reposted in the function. However, the parameter group for Repost (Characteristic Relationships) is only a namesake and does not contain any data. 2006 SAP AG 6

Step by step solution overview Reference Data The mapping to derive the profit center from the combination of the Material and CSR Fields is stored in an ODS (ZXSLSMAP) which is loaded from the source system. It also contains the mapping for Sales Office, which we are not using herein. The layout of the ODS is as shown below. Characteristic Relationship In order to define a characteristic relationship for the planning area, Click on Change planning area, and navigate to the tab Characteristic Rels. Define the type as Exit. 2006 SAP AG 7

Click on Detail View to define the details for the Characteristic Relationship. Choose the radio button Derivation, Combination Check and Proposal. Enter the source and target characteristics. In our case the source characteristics would be Material and Customer Sales Representative. The target characteristic would be Profit Center. Enter the Function modules to be used for Derivation, Combination Check and Proposal. In our case, we enter the same as shown below (We shall see the implementation of these function modules later). To return back to the definition of further characteristic relationships, click on Edit Char. Relationships. Planning function Repost (Characteristic Relationship) Ensure that you have a planning level defined that contains all the characteristics and key figures defined in the planning area. 2006 SAP AG 8

Create a planning package in case you want to place selections on the data. Inside the Planning Level, go to Create Planning Function. Choose the function type Repost (Characteristic Relationships) Select the characteristic to be changed. In our case, we will choose Profit Center. 2006 SAP AG 9

Define a Parameter group for the Planning function 2006 SAP AG 10

Function Modules Derivation For derivation, we basically read the values of the fields for Material and CSR and read the corresponding value of Profit Center from the ODS. However, this logic could be much more complicated and proper use of ABAP can help realize the same as well. The code for the function module used is as given below: FUNCTION ZXPRCTR_CALC. *"------------------------------------------------------- *"*"Local Interface: *" IMPORTING *" REFERENCE(I_AREA) TYPE UPC_Y_AREA *" REFERENCE(ITO_CHA) TYPE UPC_YTO_CHA *" REFERENCE(ITO_SOURCE) TYPE UPC_YTO_CHA *" REFERENCE(ITO_TARGET) TYPE UPC_YTO_CHA *" CHANGING *" REFERENCE(XS_CHAS) TYPE ANY *" EXCEPTIONS *" FAILED *"------------------------------------------------------- * DERIVATION FOR PROFIT CENTER *-------------------------------------- * Commented by ADI - included in global *Tables: /BIC/AZXSLSMAP00 *-------------------------------------- data: profctr like /BIC/ZXSLSMAP00-PROFIT_CTR. FIELD-SYMBOLS: <material>, <csr>, <prctr>, <lsdata>. ASSIGN COMPONENT '0PROFIT_CTR' OF STRUCTURE <lsdata> TO <prctr>. ASSIGN COMPONENT '0MATERIAL' OF STRUCTURE <lsdata> TO <material>. ASSIGN COMPONENT 'ZXCSR' OF STRUCTURE <lsdata> TO <csr>. READ TABLE ITO_CHA TRANSPORTING NO FIELDS WITH KEY chanm = '0MATERIAL'. IF SY-SUBRC = 0. SELECT SINGLE * FROM /BIC/AZXSLSMAP00 WHERE /BIC/ZXCSR EQ <csr> AND MATERIAL EQ <material>. MOVE /BIC/AZXSLSMAP00-PROFIT_CTR to profctr. ELSE. MESSAGE E002(Z00) WITH <material> <csr>. RAISING FAILED. ENDIF. <prctr> = profctr. ENDFUNCTION. 2006 SAP AG 11

Proposal FUNCTION ZXPRCTR_PROP. *"------------------------------------------------------- *"*"Local Interface: *" IMPORTING *" REFERENCE(I_AREA) TYPE UPC_Y_AREA *" REFERENCE(ITO_CHA) TYPE UPC_YTO_CHA *" REFERENCE(ITO_CHASEL) TYPE UPC_YTO_CHASEL *" CHANGING *" REFERENCE(ETH_CHAS) TYPE HASHED TABLE *" EXCEPTIONS *" FAILED *"------------------------------------------------------- * PROPOSITION OF PROFIT CENTER *-------------------------------------- * Commented by ADI - included in global *Tables: /BIC/AZXSLSMAP00 *-------------------------------------- data: profctr like /BIC/ZXSLSMAP00-PROFIT_CTR. FIELD-SYMBOLS: <material>, <csr>, <prctr>, <lsdata>. loop at ETH_CHAS ASSIGNING <lsdata>. ASSIGN COMPONENT '0PROFIT_CTR' OF STRUCTURE <lsdata> TO <prctr>. ASSIGN COMPONENT '0MATERIAL' OF STRUCTURE <lsdata> TO <material>. ASSIGN COMPONENT 'ZXCSR' OF STRUCTURE <lsdata> TO <csr>. SELECT SINGLE * FROM /BIC/AZXSLSMAP00 WHERE /BIC/ZXCSR EQ <csr> AND MATERIAL EQ <material>. MOVE /BIC/AZXSLSMAP00-PROFIT_CTR to profctr. <prctr> = profctr. ENDLOOP. ENDFUNCTION. Combination Check The Combination Check ensures that the values that are entered in the transaction data are correct. In this case, we are raising an error message thereby enforcing the conformance. We could change this message to a warning as well. FUNCTION ZXPRCTR_CHECK. *"------------------------------------------------------- *"*"Local Interface: *" IMPORTING *" REFERENCE(I_AREA) TYPE UPC_Y_AREA *" REFERENCE(IS_CHAS) TYPE ANY *" REFERENCE(ITO_CHA) TYPE UPC_YTO_CHA *" REFERENCE(ITO_CHASEL) TYPE UPC_YTO_CHASEL *" EXCEPTIONS *" INVALID *"------------------------------------------------------- 2006 SAP AG 12

* COMBINATION CHECK FOR PROFIT CENTER *-------------------------------------- * Commented by ADI - included in global *Tables: /BIC/AZXSLSMAP00 *-------------------------------------- data: profctr like /BIC/ZXSLSMAP00-PROFIT_CTR. FIELD-SYMBOLS: <material>, <csr>, <prctr>, <lsdata>. ASSIGN COMPONENT '0PROFIT_CTR' OF STRUCTURE <lsdata> TO <prctr>. ASSIGN COMPONENT '0MATERIAL' OF STRUCTURE <lsdata> TO <material>. ASSIGN COMPONENT 'ZXCSR' OF STRUCTURE <lsdata> TO <csr>. SELECT SINGLE * FROM /BIC/AZXSLSMAP00 WHERE /BIC/ZXCSR EQ <csr> AND MATERIAL EQ <material>. MOVE /BIC/AZXSLSMAP00-PROFIT_CTR to profctr. IF <prctr> NE profctr. MESSAGE E001(Z00) WITH profctr <prctr>. RAISING INVALID. ENDIF. ENDFUNCTION. 2006 SAP AG 13

Related Content Further information on these topics can be found using the links below : Characteristic Relationships Repost (Characteristic Relationships) Repost For a previous publication on using ABAP in Planning functions in BW-BPS, click on the link below : Accessing BW Masterdata in BPS using Exit Functions 2006 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. 2006 SAP AG 15