!--a11y-->
Using InfoSets and BW Queries in the Segment
Builder 
InfoSets and BW queries are used to access business partner master data (stored for example in the R/3 System) and transactional data stored in the SAP BW System respectively.
The attributes used within these InfoSets and BW queries can be fields belonging to:
· Business partner tables (business partner master data)
· Key figures determined in SAP BW
· Marketing attributes
To create InfoSets, from the SAP Easy Access menu, choose Architecture and Technology ® ABAP Workbench ® Utilities ® SAP Query ® InfoSets.

Any InfoSets you
create for use in the Segment Builder must be created in a cross-client work
area.
Therefore, on
the interface for creating InfoSets, you should first choose
Environment
® Query Areas, and select Global Area
(Cross-Client). This setting ensures that your InfoSets appear for
selection in the input help for the field InfoSet when creating data sources
(Marketing
® Segmentation of Business
Partners
® Marketing Segments
® Maintain Data Sources for
Segment Builder).
For information on how to create InfoSets, see the SAP Library under mySAP Technology Components ® ABAP Workbench (BC-DWB) ® SAP Query (BC-SRV-QUE).
...
1. The most important and simplest point is that the Segment Builder creates target groups containing business partners. Therefore the InfoSet must make its selections using fields relating to the business partner and must be able to return business partner keys. Ideally these keys are GUIDs. If this is not possible (for example because this InfoSet lies in a system in which the GUID is not known, such as an SAP BW or an SAP R/3 System) then it must be a key that can be converted into a GUID in CRM. If this is the case, you must specify a function module in data source maintenance to perform the conversion in the field Function Module). For InfoSet queries, for example, we recommend function module CRM_MKTTG_PF_BP_TAB_TO_GUID, and for other data sources, CRM_MKTTG_PF_CONV_ID_TO_GUID is available.
If the InfoSet is a table join, then it is safest to use BUT000 as the basis table.
2. If you are using a report program, then the structure belonging to this report must contain the business partner GUID (or a field that can be converted into the GUID).
3. The InfoSet should be constructed so that it contains every field that is required for selection in the Segment Builder and these fields only! When you create an InfoSet, the system displays the dialog box InfoSet: Title and Database. On this dialog box, ensure that you select the field No automatic text recognition (under Options) since otherwise the system will generate the texts for all the fields in the InfoSet behind which text fields are defined. These fields are then written into the InfoSet which may lower performance.
4. Do not build one large InfoSet containing a large number of joins. Instead, build InfoSets which join only those tables required for the selection attribute to be created. For example, if you want to create the selection attribute “Date of Birth” your InfoSet should use table BUT000 only (because “Date of Birth” is one of the fields in this table). It is not advisable to read the date of birth from an InfoSet which joins the BUT000 with the address table ADRC.
Query Definition
...
1. In the Business Explorer Analyzer (Business Explorer ®Analyzer) ensure that you set the indicator "Release for OLE DB for OLAP" for the query (under Properties).
2. Ensure that your BW user is a dialog user, since otherwise the input field for queries in data source maintenance will not work (RFC connection between SAP BW and SAP CRM). To check this setting, in the BW system choose Tools ® Administration ® User Maintenance ® Users. Under the Logon Data for the relevant user, ensure that Dialog is selected as User type.
3. Do not specify any variables as "required".
4. Ensure that the query has business partner as info object.
5. Ensure that the business partner is in the row, the key figures in the column(s).
6. Do not define any conditions for the key figures in the query itself. Instead define conditions in the Segment Builder by specifying filter values for the relevant attributes.
Performance Points:
To ensure the best possible system performance, try where possible to avoid:
...
1. Unnecessary characteristics, attributes, or key figures
2. Superfluous conditions or variables
3. Complex key figures
4. Large cubes
5. Complex hierarchies
6. A lot of coding in variables filled by means of user exits
In addition, specify for characteristics either variables or restrictions but not both together.
