How to Extract Data for Multi- Value Characteristics to SAP BW



Similar documents
Step by Step Guide to Extract Batch Master Data via Generic and Classification Datasource to BW

Extractor in R/3 and Delta Queue

Step by Step Guide for Language Translation Tool

Step by Step Procedures to Load Master Data (Attribute and Text) from FlatFile in BI 7.0

SAP FI - Automatic Payment Program (Configuration and Run)

Restricting Search Operators in any Search View

Creating Transaction and Screen Variants

Release Strategy Enhancement in Purchase Order

BW Performance Monitoring

SAP CRM Campaign Automation

SAP CRM 7.0 E2C Setup: CRM via Toolset

Step by Step Guide How to Copy Flat File from Other Application Server to BI and Load through Info Package

SAP BI Generic Extraction Using a Function Module

Compounding in Infoobject and Analyzing the Infoobject in a Query

Inventory Management (0IC_C03) Part - 3

Display Options in Transaction SE16

Step By Step Procedure to Create Logical File Path and Logical File Name

ABAP Debugging Tips and Tricks

Inventory Management in SAP BW

Introduction to COPA and COPA Realignment

Understanding DSO (DataStore Object) Part 1: Standard DSO

Creating New Unit of Measure in SAP BW

Step by Step Procedure to Block and Debug a CIF Queue Flowing from R/3 to APO System

Workflow Troubleshooting and Monitoring in SAP ECC 6.0

Sending an Image File Through XI in a File-to-Mail Scenario

Reverse Transport Mechanism in SAP BI

SAP BW Configuration Basic System Settings

SPDD & SPAU Adjustments Handbook

Web Dynpro: Multiple ALV Grids and Layouts in ALV

How to Generate Stack Xml for Ehp4 and Above Upgrade

Step by Step guide of Report-to- Report Interface in BW Reporting

How to Assign Transport Request for Language Translation?

Multi Provider Creation Based on Sales and Planning Info Cubes

How to Load Data from Flat Files into BW PSA

Dynamic Authorization Concept and Role Assignment in BI

ALE Settings, for Communication between a BW System and an SAP System

Web Dynpro ABAP: ALV and Table in Popup Window

Standard SAP Configuration of SMS through HTTP with Third Party SMS Gateway

How to Modify, Create and Delete Table Entries from SE16

Guidelines for Effective Data Migration

SAP BW - Excel Pivot Chart and Pivot Table report (Excel)

Data Flow from LBWQ/SMQ1 to RSA7 in ECC and Delta Extraction in BI

Query OLAP Cache Optimization in SAP BW

Deleting the User Personalization done on Enterprise Portal

Currency Conversion using Variables in SAP BI -Reporting

Order Split Usage in Production Orders

Understanding BEx Query Designer: Part-2 Structures, Selections and Formulas

Direct Subcontracting Process (SAP SD & MM)

Scenario... 3 Step-by-Step Solution Virtual Infocube... 4 Function Module (Virtual InfoCube)... 5 Infocube Data Display... 7

Organizational Management- Organizational Structure Creation

Embedding Crystal Reports inside ECC ALV Reports

Exposing RFC as Web Service and Consuming Web Service in Interactive Forms in ABAP

How to Create an ecatt?

Process Controlled Workflow SRM 7.0 (Using BRF)

Creating Content Using SO10 Objects and Text Symbols

Step by Step Guide to Create a Generic Datasource Based on Infoset Query Populated Via External Program

Message handling in SAP CRM Web UI

Creating Web Service from Function Modules/BAPIs & Integrating with SAP Interactive Forms

Creation and Configuration of Business Partners in SAP CRM

APD to Update Marketing Attributes from SAP BI to SAP CRM

SAP BW - Generic Datasource Function Module (Multiple Delta Fields)

SAP BW 7.3: Exploring Semantic Partitioning

Configuration and Utilization of the OLAP Cache to Improve the Query Response Time

Table of Contents. Passing Data across Components through Component Controller between Two Value Nodes

Table of Content. SAP Query creation and transport Procedure in ECC6

Deleting the Requests from the PSA and Change Log Tables in Business Intelligence

Configuration of Enterprise Services using SICF and SOA Manager

Quick Viewer: SAP Report Generating Tool

Step by Step Procedure to Create Broadcasters, to Schedule and to Enhance of SAP- BI Queries from Query Designer

SAP CRM-BW Adapter an Overview

Step by Step Guide to Archiving and Deleting of XML Messages in SAP NetWeaver PI

SAP CRM System 6.0/7.0. For more information, visit the Customer Relationship Management homepage

A Step-by-Step guide on SMTP Configuration and File to Mail Scenario Using Process Integration Scenario in PI 7.1

Data Extraction and Retraction in BPC-BI

Solution Manager Service Desk an End-to-End Helpdesk Solution

LSMW: Upload Master Data using Batch Input Recording

Converting and Exporting Data in XML Format

Business Scenario Using GP/Web Dynpro with Back and Forth 3 Level Process and Dynamic Approvers in a Loop

Customer Exit Variables in SAP BW/BI Reports First day of the Current/Previous Month

Understanding BW Non Cumulative Concept as Applicable in Inventory Management Data Model

XSLT Mapping in SAP PI 7.1

Different Types of Alerts for Process Chains. Table of Content

Multi Level Purchase Order Release Strategy

Working with SAP BI 7.0 Data Transfer Process (DTP)

SAP NetWeaver Developer Studio 7.30 Installation Guide

ABAP Proxy Interfacing

Create Automatic Mail Notification/ Alert for Process Chain Monitoring

Vendor Consignment. Applies to: Summary. Author Bio. SAP ECC 6.0. For more information, visit the Supply Chain Management homepage.

Connecting to SAP BW with Microsoft Excel PivotTables and ODBO

Case Study of a Segregation of Duties Project

Sales Commission Calculation & Settlement Handling through Order Processing

Web Application Designer for Beginners

How to Integrate CRM 2007 WebClient UI with SAP NetWeaver Portal

Valuation of Materials using FIFO Method

Overcoming Testing Challenges in SAP Upgrade Projects

Quantifying the Amount of Cash Discount Lost

Deploying Crystal Reports on Top of a SAP BI Query

Configuring HTTPs Connection in SAP PI 7.10

Understanding OLAP Processor and RSRT

SDN Contribution Beginners guide to CRM Interaction Center (IC) Winclient setup

Transcription:

How to Extract Data for Multi- Value Characteristics to SAP BW Applies to: SAP BW 3.5 & 7.0. Summary To extract classification data to BW we need to configure and generate the datasources in transaction CTBW. While configuring these datasources, system does not allow the entry of multi-value characteristics, as a result data for multi-value characteristics cannot be extracted. This article focuses on prerequisites and possible workarounds to extract data for multi-value characteristics to BW. A step by step procedure of extracting HSE classification data for multi-value characteristics is also discussed in this article. Author: Ramakrishna Gattikoppula Company: Infosys Ltd. Created on: 25 September 2011 Author Bio Ramakrishna Gattikoppula is a Technology Analyst at Infosys Ltd. He has 4+ years of experience in SAP BW and has been involved in SAP BW/BO implementation projects. 2011 SAP AG 1

Table of Contents Problem Statement:... 3 Solution:... 4 The R/3 Classification System... 4 Reason for this error... 4 Prerequisites and Possible Workarounds provided by SAP for extracting the classification data to BW... 5 Step by step procedure of extracting Multi-Value Characteristic data to BW... 6 Step1: Generation of datasource for Classification Data... 6 Step 2: Enhancing the generated datasource/extract structure to add additional fields so that additional values can be extracted from Multi-Value Characteristics... 8 Step 3: Implement BADI to update the data in the additional fields in the Enhanced Extract Structure... 9 Step 4: Define additional attributes in the BW system... 11 Related Content... 13 Disclaimer and Liability Notice... 14 2011 SAP AG 2

Problem Statement: How to extract data for multi-value characteristics to BW Scenario: Let us suppose, an Organization is using HSE (Health, Safety and Environment) solution provided by SAP (transaction CBIH82) to capture all HSE data and want to use this data to create Analytical Reports & Interactive Dashboards to allow proper insight into this HSE data across the organization. After analysis, ECC team concluded that standard HSE solution provided by SAP did not satisfy the complete requirements of the organization; as a result SAP ECC team did some customizations to the existing application using classification system to capture the complete HSE data. For e.g. - As a part of this customization ECC team created some classes and assigned various objects to these classes. In one of these classes a multi-valued characteristic Type was added along with two other single valued characteristics Explosion Type and Area of Damage. Following is the screenshot of the customized application. Now, to extract this classification data into BW, BW team needs to configure the datasources for the classification data using transaction CTBW. While configuring these datasources in transaction CTBW an error was faced when characteristic Type was added as one of the fields in the Data Source. Following is the error message: 2011 SAP AG 3

