In any business scenario, we create custom fields to map an additional data into the system. And in most of the cases, we need to transfer these custom fields data between multiple systems. In this blog-post, I’ll demonstrate how we can enhance the standard C4C + CPQ integration to send custom field’s data from SAP C4C to SAP CPQ and vice versa.
For this, let’s consider a scenario – A sales quote has a custom field on quick create screen(in C4C) which indicates the winning probability of the sales quote and we need to send this field's data to SAP CPQ's custom field 'Winning Probability'.
This enhancement is divided into 3 sections based on the system as -
- Configuration in SAP C4C
- Configuration in SAP CPQ
- Configuration in SAP CPI (formally known as SAP HCI)
1. Configuration in SAP C4C
1.1. Create a custom "Short Text" field in SAP C4C named ‘Winning Probability’
1.2. Add this field to standard OData Service ‘cpquote’
1. 3. Add this field to standard SOAP API by modifying additional settings.
1.4. Download the WSDL from related communication arrangement which is configured in Step 1.3.2 in my previous blog-post on
SAP C4C Integration with SAP CPQ as part of basic integration setup.
1.5. Save it on your local device as we’ll have to use it in CPI enhancement (step 3).
2. Configuration in SAP CPQ
2.1. Create a custom field ‘Winning Probability’ in SAP CPQ note its technical name.
3.Configuration in SAP CPI -
Configuration in SAP CPI is can be categorized into two scenarios as -
1. Enhancement in ‘Replicate Quote to SAP CPQ’
2. Enhancement in ‘Replicate Quote from SAP CPQ’
3.1. Enhancement in ‘Replicate Quote to SAP CPQ’
3.1.1. Edit the iflow ‘Replicate Quote to SAP CPQ’ and navigate to resources tab. Download the ‘QuoteCollectionEntityGET0’ xsd to your local system as highlighted in below screenshot.
3.1.2. Edit the file to add the relevant extension field. In our example, the custom field is on the header, so we’ll be adding the field in header.
3.1.3. Save the file without changing its extension and upload it in Resources section. In this case, we’re saving the file with new name as ‘QuoteCollectionEntityGET0_V0.1’.
3.1.4. Edit the message mapping by clicking on ‘MapC4CToCPQQuote’. Edit source message and replace existing xsd with the newly uploaded file in step 3.1.3
3.1.5. Now create a field under Header->CustomFields by clicking on ‘Select -> Duplicate Subtree’
3.1.6. Assign constant value to the newly created subtree. The constant value would be technical name of CPQ custom field. In our scenario it is ‘WinningProbability’ as highlighted in step 2.1. And map the custom fields data to value field.
3.1.7. Save and deploy the iflow. This will send the custom field data from C4C to CPQ during quote creation.
3.2. Enhancement in ‘Replicate Quote from SAP CPQ’.
3.2.1. Edit the iflow ‘Replicate Quote from SAP CPQ’
3.2.2. Upload the XML file downloaded in step 1.4 under Resources section - as highlighted in below screenshot,
3.2.3. Once the file is uploaded successfully, edit the quote mapping by clicking on tile ‘Map CPQQuote To C4CQuote’.
3.2.4. Edit the target message by clicking on ‘Edit Message’ button and replace the destination WSDL. Save the settings by clicking on OK
3.2.5. Now, we have the custom fields in both the messages and the only remaining part is to map them. Add below logic to transfer the custom field data from CPQ to C4C.
By following above approach, we can transfer the custom field data in one of the important integrations of SAP C/4 HANA Sales Cloud.Keep integrating!!! ?
Regards,
Nikhil