Skip to Content
Author's profile photo Former Member

How to create Gateway service for query operation using ABAP Development Workbench

Introduction :

In this document you will learn how to create a gateway service using ABAP development workbench for a query type RFC.

Steps included in the creation are :

1. Creation of Gateway Data Model.

2. Creation of Query Operation.

3. Creation of Gateway Consumption Model.

4. Adding an Alias to the service.


1. Firefox Rest client Plugin to test the gateway service.

2. Access to a configured Gateway 2.0 SP3+ system.

Step 1 : Go to Transaction SE80. Set the object type drop down to GW Data Model and in Object name input field enter the name ztest_po_item_details.   

Click on the eye glasses button to create the data model. This Gateway data Model maps the Service to business data.


Click on the Yes Button.

Step 2 :  Choose meta model Type as ‘PS’ (Public Solution Model)  and select the option as “Generate from Data Source Object” using radio button. Click on continue button.


Step 3 : Enter a suitable Description. Enter Data Source Type as RFC and  the System Alias (this is the alias that is connected to the back end system). Click on Continue button.


Step 4 : Enter your package name or save as a local object.


Step 5 : Click on Search button. Enter RFC name and click on continue button. (Here we are using a simple custom RFC with one input parameter for PO number and 1 output table with PO Item details)


Step 6 :  Select the added RFC object in left hand side by clicking on it and then click on create Mapping button.


Step 7 : Select the operation type as Query so that all the attributes of FM get displayed.


Step 8 : Now the Input attribute ‘i_ebeln’ needs to be set. We can either set some constant value or we can expose it as filterable value in the following way. To Change  mapping of input parameter I_EBELN, Click on Initial and then select Change Mapping Route. Then select the i_ebeln parameter from the pop up screen and click on Continue button.


Step 9 :   In Data Model details set key property for required fields by right clicking on attribute and selecting set key property.


Step 10 : To save the Data Model click on Generate button which will also generate all of its corresponding classes and configuration.


Step 11 : Click on Object Navigator Button. Right click on “Related GW Consumption model” and click on Add Consumpt. Model.The Consumption Model is what exposes the Gateway Data Models to the network.


Step 12 :  Enter a name for Consumption model and Continue.


Step 13 :  Click on Yes Button to create the Consumpt. Model.


Step 14 : Enter Description and Click on Continue button.


Step 15 : Go to Transaction /IWFND/MAINT_SERVICE and click on search button. Enter the Technical Service name and search. Then Click on the Service.


Step 16 : Click on Create System Alias button.


Step 17 : Click on New entries button. Enter the name of your Consumption Model and click on F4 Button.Then Double click on your service document in the popup window. In the System Alias column enter the alias of the system you want your service to call.        


Save your changes then hit the back button.

Step 18 : Click on Call Browser Button to launch a web browser for OData Service.



Step 19 : For example the url generated is :$format=xml

Now replace the end of url “?$format=xml” with “$metadata” .


Step 20 : Now replace “$metadata” with entity set name which is “ztest_po_item_detailsCollection” in our case, followed by ” ?$filter=i_ebeln eq ‘3000000006’ ” which is a way to pass input parameter to query operation.


N.b. This technology is highly outdated, this article was put up for learning purposes only.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Krishna Kishor Kammaje
      Krishna Kishor Kammaje

      You should be using "OData channel" approach instead of the old approach mentioned here.

      Author's profile photo Uday M
      Uday M

      Hi , "OData Channel" means using the transaction SEGW ?

      Author's profile photo Krishna Kishor Kammaje
      Krishna Kishor Kammaje


      Author's profile photo Starlet Abraham
      Starlet Abraham

      Thanks so much for this article.

      Much appreciated.!

      Author's profile photo Former Member
      Former Member

      Informative Document.

      Author's profile photo Andre Fischer
      Andre Fischer

      The technology desribed in this document is not the one which is recommend to be used any more. It's rather recommend to use the Service Builder as described

      How to Develop Query
      Options for an OData Service Using Code-Based Implementation

      Author's profile photo Former Member
      Former Member

      Seconded, incredibly out of date 🙁