SAP Cloud for Customer ( C4C) and Custom Idoc integration
This is integration scenario example of SAP Cloud for Customer to SAP CRM Onpremise system integration with HCI middleware.
2 Ways to use this blog :
- You want to create custom process codes then follow all the steps
- You just want to use the custom Idoc for integration without need of new inbound process code. In this scenario just in the process section, perform step3 and then Skip to Step 5 where you change the SAP standard message types and replace with your custom message types. Leave the CRMPCD_BUPA_I as process code as that is what you updated in WE57 to redirect. You can then continue with rest of steps.
- You have generated your Idoc using BDFG and have clean Idoc and Message Type.
- Download the Z or Y Idoc WSDL using program : SRT_IDOC_WSDL_NS from your Onpremise system . The highlighted box should be left blank and then you will not get errors. Else it keeps complaining for unreleased segments which are SAP standard and we do not have authorization to release them. Here it is how it should be.
Now Let’s start the process :
- First check the Idoc type and Message Type you are using in the table : TBDFA using transaction SE16 or SE16n in Onpremise system ( Not Mandatory but good to know ) :
For standard Idoc following is used :
The reason to create custom process code is to call the function module attached to our custom Idoc. If you compare the generated code of standard function module CRMXIF_PARTNER_ALE_IN used for standard integration with your custom inbound function module for Idoc e.g. ZIDOC_INPUT_CRMXIFV_PARTNER_SA in this case. You would see that CRMXIF_PARTNER_ALE_IN doesn’t contain custom field or custom Idoc segments (Z or Y fields and segments ) whereas your Idoc’s generated function module contains those. It means for integrating your custom fields the Idocs need to be generated to have custom field and segments.
2. Go to Transaction BD67 . Highlight and copy the standard entry to create your own ( This ste.
Change the copied information to create your own process code or you can utilize CRMPCD_BUPA_I directly in WE20 inbound partner profile for Custom Idoc:
3. Go to WE57 and verify that your Idoc and Message type are maintained:
4. Go to transaction WE42 to maintain the Process Code and Message Type assignment :
Hit enter after choosing above values taking you to next screen. If you already maintained in BD67 then this will get autofilled.
Assign your message type to the process code :
5. Go to transaction WE20 to maintain partner profile :
6. Go to HCI or PI Middleware to make changes . Choose appropriate iflow which you want to make call to your custom Idoc. In my case I want from COD to CRM my custom Idoc to be triggered. I do not want to call it when BP confirmation comes from COD to CRM. So , I choose following :
Go to mapping. Assuming that you have already imported the custom Idoc WSDL for mapping :
Go and change the constant values which are currently assigned to highlighted fields as below.
Change the Idoc type constant value mapping. This is the Value that you have from 1st step from table TBDFA in this blog.
Now Change MessageType constant value mapping :
All of your custom segments should also have constant value ‘1’ if they need to get values. In my case i assigned Segment Z101CI_EEW_BUT000 as constant value ‘1’ and then segment name “SEGMENT” also assigned constant value ‘1’ as i want these segments to be sent in my Idoc from HCI.
Even after assigning the correct mapping and seeing the values cming in Idoc we found that values are not getting saved in Onpremise system. I realized that apart from custom segment we also need to set the values in *DATA_X segment :
Assign constant value ‘1’ to segments. Assign ‘X’ to fields that you want to be saved for application.
I think you are all set for integrating your custom Idoc from C4C to OnPremise system. This example concept will work for Business Partner , Opportunity , Activities , Leads scenario. Only thing that will change will be iflow , custom Idoc in each scenario but the concept will be same.
Do share feedback if you feel anything needs to be added or improved.