SAP S4H (IDOC) to SAP CPI – Inbound IDoc Interface

Hi SAPiens,

Below blog explains the steps required to establish the communication between SAP CPI and  on-prem S4Hana. This is for inbound IDoc interface and for demo purpose I am using mail as receiver.

Topics will be covered –>

  1. System Connection between S4H and CPI
  2. Background Configurations required
  3. Configure Idoc Sender Adapter
  4. Search messages in message monitoring based on Idoc Number

To be able to send messages from SAP S4Hana to SAP CPI import CPI certificates in S4Hana STRUST. You can download CPI certificates either from keystore or from any browser.

  1. Login to S4hana system –> Tcode STRUST (Import all 3 CPI certificates) –> Add to Certificate List
  2. Create Logical System for S4H and CPI system in Tcode BD54
  3. Create RFC Destination of Type G –>Host = CPI Tenant, Port = 443, Path Prefix = from Sender Adapter (CPI – IFlow); Logon & Security
  4. RFC Connection test returns HTTP 500 response
  5. Create Port WE21 –> Port Type –> XML HTTP
  6. Partner Profile WE20 –>
    1. Import Outbound Message type with port created in earlier step
  7. In the Custom IFlow, give the same path prefix as given in RFC Destination IDoc Adapter Configuration –>
  8. In-order to be able to search my Iflow in monitoring based on Idoc number, I have configure Content Modifier with Header Values I am using Headers –> SapIDocDbId, SapIDocTransferId, SapIDocType in my mail body and created SAP_ApplicationID to pass Idoc Number from payload which will help me to monitor messaged based on Idoc Number. Value for SAP_ApplicationID is Xpath of my Idoc DOCNUM
  9. Configure Mail adapter and deploy IFlow
  10. Trigger IDoc in S4Hana, WE02 –>
    1. Status = 03 –> Idoc Triggered to CPI
    2. Status = 02 –> Check Iflow status in CPI
  11. CPI –> Message Monitoring
  12. Mail Received Successfully

Thank you,






Original Article:

Related blogs


Please enter your comment!
Please enter your name here