Solution: In this article I have tried to explain: The R/3 Classification System, Reason for the above error, Prerequisites and Possible Workarounds provided by SAP for extracting the classification data to BW and Step by step procedure of extracting Multi-Value Characteristic data to BW. The R/3 Classification System R/3 supports many ways of customizing it to store additional data fields. For e.g., many tables support customer defined additions, but there is also the Cross Application Classification System. The classification system allows you to use characteristics to describe all types of objects and to group similar objects in classes to classify objects, in other words, so that you can find them more easily later. The classification system allows R/3 to hold many varied additional fields against many different sorts of R/3 object, for e.g. it might allow you to store a color against a material. Here is some terminology: Object type (Material, Documents, Debitor,...) Object Class type Class Characteristic Characteristic Value Reason for this error The underlying table which is used for classified objects.(mara, DRAW, KNA1,...) A predefined business entity such as vendor, material, equipment or customer. Defines which object type can be classified with the class of that class type. It groups similar objects or classes. By assigning an object to a class the objects can be evaluated with values of characteristics of this class. A property of an object, this is the new field being added. For e.g. a new characteristic might be the Weight of a material. A value describes a certain specification of a characteristic. For e.g. Weight of a material might be 100 KG. The classification system supports entering multiple single values, ranges, free text, and values from predefined lists or other tables. It is very flexible, and it is this flexibility that makes it sometimes tricky to extract data to BW. BW system cannot manage multiple values for a characteristic of an InfoObject. Therefore, when creating datasources for classifications (transaction CTBW), you cannot use multiple-value characteristics. 2011 SAP AG 4

Prerequisites and Possible Workarounds provided by SAP for extracting the classification data to BW Following are two prerequisites that needs to be considered if you are planning to extract classification data to BW 1. If the characteristic value has been setup to accept multiple values, then BW cannot extract all the values without additional configuration. For e.g., say the characteristic hobbies has been setup to accept multiple values. In R/3 you could therefore store the values Football, Literature and Cricket all against that single characteristic. This does not match the way BW stores data, in BW a characteristic is expected to store only a single value. 2. The classification definitions must be the same in all R/3 clients. For e.g. if hobbies is defined as accepting only a single value in the R/3 client 100, it must be defined in the same way in R/3 client 110 and all other clients in all systems. This is because the extractor is defined cross-client. According to the first prerequisite we need to perform some additional configuration/workarounds to extract data to BW. These configurations/workarounds are discussed in the following section. 1. Apply OSS Notes 350296 and 535370, with this the error message can be changed to a warning message; the modification is not implemented in the standard system. After this modification only one value is transferred during the extraction i.e. if a multi-value characteristic Hobbies has values Football, Literature and Cricket then only one of these values is transferred during extraction. In these kind of scenarios where characteristic is assigned multiple values it is not possible to predict which of the assigned values are extracted, if Several values are specified in the classification system only the first value is extracted to BW and this first value extracted may differ even if same set of Hobbies are defined for different persons. In general this workaround is not recommended as there is loss of data and also confusion about the characteristic value that is extracted. 2. Configure all the characteristics in the classification system to accept only a single value. In the above example you could configure hobbies1, hobbies2 and hobbies3 to store all the values. Doing this limits the no. of valuations, However, you can work around this in R/3 by using an additional multiple-value characteristic i.e. first three hobbies can be stored in hobbies1, hobbies2 and hobbies3 and the remaining valuations can be stored to an additional multi-value characteristic. This solution causes restrictions in the usage of classifications (for e.g., finding objects in classes (transaction CL30N)). Check whether you can work with these restrictions. The most important criteria for this check are: - The necessary changes in the modeling in the classification system and the level of effort required when the valuations in existing classifications have to be distributed amongst several characteristics. - The effects of these changes (for e.g., the effects on the object search in the classification system). 3. Another approach would be to modify the extractor to add additional fields so that the additional values are extracted. These values must then be assigned several attributes in BW. The number of possible values is restricted by the number of additional attributes that you define. In order for this solution to work: - You would need to add extra fields for the additional attributes to the datasource that is created using transaction CTBW. - You would have to enlarge the extractor in order to be able to deliver the additional values. This would probably require a lot of effort. - You would have to define additional attributes in the BW system. In the following section I have explained the step by step procedure to extract multi-value Characteristic values to BW using one of workarounds mentioned above (Workaround No. 3 i.e. to modify the extractor to add additional fields). 2011 SAP AG 5

