Skip to Content

Hi All,

This is my first blog.

This is a step by step example of how to consume RFC function module as REST Service using GET operation.

System: SAP PI 7.4

This example will follow this workflow:

3rd Party System <-> PI RESTAdapter (JSON) <-> PI Mapping (XML) <-> PI RFC Adapter(XML) <-> SAP R3

Bussiness Case Description

A 3rd party system consumes a REST service which published in SAP PI to get the company name and the city.

Scenario – We are going to pass Company Code(BUKRS) as a parameter (GET operation) and get the Company Name and City as output.

  1. Import the Function Module to ESB.

 

  1. I used external definitions as data types.

 

  1. Create Service Interface. Use External Definitions for the Request and Response.

 

  1. Create Message Mapping for Request and Response.In Request Mapping Add Custom Function.
  • I have added function named getBUKRS with two parameters which named namespace and attribute.
  • Added following code into the function body.(This function is usnig for extract the parameter from the URL)

 

                  Map<String, Object> all = container.getInputHeader().getAll();
                 DynamicConfiguration dynConf =              (DynamicConfiguration)all.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
                 DynamicConfigurationKey key = DynamicConfigurationKey.create(namespace, attribute);
                 return dynConf.get(key);
  •                                
  • Map Request as following. Pass http://sap.com/xi/XI/System/REST and “id” for the constants.

  • Map the response.

  1. Create Output Mapping.

  1. Go to Integration Builder and create receiver and sender communication channels.
  • Receiver-

               

  • Sender-

      

 

   

 

 

 

  1. Create Integrated Configuration.

 

 

 

  1. Test using SOAP UI.

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply