Escolar Documentos
Profissional Documentos
Cultura Documentos
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
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.
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
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 Fire 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 Fire Type was added as one of the fields in the Data Source.
Following is the error message:
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
Defines which object type can be classified with the class of that class
type.
Class
Characteristic
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.
Characteristic Value
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).
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.
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.
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 Fire Type (whose values are preconfigured by ECC team
as Phrases (i.e. Phrase Key & Phrase Text)) is added to the Class Fire & Explosion in the HSE application.
Following is the possible set of Characteristic values for this multi-value characteristic.
Phrase Key
Phrase Text
CUST-ZEHSC0000000060
CUST-ZEHSC0000000061
CUST-ZEHSC0000000062
Electrical
CUST-ZEHSC0000000063
Therefore for any Incident/Accident, characteristic Fire Type can be assigned with one or more values from
the above table.
For e.g.: For Incident/Accident 1001, Fire Type can be CUST-ZEHSC0000000060.
For Incident/Accident 1002, Fire Type can be CUST-ZEHSC0000000060, CUSTZEHSC0000000061 and CUST-ZEHSC0000000063
In this example we know that there can be a maximum of four Fire types for any Incident/Accident, therefore
we need to add four additional fields to the Extract Structure of the generated datasource to extract Fire 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 Fire Type for a particular Incident.
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 Fire 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
Fire
Type 1
01/01/1000
12/31/9999
1234
Ballistics
11 - 100
01/01/1000
12/31/9999
1235
Ballistics
11 - 100
Fire
Type 2
Fire
Type 3
Fire
Type 4
IAL
ID
1001
1002
A BADI needs to be implemented in order to update the values (flags) for Fire 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 Fire Type and IAL ID.
In the above statement ZZFIRETYPE1, ZZFIRETYPE2, ZZFIRETYPE3 and ZZFIRETYPE4 will be updated
based on the values entered for characteristic Fire 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
Fire
Type 1
01/01/1000
12/31/9999
1234
Ballistics
11 - 100
01/01/1000
12/31/9999
1235
Ballistics
11 - 100
Fire
Type 2
Fire
Type 3
Fire
Type 4
IAL
ID
1001
1002
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
1001
1002
FT_Flamable
Liquid/gases
FT_Electrical
FT_Flamable
Solids/Metals
Explosion
Type
Area of
Damage
Ballistics
11 - 100
Ballistics
11 - 100
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