Step by step procedure of extracting Multi-Value Characteristic data to BW Step1: Generation of datasource for Classification Data Once the R/3 team has finished their configuration in classification system, you can generate the datasource and extractors to extract classification data. This can be done using transaction CTBW, to generate datasource for classification you need to specify the basic datasource you want to extend, then the client which you want to extract the data from and the class type for the master data. In this example we are extracting HSE data, so basic datasource would be 0EHS_IAL_ATTR and the class type would be 100. Following is the screenshot of datasource in CTBW. Generally generated data source name would be concatenation of 1CL_, first four characters of Basic datasource and a 3 digit number. Once the datasource has been entered, select the datasource line and double click on Characteristics in the left hand tree. In the characteristics screen you can enter the characteristic names which you want to include in this datasource. Click new entries on the top left of the screen to add some characteristics. Enter Characteristic Names, and the other fields will default correctly. Once all the Characteristics have been entered, click save and generate source. 2011 SAP AG 6

This step will generate a datasource and an Extract Structure, in transaction RSA6 you can check all the characteristics added to the generated extract structure. In the generated extract structure ACTN, RECN, DATEFROM and DATETO will be added by default along with the characteristics specified in transaction CTBW. 2011 SAP AG 7

Step 2: Enhancing the generated datasource/extract structure to add additional fields so that additional values can be extracted from Multi-Value Characteristics As discussed earlier a multi-value characteristic Type (whose values are preconfigured by ECC team as Phrases (i.e. Phrase Key & Phrase Text)) is added to the Class & Explosion in the HSE application. Following is the possible set of Characteristic values for this multi-value characteristic. Phrase Key CUST-ZEHSC0000000060 CUST-ZEHSC0000000061 CUST-ZEHSC0000000062 CUST-ZEHSC0000000063 Phrase Text Ordinary Combustibles (wood, paper, plastics) Flammable Liquid /gases (gasoline, diesel, natural gas) Electrical Flammable Solids/Metals (sodium, magnesium, potassium) Therefore for any Incident/Accident, characteristic Type can be assigned with one or more values from the above table. For e.g.: For Incident/Accident 1001, Type can be CUST-ZEHSC0000000060. For Incident/Accident 1002, Type can be CUST-ZEHSC0000000060, CUST- ZEHSC0000000061 and CUST-ZEHSC0000000063 In this example we know that there can be a maximum of four types for any Incident/Accident, therefore we need to add four additional fields to the Extract Structure of the generated datasource to extract type. Following is the screenshot of the modified extract structure: ZZFIRETYPE1, ZZFIRETYPE2, ZZFIRETYPE3 and ZZFIRETYPE4 are added to the extract structure to store the different values of Type for a particular Incident. 2011 SAP AG 8

As the generated datasource does not contain the Incident/Accident ID, an additional field ZZIALID is also added to the extract structure to extract the Incident/Accident ID so that it is easier to identify the Types and Explosion types for each Incident. Step 3: Implement BADI to update the data in the additional fields in the Enhanced Extract Structure In the above example, the additional fields which are added to extract structure will not extract the exact value of the fire type but a flag will be set based on the value of the fire type. This will be explained in the following sections. If you do not wish to set a flag and extract the actual value you can do that by slightly modifying the code given in the following sections. For E.g.: Extracted data for Incident/Accidents 1001 and 1002 is as shown below ACTN Date From Date To RECN Explosion Type Area of Damage Type 1 Type 2 Type 3 Type 4 IAL ID 0 01/01/1000 12/31/9999 1234 Ballistics 11-100 Y 1001 0 01/01/1000 12/31/9999 1235 Ballistics 11-100 Y Y Y 1002 A BADI needs to be implemented in order to update the values (flags) for Types and IAL ID (Incident/Accident ID) in the extract structure. To implement BADI go to transaction SE24 and enter the Class/Interface name in the Object type. Once you have entered the Object type click on Change, in the following screen click on tab Methods. In Methods tab enter the generated datasource name (1CL_0EHS0**) as Method, while doing this remove the first character of the datasource name i.e. method name should be as shown in the following screenshot. After creating the method, double click on the method name. A new screen will appear where you can write the code to extract values for Type and IAL ID. 2011 SAP AG 9

