Learn how to capture SAP Customer Relationship Management marketing attribute data in SAP NetWeaver BW and use it in reporting, with a focus on a complication that, if left unchecked, can result in incomplete data. Sample code is included.
Key Concept
Marketing attributes are used in SAP Customer Relationship Management (CRM) to store data that can segregate customers into various segments. You then can use the segments to drive personalized marketing campaigns. The data stored in marketing attributes can be assigned to business partners and is usually not part of the business partner master data in SAP CRM. These marketing attributes can be used in SAP NetWeaver BW to enhance reporting based on customer segments.
Marketing attributes are used to achieve customer (i.e., business partner) segmentation in an SAP Customer Relationship Management (CRM) system. This segmentation allows you to perform selective marketing to your customers.
Based on a loyalty program, a retail company might have various customer segments, such as age group, occupation, hobbies, or purchase frequency. For example, using marketing attributes, a company can target marketing campaigns providing special discounts on stationery for customers who are students.
Marketing attributes can have one or multiple values assigned to them. Although the age group is an attribute that can have only one value assigned to it at any time, the hobby is an attribute that can have multiple values.
All this is straightforward — except for an important complication: Each attribute needs to only hold one value or you risk getting incomplete data. A solution is to create one InfoObject for each attribute value, which I explain how to do.
First, however, let me explain the background of this scenario.
Creating Marketing Attributes in CRM
In SAP CRM, use transaction CRMM_ROUT_PROF_CHAR and the click the Create button to create marketing attributes or simply attributes. Enter your attribute name, click create, and then click the save icon (Figure 1).

Figure 1
A list of values for an age attribute
In the Values tab, you can specify the list of possible values for this attribute. In this case, I use age. Figure 2 shows how to create another attribute for hobbies, for which multiple values are possible.

Figure 2
Multiple values for a hobbies attribute
You assign the marketing attributes to business partners by using an attribute set. Use transaction CRMD_PROF_TEMPL to create an attribute set. Enter the attribute set name and click the Create button. Then click the Values button. From there, you can then assign the attributes created in the earlier step to the attribute set, as shown in Figure 3. Once you have added your attributes to the attribute set, click the save icon.

Figure 3
Create an attribute set
Once you have the attribute set, you can then assign the attributes to your business partner. Use transaction BP to enter the business partner creation and maintenance screen and go to the Marketing Attributes tab (Figure 4). You can also access an existing business partner (Person 281 in my example) via this screen. In the Attribute Set field, select your set from the drop-down menu. Click the Assign Attribute Set button. The attributes assigned to the attribute set appear on the lower end of the screen.

Figure 4
Assign attributes to an attribute set
Next, you assign specific attribute values to the business partner. Double-click the attribute. A pop-up window appears in which you select the required value (Figure 5). The first attribute (age group) is a single selection, so the options are set up as radio buttons. When you’re done, click the green check mark.

Figure 5
The age attribute pop-up window
The second attribute (hobbies) can have multiple selections. Because you can choose more than one attribute value, the selection options are arranged as check boxes (Figure 6).

Figure 6
Check boxes for multiple selections
With this step, marketing attributes are assigned to a business partner. In my example, the changes are made to Person 281. For more details on customer segmentation and marketing attributes, go to to this SAP Help page.
Using Marketing Attributes in SAP NetWeaver BW
The data for marketing attributes is not directly stored with business partner master data in the SAP CRM system. To report on it in SAP NetWeaver BW, you need to associate this data with either master or transactional data. The best approach is to store this data as navigational attributes and enable them in reports. In this approach, you create InfoObjects corresponding to marketing attribute values. You then add these as navigational attributes to InfoObject 0BPARTNER and load data to them.
The marketing attributes data is always stored in two data sources: 0CRM_MKTATTR_ATTR and 0CRM_MKTMETA_ATTR. You can extract data from these sources and load it to master data.
Applications of Marketing Attributes in BW Reports
How can the end user leverage marketing attributes in SAP NetWeaver BW reports? Imagine that a user is viewing a report showing sales data for a particular product or service. To gain a better understanding of the marketing strategy, the user could use a filter on the age group marketing attribute to display the revenue the product generated from sales to customers of age group 50 years or older. The user could then launch a targeted marketing campaign for this product directed at customers who match this attribute.
Challenges and a Solution
Marketing attributes data is stored in SAP CRM tables. As I describe earlier, you extract this data from one of two data sources and then load it to business partner master data. The process is straightforward. Therefore, why do you need an article telling you to do this? Well, because there are some complications.
In the previous sections, I discuss how the marketing attributes can hold single or multiple values. If the marketing attribute is age group, then it can hold only one value at any time. In contrast, the hobby attribute can hold multiple values, such as sports, shopping, and food.
A single business partner can be assigned multiple attributes that are stored in the same InfoObject. Why is this a problem? Because 0BPARTNER is not compounded, each attribute for a particular business partner needs to have exactly one value. For example, BP 001 has the navigational attribute ZHOBBY, and it has to store the values sports and food. Because BP is the only unique key, ZHOBBY can’t hold more than one value for BP 001, so only the last loaded data is stored, resulting in incomplete data.
While ZHOBBY is a hobby attribute, in SAP NetWeaver BW, it’s also an InfoObject. So, it can hold only one value for each business partners. This is why we create one InfoObject per attribute value in SAP NetWeaver BW.
The solution to this problem is to create one InfoObject for each attribute value (not each attribute). Based on this approach, the preceding example of the hobby attribute results in five navigational attributes instead of one. This solution results in many navigational attributes for 0BPARTNER.The solution causes a problem most of the time because there is a system limit on the number of attributes an InfoObject can have (224 or 700-plus based on the database type). Because of the structure of 0BPARTNER, you must have multiple InfoObjects instead of just one, which goes against SAP NetWeaver BW best practices. However, it is the only possible option.
Many businesses have a lot of marketing attributes defined on their CRM systems, and each attribute might have many possible values. Caution must be exercised by limiting the number of extracted marketing attributes to the SAP NetWeaver BW system. You need to discuss this with the business and determine the attributes that are absolutely necessary for SAP NetWeaver BW reporting. Only pull the required information into SAP NetWeaver BW. Remember, 0BPARTNER already has a great number of attributes from content, and many of them are used productively. You can have only so many attributes for an InfoObject.
This is a tricky concept, so let me explain it further. The main InfoObject in question on the SAP NetWeaver BW side is 0BPARTNER.
On the SAP CRM side, customer age is a marketing attribute. Let’s suppose the age ranges of 10–20 and 21–30 are marketing attribute values.
In SAP NetWeaver BW, you need to create InfoObjects for each SAP CRM marketing attribute value, which means you end up with two InfoObjects: 10–20 and 21–30.
After you create the two InfoObjects, you have to associate them to InfoObject 0BPARTNER in SAP NetWeaver BW. You do this by adding the InfoObjects as attributes to 0BPARTNER.
In summary, attributes of SAP NetWeaver BW InfoObjects are also InfoObjects on their own, but should not to be confused with SAP CRM attributes.
Note
The number of attributes an InfoObject can have depends on the database. As I discovered in one of my projects recently, the maximum number of attributes possible for an SAP MaxDB database is 224. I had to delete many unused attributes to accommodate about 50 marketing attribute InfoObjects.
Extracting Attributes to SAP NetWeaver BW
Now, I discuss the steps to complete to extract marketing attributes data to SAP NetWeaver BW. Each marketing attribute value needs to correspond to one InfoObject in SAP NetWeaver BW. You also need a few objects to help extract data from the SAP CRM source system. These objects (Table 1) are already provided as part of the content. You can activate them and use them directly.

