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.
Pre-requisite :
- 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.
Thanks for this good explanation of using a custom process code for the integration!
Thanks Ginger. I think first 2 snapshots don't look very clear. People have to click on image to see it in bigger format clearly.
Approva,
Awesome inputs. Thanks for the blog.
Thanks,
Ravi Katyal
Thanks Ravi
HI
A few days ago i made an extension (enhancement) to the IDOC MATMA05 , according to the steps on this forum:
https://blogs.sap.com/2015/05/06/handling-extendedcustom-idoc-in-hci-with-standard-content/
https://archive.sap.com/discussions/thread/3757209#
(I attached the WSDL generated). I was able to upload this WSDL to HCI and can make de deploy to the iflow, however when test the IDOC into the ERP, the following error is showed (monitoring by WE02 tx)
No IDoc saved in target system (SOAP HTTP)
Message No. EA391
Diagnosis
The SOAP application was started in the target system. However, errors occurred in the target system, which mean that IDocs cannot be saved.
The following error message was sent: An internal error occurred during message processing. For error details check the tail log in Integration Operations and the audit log.
Procedure
Inform your system administrator.
I make the following verifications
The result is:
I changed the path prefix having on mind that in the new generated WSDL the message name has changed to the following:
I changed the path prefix like this:
I also made the parameters.prop file modification in the iflow in HCI
And made the connection test, the result is as follows:
Someone has the same problem?
I appreciated your comments
Best regards.
This blog coupled with Abinash's blog Handling Extended/Custom IDOC in HCI with standard content is a great combination.
Thanks for this, it is really helpful. If we do the enhancements as described above we have the problem that the interface name in PI is changing, for example from CRMXIF_PARTNER_SAVE_M.CRMXIF_PARTNER_SAVE_M03 to CRMXIF_PARTNER_SAVE_M.ZCRMXIF_PARTNER_SAVE_M03.
If we would do this, the whole sender, receiver determination must be created again, due to the fact that the interface name is a kind of a key in the whole configuration.
In the integration CRM - C4C that would be a lot of work. Does anybody have experiences with this -> using extended Idoc in the C4C - PI - CRM scenario.
Kind regards
Michael
HI
A few days ago i made an extension (enhancement) to the IDOC MATMA05 , according to the steps on this forum:
https://blogs.sap.com/2015/05/06/handling-extendedcustom-idoc-in-hci-with-standard-content/
https://archive.sap.com/discussions/thread/3757209#
(I attached the WSDL generated). I was able to upload this WSDL to HCI and can make de deploy to the iflow, however when test the IDOC into the ERP, the following error is showed (monitoring by WE02 tx)
No IDoc saved in target system (SOAP HTTP)
Message No. EA391
Diagnosis
The SOAP application was started in the target system. However, errors occurred in the target system, which mean that IDocs cannot be saved.
The following error message was sent: An internal error occurred during message processing. For error details check the tail log in Integration Operations and the audit log.
Procedure
Inform your system administrator.
I make the following verifications
The result is:
I changed the path prefix having on mind that in the new generated WSDL the message name has changed to the following:
I changed the path prefix like this:
I also made the parameters.prop file modification in the iflow in HCI
And made the connection test, the result is as follows:
Someone has the same problem?
I appreciated your comments
Best regards.
Hi Leidy.
The 403 Forbidden error from SM59 is due to the certificates not correctly installed between your HCI iflow related to MATMAS and ECC landscape. Was it working earlier ?
https://answers.sap.com/questions/89857/c4c-hci-ecc-403-forbidden-error.html
Thank you very much wonderful blog which helped me achieve my requirement Inbound business activity replication from COD- CRM using Custom Idoc &message type ( CRMXIF_ORDER_SAVE) .
But In my case we need custom Idoc needed only for the Inbound Business Activity COD-CRM and we are expecting confirmation message to COD from CRM using from existing standard flow & Idoc after activity save with inbound Custom Idoc .
unfortunately am able to see 2 outbound idoc from CRM system 1) Confirmation message with Custom Idoc type and 2 ) standard Idoc which initiated because of change pointers .
Can you suggest what is best way to handle this situation ? because we are using standard Idoc in other process as well ,so Deactivating the change pointer will have impact .
Hi Nagaraju.
The sending of Idoc is controlled in Partner Profile settings. Maintain the needed message type in Partner Profile WE20. Other Place is BD64 distribution filter where you can put dummy value in filter to stop sending the Idoc.
-Apoorva
Hello Apoorva,
Thank you very much for your response . In this scanario we are dealing with Business Transaction.
In WE20 we have not maintained CNF with Custom Idoc for outbound message . we maintained only Inbound setting in WE20 for Custom Idoc.
Still we see outbound CNF message initiating when first time Inbound message reported in CRM system . At the same time outbound Standard Idoc also initiating for every Inbound update happening with Custom Idoc.
At the same time we have WE20 settings for Standard Idoc type & Message type on Inbound and Outbound .
I think BD64 settings will filter for Master data & Not for the business transaction . please correct me if am wrong.
My requirement is Inbound Idoc COD--CRM for Business Activity should happen using Custom Idoc .. Confirmation idoc CRM--COD and further updates on activity CRM--COD should happen through standard Idoc.
Reason for this requirement was we are using standard Idoc for sales quote and other business transaction replication ..
As you know Outbound Flow CRM --COD in HCI will happen through I flow order replication which has Business Activity , Opportunity , Lead and sales quote inside.
Regards
Nagaraju
I remember it now. It's been long time and i don't have access to SAP CRM system anymore so my capability to help you is limited at this point.
In your case, you have to control through BAdI, the Idoc that you don't want to send out using message type as your condition. Put a Breakpoint in the CRMXIF*map* FM to see the call stack and figure out where can you put your check to not send the Z* message type CNF idoc.
Look at below two SAP notes that should give you an idea :
822929 - ALE: Option to not send a communication IDoc
1982880 - New BAdI in XIF outbound for IDocs of the message type CRMXIF_ORDER_SAVE_M
Please mark the thread if you find this information helpful.