Learn a best-practice implementation strategy for enhancing the SAP CRM 7.0 reporting framework to search for SAP CRM transaction data (i.e., one-order documents), such as activities, orders, or complaints using the CRM WebClient UI.
Key Concept
The reporting framework is the underlying layer for all SAP CRM transactional data searches. The CRM WebClient UI is the dominant user interface to search for transactional data in SAP CRM.
If you have a project that requires enhancements to the SAP CRM one order search functionality—a common scenario in implementation projects using SAP CRM, which frequently involves the search functionality of one order documents—you need to know the best approach for enhancing the reporting framework to ensure future support, performance, and reusability. Understanding the underlying concepts and following the correct enhancement methodology is key for a successful implementation of the search functionality.
For the search tool interface, you can use either the SAP CRM WebClient UI or a non-SAP CRM WebClient UI, such as a mobile application. This article covers searches with the CRM WebClient UI.
The Concepts Behind the Reporting Framework
The SAP CRM reporting framework is the central query tool in SAP CRM 7.0 for one order documents, which include sales orders, activities, and opportunities. It is designed independently of the CRM WebClient UI, so you can use it with both CRM WebClient UI search screens and enterprise search services (though we only cover CRM WebClient UI searches here).
Figure 1 shows an overview of the reporting framework in SAP CRM.

Figure 1
SAP CRM reporting framework architecture
You should be aware that:
- The Business Object Layer (BOL) stores the data of the business objects with a defined set of attributes and relationships during the runtime of an SAP CRM application. Different object types are used within the BOL, but the main three are root, dependent, and search objects.
- The generic interaction layer connects the BOL to the underlying business logic and database tables
- The Application Programming Interface (API) layer implements the business logic
Note
This article assumes that readers have a basic understanding of BOL and, as such, the explanation of BOL objects is beyond the scope of this article. For more information you can refer to the
SAP Help.
Before you start to use the standard reporting framework in SAP CRM, be aware that it is designed to work in two steps:
Step 1. Determine the globally unique identifiers (GUIDs) of one order documents, satisfying the search criteria fields (i.e., the search structure). The search structure is the Data Dictionary object that holds all the fields you can use to search the one order GUIDs. This step is implemented with BOL search objects, also known as query objects. With SAP CRM 6.0 and later, the reporting framework has dynamic queries that are more flexible than their earlier counterparts, which were called static queries. A dynamic query uses two control tables: CRMC_REPDY and CRMC_REPDY_DB. Table CRMC_REPDY lists all available search fields, while table CRMC_REPDY_DB lists database accesses that are used to build dynamic open SQL statements.
Step 2. Find the requested result fields (i.e., result structure) for the GUIDs. This step is implemented as a search class. The class name is dynamically determined and follows the naming convention CL_CRM_<QueryObject Name>_RUN_BTIL. Table CRMC_OBJ_BTIL holds the search and result structure names of every BOL query object. For example, for activities search query object BTQAct, the search structure is CRMST_QUERY_ACT_BTIL and the result structure is CRMST_QUERY_R_ACT_BTIL (Figure 2). Note that R denotes a result.

Figure 2
Query object table
Reporting Framework Enhancement Scenarios
Table 1 lists the two possible enhancement scenarios and their methodology for the reporting framework in SAP CRM.

Table 1
Enhancement scenarios
You can examine the steps for these two cases (A and B) with the example of an SAP CRM complaint search. Say that you need to add three search fields—Item Type, Market Year, and External Reference Number—for searching the complaints document in different business cases, and show additional data about the account and the date on which the complaint is created. To do this, you need to enhance both the search structure and the result structure with new fields.
Enhance the Search Structure with New Fields
The steps for enhancing a search structure with new fields cover these three scenarios:
- Item category (ITM_TYPE, which is a standard field in the standard order item table CRMD_ORDERADM_I)
- Market year (YYMARKET_YEAR, which is a custom field added to the standard customer extensions table CRMD_CUSTOMER_H using EEWB)
- External reference number (YYEXT_REF_NUM is a custom field in the custom table YSA_ORD_HDR_DATA that has order header GUID as the key field)
Figure 3
Figure 3
Complaint search view and technical details
Now, enter transaction code BSP_WD_CMPWB, provide a component name (for this example, we used BT1205_CPL), and click the Display button (Figure 4).