Table 1
Objects for extracting data from SAP CRM
Now I explain the structure and functions of these objects. Data source 0CRM_MKTMETA_ATTR delivers the list of marketing attributes present in the source. It contains two fields — one for the client, and the other for the description characteristic (ATNAM) for the marketing attribute name. The other data source, 0CRM_MKTATTR_ATTR, contains data for the marketing attribute name, a list of defined values for each attribute, and the values’ association to the business partner. It includes the following fields:
- PARTNER: Business partner
- ATNAM: Attribute name
- ATWRT: Attribute value
Metaphorically speaking, think of 0CRM_MKTMETA_ATTR as master data and 0CRM_MKTATTR_ATTR as transaction data. These two data sources are then connected to DataStore object (DSO) 0ATR_DS01 in a simple tunneling transformation, which is then used to load data to the business partner.
Marketing Attributes for a Business Partner
My example has one value possible for the age group attribute and five values possible for the hobby attribute. For this data to be extracted to an SAP NetWeaver BW system, I create six InfoObjects, each corresponding to individual attribute values, and include them as navigational attributes to the business partner. This step is a basic function in SAP NetWeaver BW, so I won’t go over it in detail.
Note that these InfoObjects can also be included as display attributes, but if the requirement is to filter independently of 0BPARTNER values, then they have to be navigational attributes.
Figure 7 shows the fields selected as navigational attributes (under the Navigational att. Description column).

Figure 7
Marketing attribute InfoObjects added to 0BPARTNER
The source data stored in DSO 0ATR_DS01 (Table 1) is loaded to the previously created objects. Based on the data coming from 0ATR_DS01, the source data needs to be selectively loaded to the appropriate InfoObject.
For example, the source data for business partner 001 is sports = soccer. This field needs to be mapped to InfoObject ZMK00702, and data for the age group needs to be mapped to ZMK00701. In my opinion, the easiest way to handle this scenario is to create an expert routine. Figure 8 shows a sample expert routine code that is used to load data for the previous example. Click here to download this routine code.

Figure 8
The routine code for loading data
Notice that for the multiple value attribute, I flag the data as x if the condition is satisfied because the InfoObject represents exactly one value, and the data stored in this attribute doesn’t matter. The common data flag x also helps in maintaining consistency for the user while filtering. For the single value attribute, I directly map the value coming from the source because this value is the data that the user filters in the report.
Now that I have implemented the logic for loading data in the expert routine, the next step is to create a data transfer process and load data. Figure 9 shows the marketing attributes data loaded to 0BPARTNER. You can use these in your reports and enable your users to report on business partner data based on SAP CRM marketing attributes.

Figure 9
Marketing attributes data loaded to 0BPARTNER
You now have learned how to load SAP CRM marketing attributes data to 0BPARTNER in an SAP NetWeaver BW system.
Rakesh Kalyankar
Rakesh Kalyankar is an SAP NetWeaver BW- and HANA-certified lead and architect, working with SAP Global Delivery in Bangalore, India. He speaks regularly at events, such as SAP TechEd and BIIG. He is also an SAP trainer and writes frequently about SAP NetWeaver BW and SAP HANA topics. Prior to his starting his consulting work, he was part of the SAP NetWeaver BW research and development team at SAP Labs, and he has worked on the development life cycles of SAP NetWeaver BW releases, including versions 7.30 and 7.03.
If you have comments about this article or would like to submit an article idea, please contact the BI editor.
You may contact the author at rakesh.kalyankar@gmail.com.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.