Following is the sample code: To extract the IAL ID and characteristic values for Type (i.e. multi-value Characteristic) we need to use RECN and ACTN which are extracted by default in the Extractor. IAL ID can be derived from tables CCIHT_IHVA and CCIHT_IAL by passing the RECN and ACTN. Following is the sample code to derive IAL ID: * Derive IAL ID using RECN and ACTN extracted READ TABLE INT_CCIHT_IHVA INTO wa_cciht_ihva WITH KEY RECN = <L_S_DATA>-RECN ACTN = <L_S_DATA>-ACTN BINARY SEARCH. IF sy-subrc = 0. READ TABLE INT_CCIHT_IAL INTO wa_cciht_ial WITH KEY RECNROOT = wa_cciht_ihva-recnroot BINARY SEARCH. <L_S_DATA>-ZZIALID = wa_cciht_ial-ialid. ENDIF. Data for Multi value characteristics is mainly stored in tables AUSP and INOB, so we need to create an inner join for these two table based on OBJEK in AUSP and CUOBJ in INOB to extract the characteristic values. Following is the sample code to extract the characteristic values for multi-value Characteristic Type from the tables AUSP and INOB. * Concatenate RECN and ACTN to get OBJEK concatenate <l_s_data>-recn <l_s_data>-actn into v_objek. * Get the Characteristic values for Multi value field Type by joining tables AUSP and INOB select i~objek a~atwrt a~atinn into corresponding fields of table itab_multival from ( ausp as a inner join inob as i on a~objek = i~cuobj ) where a~mafid = 'O' and a~klart = '1 00' and i~objek = v_objek and a~atinn = '0000004961'. In the above statement mafid is Indicator: Object/Class which is restricted to Object, klart is the Class Type, here it is 100 and atinn is the Internal characteristic in this case internal characteristic number for type is 0000004961. You can find the internal characteristic number for any calssification characteristic from table CABN. Above select statement will return a maximum of four rows for a particular RECN and ACTN (i.e. for a particular IAL ID) as Characteristic Type can be assigned a maximum of four values as mentioned in step 1. Now to update the fields in the extract structure a simple case statement can be used as shown below. LOOP AT itab_multival INTO wa_multival. CASE wa_multival-atwrt. WHEN 'CUST-ZEHSC0000000060'. <L_S_DATA>-ZZFIRETYPE1 = 'Y'. WHEN 'CUST-ZEHSC0000000061'. <L_S_DATA>-ZZFIRETYPE2 = 'Y'. WHEN 'CUST-ZEHSC0000000062'. <L_S_DATA>-ZZFIRETYPE3 = 'Y'. WHEN 'CUST-ZEHSC0000000063'. <L_S_DATA>-ZZFIRETYPE4 = 'Y'. WHEN OTHERS. ENDCASE. ENDLOOP. 2011 SAP AG 10

In the above statement ZZFIRETYPE1, ZZFIRETYPE2, ZZFIRETYPE3 and ZZFIRETYPE4 will be updated based on the values entered for characteristic Type in the Application (See the example data in Step 2 & Step 3). Snapshot of Data in AUSP table is as shown in the below table: OBJEK ATINN ATWRT 000000000000001234 0000004961 CUST-ZEHSC0000000060 000000000000001235 0000004961 CUST-ZEHSC0000000060 000000000000001235 0000004961 CUST-ZEHSC0000000061 000000000000001235 0000004961 CUST-ZEHSC0000000063 If you test the extraction in transaction RSA3, extracted data for Incident/Accidents 1001 and 1002 will be as shown in the below table: Snapshot of Data after extraction in RSA3: ACTN Date From Date To RECN Explosion Type Area of Damage Type 1 Type 2 Type 3 Type 4 IAL ID 0 01/01/1000 12/31/9999 1234 Ballistics 11-100 Y 1001 0 01/01/1000 12/31/9999 1235 Ballistics 11-100 Y Y Y 1002 Step 4: Define additional attributes in the BW system With the above steps, configuration on ECC side is completed. Now we would have to define additional attributes in the BW system to accommodate data from these additional fields. To identify the attributes easily for multi-value fields you can include a prefix for the field names e.g. FT_Ordinary Combustible, FT_ Flammable Liquid /gases etc. 2011 SAP AG 11

Once you have defined the additional attributes, you can map these attributes directly with the corresponding fields in the datasource. Following is the snapshot of the data after extraction to BW. 0EHS_IAL FT_Ordinary Combustibles FT_Flamable Liquid/gases FT_Electrical FT_Flamable Solids/Metals Explosion Type Area of Damage. 1001 Y Ballistics 11-100. 1002 Y Y Y Ballistics 11-100. 2011 SAP AG 12

Related Content SAP Note 350296: https://service.sap.com/sap/support/notes/350296 SAP Note Number: 1002105: https://service.sap.com/sap/support/notes/1002105 http://wiki.sdn.sap.com/wiki/display/plm/classification+at+a+glance http://www.google.co.in/url?sa=t&rct=j&q=affine%20uk&source=web&cd=3&sqi=2&ved=0cc0qfjac&url=htt p%3a%2f%2faffine.co.uk%2fcms%2fuploads%2fhow_to_extract_classification_data_into_bw.pdf&ei= VWyETuC3BoLKrAeLxZTvDA&usg=AFQjCNGT3DkUVMNWdtQO4Knid_JrTdyZgw 2011 SAP AG 13

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 14