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 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 https://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.

New NetWeaver Information at SAP.com

Very Helpfull

User Rating: Be the first one !