In this article we will look at how to expose a RFC as a Web service in SAP PI/PO. Using SOAP to RFC synchronous interface we would be exposed a RFC as a web service.
Most commonly researched topics under third-party system integration with SAP is how to use RFCs and web services to expose SAP APIs. There are lot of confusion under exposing web services due to different third-party platforms, authentication, connection issues and different PI versions etc.
There are several ways third party applications you can access RFCs.
Directly access RFC using SAP credentials.
I have previously written a article on how to access a RFC using .NET front-end.
Exposing RFC as a web service using transaction SE37.
This can be done using SE37>Utilities>Create web service option.
Exposing RFC as a web-service using SAP Process Integration (PI/PO).
Configuration Steps How to Expose RFC as a Web Service using PI/PO.
1. Make sure your function module or the API is “Remote enabled”. – SE37
2. Import RFC to SAP PI.
Right click on RFC under imported objects under software component and provide application server/system number/user credential. Then find the RFC from the list.
3. Create input, output data types and message types which correspond to SOAP input and output data formats.
SOAP response data/message type.
4. Create message mapping for SOAP request to RFC input.
5. Create message mapping for RFC output to SOAP response.
6. Create outbound service interface.
7. Create operation mapping.
Configure Operation Mapping for request and response.
8. Create sender SOAP communication channel.
9. Create RFC receiver communication channel.
10. Create integration scenario.
11. Publish the interface under service registry.
if you have any questions on any of the steps discussed how to expose a RFC as a web service, please leave a comment.
16 thoughts on “Expose RFC as Web Service in SAP PI/PO – SOAP to RFC Synchronous Interface”
Hi Isuru Fernando,
I'm new with SAP PI, can you create step-by-step for '10. Create integration scenario.'
Hello blogger, i have to say you have high quality content
here. Keep up good work !
Hi I really enjoyed reading this article
Aw, this was a really good post. Taking the time and actual effort to create a
really good article… but what can I say… I procrastinate a whole lot and don’t seem
to get nearly anything done.
Awesome content my friend, keep updating your blog
Hi Isuru Fernando,
Can multiple systems call this Web service to use the result?!.
I have a scenario where i need to send some data from SAP ECC to E-comm sites(multiple) via Web service. All the sites will call the same Web service to get the data. Can we use this approach for that case?.
In the above steps i can see there is a Receiver communication channel, but in my scenario i have multiple receivers who are gonna use the same web service. Thanks in advance for your suggestion.
Of cause there are several ways you can handle this in SAP PI/PO. Either create separate ICOs for each consumer or use a common business component for all receivers. Make sure locking of data when multiple consumers access the same data is handled in ECC side.
I have a requirement where When a PO is created , I need to send PO data to SAP PO.For this I have created a RFC Function module in ECC. Besides the steps you have mentioned ( which have to be done in SAP PO side ) , what other steps I need to do in ECC and how can I call the web service/ proxy from my code in ECC to send data to SAP PO , when the Purchase order is created.
Kindly provide some help .
How are you planning to send PO data to PI? using iDocs or Proxy? If its a proxy have you created a custom proxy?
Hi Isuru Fernando,
I’m new to SAP PI so I’m facing while performing IDOC to FIle scenario.I got struck when configuring
logical name setting using BD54 tcode.Can you help me out to defining logical name .
Check my post on iDoc configuration scenario where I have more detail on how to create logical systems using transaction bd54.
Hope it would be helpful!
I have synchronous scenario SOAP-RFC.
This is part of PI7.3 to PI 7. 5upgrade. Its working fine in 7.but ng in 7.5.
MP: exception caught with cause com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.aii.adapter.rfc.afcommunication.RfcAFWException: error while processing message to remote system:com.sap.aii.adapter.rfc.core.client.RfcClientException: could not get a client from JCO.Pool: com.sap.mw.jco.JCO$Exception: (101) RFC_ERROR_PROGRAM: Parameter message server host (jco.client.mshost) is missing.
Any help would be really appreciated.
I have a synchronous scenario, SOAP-RFC. It is part of PI 7.3 to PO 7.5 upgrade. This scenario is working fine in PI but failing in PO. Error: MP: exception caught with cause com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.aii.adapter.rfc.afcommunication.RfcAFWException: error while processing message to remote system:com.sap.aii.adapter.rfc.core.client.RfcClientException: could not get a client from JCO.Pool: com.sap.mw.jco.JCO$Exception: (101) RFC_ERROR_PROGRAM: Parameter message server host (jco.client.mshost) is missing.
Could you please help me in solving the same.
Did you check with BASIS team if the RFC connectivity is working?
Yes thee is a RFC lookup channel and that is working fine.
Hi Isuru, how to get data back from RFC? i am able to call the RFC via PI webservice as mentioned in your blog. I call it using SOAP UI. but i am not getting the response . I have done the response mapping as shown in the OM. thanks