Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
rasjoshi
Active Contributor
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,

Rashmi

 

 

 

 
16 Comments
Gud one Rashmi...keep it up...keep sharing such informative docs...
parimal_sarage
Explorer
Very Nicely explained with every single detail ?.

It will really helpful for the initial phase for a developer ?.

Thanks for Sharing.

sinhasouvik
Participant
Helpful blog.

Thanks for sharing.
KeshavDesai
Explorer
0 Kudos
Good write up Rashmi.

This however means, for each IDOC type thats flows from S4H to CPI, a separate Type G connection will have to be created [/cxf/matmas or /cxf/debmas....] in SM59. Thats a lot of SM59 connections.

One could possibly mitigate this by having a generic routing iFlow [/cxf/idoc and thereby having only 1 SM59 connection for IDOCs to this CPI iFlow] and then making process direct calls to individual iFlows processing different IDOC types, depending on field values in the control segment.

It would be ideal though, if SAP could build something on S4H, which would allow specifying a generic path prefix [/cxf/idoc/<idoctype>] in SM59 connection [so that there is one connection, like in tRFC port for IDOCs between ECC and PO ] and dynamically route the calls [?] to the iFlow endpoints  [ /matmas or /debmas... maintained in Connection of respective iFlows] from S4H.

Do share your thoughts on this or if there is an alternative way already.

Thanks.

Keshav Desai
rasjoshi
Active Contributor
0 Kudos
Hi Keshav,

 

Yes your understanding is correct. However, you can make a generic RFC destination capture idocs in CPI and then using process direct can push to the next steps.

 

BR,

Rashmi
rcsegovia
Active Participant
Hi Rashmi, good article but nothing new from https://blogs.sap.com/2016/08/11/hcihcp-isidoc-adapter-deciphered-part-4-trigger-idoc-from-hci-to-sa...

At least you can added like reference in your post.

 

 
former_member678218
Discoverer
Nicely explained Rashmi. Easy to understand with all required explanation
bharathsai_r
Explorer
Adding this for other's reference.

In case anyone faces an error of 'Server certificate does not match supplied TargetHostname', 'SSSLERR_SERVER_CERT_MISMATCH' while following this blog, please follow the steps in below blog to fix it.

https://answers.sap.com/questions/13020758/backend-ecc-connection-to-cpi.html
SushantShinde
Advisor
Advisor
0 Kudos
Hi Rashmi,

 

What credentials are getting used in Basic authentication in G type RFC?.

BR,

Sushant
rasjoshi
Active Contributor
0 Kudos
Hi sushant2610

Its CPI credentials.

 

Regards,

Rashmi
0 Kudos
Awesome Blog.

Thanks
pi_satishb
Explorer
0 Kudos
Hello Rashmi,

 

Apart form from the content modifier in Iflow, I have followed your steps mentioned above and configured the scenario but getting error as staus 02 in we02.

 

However, my iflow has deployed successful.

Regards,

Satish

ramanak
Explorer
0 Kudos
Hi Rashmi,

If I maintain my user in the destinations and they will fail when I left my company.

I have a small question, do we have a specific user for connecting CPI from S4Hana/ ECC which can be used in Destination?

 

 
saurabhkumbhare
Active Participant
0 Kudos
Hi Rashmi,

 

Which CPI credentials are used? From security material or service key (I.e. Clientid and clientsecret)?

 

Thanks

Saurabh
riaankumbhare
Explorer
0 Kudos
Going forward for Cloud Foundry, we should use Certificate based authentication only.Client ID and Client Secret based authentication is not recommended (Except for testing from Postman purposes ).

 

Unfortunately, Rashmi has not provided what certificates does CPI need to have. I will be writing a more detailed blog if people require.

 

Thanks

Saurabh
sujatha11
Member
0 Kudos
Hi Saurabh,

What are the certificates we need to provide for getting connection from S4HANA to CPI. If sender

adaptor is IDOC means.

Can you please help me how to configure IDOC adaptor for sender side.

 

Regards,

Sujatha
Labels in this area