Most companies have established their logistics and billing processes in their SAP ERP Central Component (ECC) systems. Since understanding customers better has become a key strategy, many organizations are now also using SAP CRM to improve and analyze customer experience, interaction, and satisfaction. Integrating the two systems gives companies the option to maintain their solid logistic and billing processes in SAP ECC and enable a customer-centric strategy in SAP CRM.
Key Concept
One of the key integration points between SAP CRM and SAP ERP Central Component (SAP ECC) is between the service order in SAP CRM and logistics and billing in SAP ECC. Service industries come with complex and unique business requirements that require system flexibility. This integration requires enhancements to standard SAP ECC and CRM. In service industries such as high tech, call centers and customer service are key after-sales processes. SAP CRM has built-in customer-centric processes for support in marketing, sales, and service. Interaction center and service order functions in SAP CRM also have built-in integration with SAP ECC backend processes. This provides a complete solution for industries that have service- and customer-focused processes. In this article, I explain standard SAP CRM Service integration with SAP ECC logistics and billing and cover enhancement techniques to address some specific business challenges. My first enhancement overcomes the limitation on standard integration functionalities, such as one-to-one dependency between the purchase order (PO) order type and the logistics integration scenario. For a company that has an SAP ECC system with PO order types that handle more than one purchase order scenario, this is a problem. This enhancement gives an organization a flexible system to decide which PO order type is used for specific business requirements. Depending on how a company operates, it may also need to have additional control on when a CRM service order should trigger the creation of a Debit Memo Request (DMR) in SAP ECC. In standard SAP integration, the system performs a check on the CRM service order status. My second enhancement allows the system to perform an additional check for a business requirement before triggering DMR creation in SAP ECC.
SAP CRM Service Integration in Standard SAP
Using SAP standard integration, an SAP CRM service order can trigger the creation of logistics- and billing-related documents in SAP ECC as follow-up documents. In materials management (MM) the follow-up logistics document can be a reservation, purchase requisition, or PO. In billing, the document can be a credit memo or debit memo request (via sales and distribution [SD]). Both logistics- and billing-related documents are triggered independently from the service order by two different adapters. You can find these two adapters for service scenarios in the Business Add-In (BAdI) implementations CRM_SRV_LOGISTIC_R3A (for logistic integration) and CRM_SERVICE_R3A (for billing integration). I show how a CRM service order integrates with logistics POs and billing DMRs. Controlling, business area, and billing unit integration are not part of this article’s scope.
Note You need to activate both BAdI implementations to enable standard integration. Later on for a specific enhancement scenario for billing, I replace the standard BAdI implementation for billing with a custom BAdI with additional logic. Use transaction SE19 to activate

or deactivate