Figure 4
The UI Component Workbench
Once the component is displayed, double-click Views in the left panel and drill down in the context node to find the implementation class of the context node (Figure 5).

Figure 5
UI component workbench component display
Double-click the implementation class and locate the value assigned to the attribute BASE_ENTITY_NAME of the CN00 implementation class (Figure 6). The value assigned to the BASE_ENTITY_NAME attribute of this implementation class is the query object BTQCompl, as you can see in the Initial value column in Figure 6.

Figure 6
Implementation class of the search context node
Step 2. Determine the query object search structure. You can do this by querying the standard table CRMC_OBJ_BTIL using the query object name determined in the last step (i.e., BTQCompl). Enter transaction code SE16 and query table CRMC_OBJ_BTIL. Figure 7 shows the results of the query.

Figure 7
Query object search structure
Step 3. Add fields to the query object search structure CRMST_QUERY_COMPL_BTIL determined in step 2. You can do this by entering transaction code SE11 and adding the fields to the customer include structure CI_EEW_BUS2000120_SEARCH. Transaction code SE11 resembles Figure 8 after you add the fields to the structure.

Fgiure 8
Custom include structure with custom fields
Even though these fields are in tables, they are not available in the drop-down list on the CRM WebClient UI complaint query screen. When you add fields to the search structure, they become available in the drop-down list on the CRM WebClient UI complaint query screen and when you are defining the input structure of the complaint search Web service.
Step 4. Configure dynamic access for the custom table in the control table CRMC_REPDY_DB using transaction code SM30 and entering information in the fields shown in Figure 9.

Figure 9
Dynamic access definition table
Note
Step 4 is only needed if the dynamic access for the custom table is not defined in control table CRMC_REDY_DB. SAP has provided the dynamic access for most of the order-related standard SAP tables, so you don’t need to configure the dynamic access for standard SAP tables.
Step 5. Configure the three newly added fields in the control table CRMC_REPDY for dynamic access using transaction code SM30. To start, configure the dynamic access for the item type field by entering YYITEM_TYPE in the Selection field, CRMD_ORDERADM_I-ITM_TYPE in the Fld Name in Database field, and DYN_ORDERADM_I as the Dynamic Access Name (Figure 10).

Figure 10
Dynamic access configuration for item type
Next, configure the dynamic access for the market year field by providing YYMARKET_YEAR as the Selection Field, CRMD_CUSTOMER_H-YYMARKET_YEAR in the Fld Name in Database field, and DYN_CUSTOMER_H in the Dynamic Access Name field (Figure 11).

Figure 11
Dynamic access configuration for market year
Finally, configure the dynamic access for the external reference number field by providing YYEXT_REF_NUM as the Selection Field, enter YSA_ORD_HDR_DATA-YYEXT_REF_NUM in the Fld Name in Database field, and enter DYN_ORD_HDR_DATA in the Dynamic Access Name field (Figure 12).

Figure 12
Dynamic access configuration for external reference number
Enhance the Result Structure with New Fields
Next, we’ll show you how to add new fields to the result structure. You need to add two fields to the complaint query result object BTQRCompl:
- Account name (NAME_ORG1, which is a standard name field in the standard business partner: general data table BUT000)
- Created at (CREATED_AT, which is a standard field in the order header table CRMD_ORDERADM_H)
Step 1. Determine the query result object name for the complaint search. The best way to find the query result object is to locate the component of the result view, the result view name, and the context node used in the view to display results. The value assigned to the attribute BASE_ENTITY_NAME of the context node implementation class is the query object name.
To find the component, result view name, and the context node used to display results, place your cursor on one of the result fields of the result view in the CRM WebClient UI. Press the F2 key which results in the screen shown in Figure 13.

