Transfer Custom Field’s Data between SAP C4C and SAP CPQ
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!!! ?
Thanks Deepak ??
Nice blog Nikhil?
Well explained, Thank You!
Very informative and nicely written with snapshots.
Nice Blog!! Thanks Nikhil
Hello Nikhil. Thanks for this nice blog.
I need to send custom item fields from CPQ to C4C. How do I proceed ?
Thanks for your advice.
You have to follow the same steps which I have mentioned in the content. The only thing is you will only modify "Replicate quote from SAP CPQ" iflow.
Thanks for your fast response.
I can see the element ‘Custom Fields’ at header level of the WSDL but not in the item level, in the iFlow: Replicate Quote from SAP CPQ.
Is there any way to replicate CPQ Item Custom Fields to C4C?
what you can do here is just copy the header level custom field details and paste it in the items/item node when you edit the WSDL and that's it. the CPQ system will provide you the data in that format only.
Could you please tell what logic is implemented in groovy script 'getCustomFieldValue' in the CPI mapping.
I’m using standard groovy script ‘getCustomFieldValue’ available in the iflow. Below is the related code.
Thank you! Nikhil.
Thank you Nikhil, your blog was very useful!
One change for 3.1, that you also need to add the custom fields as Query Options here.