the BAdI implementation adapters in CRM. SAP provides some guidelines on how to prepare your system for these standard integrations to work. You can refer to SAP Note 862534 for logistic integration and SAP Note 813774 for billing integration. You can find the general concept of the replication scenario for CRM service in SAP Note 1381563.
Integration with Logistics (Purchase Order)
To create a logistics document in SAP ECC, the item category used in the CRM service document has to be registered as relevant for logistics integration in SAP CRM configuration. In the configuration, you also define the specific logistics scenario mapped to this item category. In my example, the logistics scenario is a PO. Different logistics scenarios are assigned to different order types in SAP ECC. You need to map the specific logistics scenario with certain order types in SAP ECC configuration. Do this by using transaction SPRO and then following menu path IMG > Customer Relationship Management > Transactions > Setting for Service Transactions > Integration > Logistic Integration > Define Logic Scenario for Procurement of Materials and Services (
Figure 1). Here you maintain CRM transaction type ZSRV (service order) and map its item categories (ZS01 and ZS02) to the logistics scenario ORDR Purchase Order.
Figure 1
Maintain CRM service transaction type and item category for logistics integration scenario Purchase Order
Configuration in SAP ECC is required to map the logistics scenario with the prepared PO order type. In my example the SAP ECC system creates a PO with the ZPO1 order type. In SAP ECC follow IMG menu path Integration with other mySAP.com Components > Customer Relationship Management > Setting for Service Processing > Logistic Integration > Set Purchasing Document Types for CRM Logistic Integration (
Figure 2). In this window you maintain the ECC logistics scenario (Purchase Order) with SAP ECC PO order type (ZPO1).
Figure 2
Maintain the logistics scenario Purchase Order with PO order type ZPO1 in SAP ECC configuration
From both configurations, you can see that the logistics or PO order type in SAP ECC is mapped one to one with the logistics scenario (not with the service item category directly). This means all CRM service item categories that are assigned to the logistics scenario always use the same PO order type. That helps because a company may have different processes for different purchase scenarios. They may have configured more than one PO order type in SAP ECC. In the enhancement section I describe how to enhance the system to be able to select different PO order types under the same logistics integration scenario.
Integration with Billing (DMR)
For billing integration, I use the creation of a DMR in SAP ECC as an example. To create a DMR in SAP ECC, you have to register the item category used in the CRM service order for external billing in SAP CRM configuration. In CRM, follow IMG menu path Customer Relationship Management > Billing > Define Billing Relevance of Item Categories. For the system to be able to recognize which CRM service item is relevant for external billing in SAP ECC, you must maintain the relevant CRM Service Item Category as External Billing.
Figure 3 shows the configuration. Here you select your item categories, ZS01 and ZS02. You then set both the Billing Relevance and Intercompany Billing fields to External.
Figure 3
Maintain the billing relevance setting for each CRM service item category
In subsequent SAP ECC configuration, you map the CRM service transaction type and its item category with the DMR document type and item category. Using this setting, the SAP ECC system determines the appropriate document type when creating a DMR. To maintain the setting, follow SAP ECC IMG menu path Integration with other mySAP.com Components > Customer Relationship Management > Setting for Service Processing > Billing Integration > Map Transaction Type and Item Categories (
Figure 4). Enter the CRM service Trans. Type as ZSRV with mapping to DM req.doc type DR.
Figure 4
Maintain CRM service transaction type with ECC DMR order type
Next, continue with item mapping by selecting Item category mapping (in the Dialog Structure) and maintain the respective CRM service item category mapping to the ECC DMR item category. In this example, CRM service Item Cat. ZS01 is mapped to ECC DM req. item cat ZDB1 and CRM service Item Cat. ZS02 is mapped to ECC DM req. item cat ZDB2 (
Figure 5).
Figure 5
Maintain CRM service item categories with ECC DMR item categories
If you cannot find the relevant CRM service transaction type or item category in SAP ECC configuration when you are maintaining the configuration in
Figures 4 and
5, then you have to upload them from CRM to SAP ECC. Check the “Integration Tips” section number 3 for details. In SAP standard, the CRM Service Document has to meet certain conditions to trigger the DMR creation in SAP ECC successfully. One of the conditions is that the Completed status has to be set on the System Status at both the header and item levels. (Check the “Integration Tips” section number 2 for more details about other prerequisites.) In some cases companies want the system to generate the DMR after a certain process has been completed. Depending on the implementation design, you need to implement an extra check on the service order before the system triggers the creation of the DMR document in SAP ECC. In the enhancement section I describe how to add a pre-check condition.
How to Enhance the System to Select Different PO Order Types for Different Service Order Item Categories
As I mentioned, companies may use different PO order types in SAP ECC for different purposes. Referring to the configuration of the logistics integration above (
Figures 1 and
2), the SAP ECC system only recognizes one order type (ZPO1) for the PO scenario. However, the business has a specific requirement to handle the PO process separately for different CRM service items and it has designed different PO order types for this purpose (
Figure 6). Following is how you can assign different PO order types depending on the CRM service item categories.
Figure 6
Mapping diagram between CRM item categories with different PO order types in ECC
When SAP CRM triggers the generation of the logistics document in SAP ECC, SAP CRM executes the adapter CRM_SRV_LOGISTIC_R3A and prepares the necessary mapping data into the Business Document (BDoc) structure for the outbound processing. In SAP ECC, this set of data is received and creates the logistics document (PO) accordingly. In SAP ECC you can use BAdI CRM_SRV_MAP_PO_BADI to alter incoming data before the data is processed. Use transaction SE18 to create a new implementation for BAdI CRM_SRV_MAP_PO_BADI. In this new BAdI implementation you add your code into method MAP_PO1. The example code in
Figure 7 shows how to set SAP ECC purchase order types (ZPO1 or ZPO2) depending on the different CRM service item categories (ZS01 or ZS02).
Figure 7
Example code showing how to set different PO order types (DOC_TYPE) depending on different CRM service item categories
With this BAdI implementation the system then alters the value for variable DOC_TYPE and replaces it with the desired PO order types. Note that using this approach you have to make sure the order types used already exist in SAP ECC to avoid errors when the system tries to generate the documents.
How to Add a Pre-Check Condition for DMR creation
Sometimes additional checks are required before the system can create the documents in SAP ECC. You need to add a pre-check condition before SAP CRM triggers DMR creation in SAP ECC. For instance, even though the service representative has done his job and updated the statuses in Service Order to Complete, your business requires acknowledgment sent by the customer via EDI before the system can trigger the billing process. There are ways to solve this requirement. In my example, I use a custom field on the service order (field CUSTOMER_H-ZZCUST_CONF on the header level) to capture the confirmation value from the EDI message sent by the customer. The SAP CRM system then uses this value to decide whether or not to trigger the DMR creation in SAP ECC. Before I continue with the enhancement, let’s take a deeper look into the standard billing integration adapter to understand how the standard billing adapter works and why you replace this adapter with a custom adapter. The standard adapter for billing integration can be found in BAdI implementation CRM_SERVICE_R3A (from BAdI CRM_BUS20001_R3A). If you look inside this BAdI implementation CRM_SERVICE_R3A and open the method CALL_UPLOAD_FUNCTION, there is a call to function module CRM_R3_SERVICE_BILLING_UPLOAD. This function module is responsible for verifying, uploading, and processing CRM service order data to SAP ECC as a billing-related document (in my example it is DMR). In my example scenario, the system only triggers DMR creation in SAP ECC when the customer’s acknowledgment has been set into the CRM service order. This means you have to add a validation check before the system calls function module CRM_R3_SERVICE_BILLING_UPLOAD. Now, I continue with the enhancement procedure. Use transaction SE19 to copy the Classic BAdI implementation CRM_SERVICE_R3A into the customer namespace (e.g., ZCRM_SERVICE_R3A). Then open the copied BAdI implementation ZCRM_SERVICE_R3A and add logic into method CALL_UPLOAD_FUNCTION. See the example code (in
Figure 8), which contains the logic to check the customer confirmation value before calling the actual data upload.
Figure 8
Example of new BAdI implementation for the CRM billing adapter with additional logic
First, the system reads the customer confirmation value that is stored in the CRM service header extension field (CUSTOMER_H-ZZCUST_CONF) and passes it to LCUST_CONF. Then the system checks the value on lcust_conf (CHECK lcust_conf EQ ‘X’.) before the system calls function module CRM_R3_SERVICE_BILLING_UPLOAD. Remember to activate this new ZCRM_SERVICE_R3A BAdI implementation and deactivate the CRM_BUS20001_R3A. Use transaction SE19 to activate or deactivate the BAdI implementation adapters in CRM. Now, you have enabled the system to perform an additional check before triggering DMR creation in SAP ECC.
Integration Tips
Here are some tips you can use when you are integrating CRM and SAP ECC in a logistics and billing integration scenario:
- With logistics integration, you have to define at least one plant in the CRM configuration. The logistic plant is the organizational unit that represents the place where the material or services are produced or provided. A PO requires this plant to identify characteristics of providers and different purchase processing. In standard CRM integration to SAP ECC logistics, the CRM system prevents the logistics integration from being triggered if no record exists in configuration. To maintain the plant, follow IMG menu path Customer Relationship Management > Transactions > Setting for Service Transactions > Integration > Logistic Integration > Assign Plant and Storage Location to Service Organizational Units. Map your CRM service organization (in the example below I enter Service Organiz. SRVORG1, Service Team SRVTEAM1 and Service Employee SRVEMPL1) and enter the Plant PL01 (Figure 9).
Figure 9
Maintain CRM service organization with mapping to the SAP ECC plant
- To enable SAP CRM to successfully trigger the upload of billing documents into SAP ECC, you need to make sure that the CRM service order meets certain conditions. The system checks those when calling function module CRM_SERVICE_BILLING_FILTER. Below are the conditions checked by the system:
- The header object type is BUS2000112 (Service Contract) or BUS2000116 (service order)
- The document has no errors
- HEADER status of ORDER is Completed
- ITEM category is not a sales category
- ITEM category has billing relevance A (externally)
- ITEM category has business scenario CRMSRV (Service)
- ITEM status Invoiced is not set
- ITEM status in ORDER is Completed
- ITEM status in CONTRACT is Released or Completed
- ITEM status Quotation or Inquiry is not set
- ITEM is deleted, which must be communicated to ERP. You need to update SAP ECC as well.
- At least one transfer relevant item is determined according to the conditions listed here.
These are prerequisite conditions set by an SAP standard check when a CRM system tries to upload a CRM service order data for DMR creation in SAP ECC. Fulfillment of these conditions on a CRM service order is a must.
Gunawan Hasim
Gunawan Hasim is a senior consultant at ecenta Australia Pty. Ltd. He has more than 11 years of experience in SAP projects in different industries, including manufacturing, utilities, and high tech. Gunawan has been involved with major SAP CRM implementations in Internet sales, opportunity, sales activity with integration to external mobile (PDA) applications, SAP CRM Middleware enhancement for ECC product master, and SAP CRM Service integration with logistics and billing in ECC. You may contact the author at
gunawan.hasim@ecenta.com. If you have comments about this article or publication, or would like to submit an article idea, please contact the
editor.