Figure 13
Complaint search result view and the technical details
Go to transaction BSP_WD_CMPWB. Enter the component name and click the Display button (Figure 14).

Figure 14
Enter the component name
Once the component is displayed, double-click the Views and drill down in the context nodes to find the implementation class of the context node (Figure 15).

Figure 15
UI component workbench component display
Double-click the implementation class of the context node and find the value assigned to the attribute BASE_ENTITY_NAME (Figure 16). The value assigned is the query object name BTQRCompl, as you can see in the Initial value column in Figure 16.

Figure 16
Query result structure
Step 2. Determine the query object result structure by querying standard table CRMC_OBJ_BTIL using the query result object name BTQCompl determined in step 1. Enter transaction code SE16 and query table CRMC_OBJ_BTIL to see the screen shown in Figure 17.

Figure 17
Query object result structure
Step 3. Add the fields to the query object result structure CRMST_QUERY_R_COMPL_BTIL determined in step 2 by adding the fields to the customer include structure CI_EEW_BUS2000120_SEARCH. After you add the fields to the structure, transaction code SE11 appears as shown in Figure 18.

Figure 18
Custom include structure with custom fields
Step 4. Implement the enhancement spot ES_CRM_RF_Q1O_CALCULATE to fill the newly added fields. You need to implement the Business Add-In (BAdI) CRM_BADI_RF_Q1O_CALCULATE of the enhancement spot ES_CRM_RF_Q1O_CALCULATE. Go to transaction code SE19 and create the BAdI implementation (Figure 19).

Figure 19
BAdI implementation
Next, fill the newly added fields in the method IF_CRM_RF_Q1O_CALCULATE~CALCULATE by looping the changing parameter CT_RESULTS (Figure 20).

Figure 20
Method IF_CRM_RF_Q1O_CALCULATE~CALCULATE
Note
Looping the changing parameter requires basic ABAP programming skills that are beyond the scope of this article.
Add the filter value BTQCOMPL for the BAdI implementation so that it is triggered only for complaint searches (Figure 21).

Figure 21
Add a filter value for the BAdI implementation
The Final Result
You have successfully added custom fields to the BOL search and result structures, as well as the required configuration and code, which filters the complaint records based on the fields added to the search object and displays the additional data in the result table list. These fields are available to configure for display in the CRM WebClient UI search and result views.
You can test the functionality using transaction code GENIL_BOL_BROWSER by entering BT as the Component set and clicking the execute icon (Figure 22).

Figure 22
GenIL BOL Browser
Navigate to the complaint search object BTQCompl on the left side of the screen and double-click it to enter values for the query parameters (Figure 23).

Figure 23
Search for complaints using the custom fields added to the search structure
Click the Find button on the top of the screen to search for complaints. The results are displayed on the bottom of the screen (Figure 24).

Figure 24
Complaint search results with additional custom field information
Sukant Palo
Sukant Palo has 12 years of experience consulting on SAP technologies. He specializes in the CRM Customer Interaction Center, E-Commerce, Activity Management, Complaint Management, Marketing Planning and Campaign Management, campaign planning and budgeting, and customer master data management. Sukant is also an expert in SAP CRM 7.0 WebClient UI framework architecture and configuration, as well as SAP CRM process and solution design. In previous roles, he worked as a technical lead for an SAP Finance–Treasury team and as a team lead for ABAP development, object-oriented ABAP, reporting, and SAP integration technologies teams.
You may contact the author at sukantpalo@gmail.com.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.

Prasad Yalamuri
Prasad Yalamuri has 10 years of experience in development and consulting on SAP technologies. He is an expert in SAP CRM WebClient UI development, enhancements (including enhancement spots, BAdIs, and user exits), Web services, SAP integration technologies, and object-oriented ABAP. Prasad is currently working as an SAP CRM technical lead and previously worked as a team lead, technical lead, and senior developer of SAP development teams.
You may contact the author at prasadyalamuri@gmail.com.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.