Skip to Content

Detailed step by step procedure for Creating Gateway Service with all the CRUD Operations and testing them in Service Explorer Part2

In the first part Detailed step by step procedure for Creating Gateway Service with all the CRUD Operations and testing them in Service Explorer Part1

I discussed the the below topic.

1.Create service in Gateway system with all the CRUD operations.(Create Read Update Delete).

Before starting, I am expecting that you are able to create gateway service or you have gone through my previous blog.In this blog i will discuss about maintaining our service and testing it in ServiceExplorer.

Our Service Name: ZBPS_MATR_DEMO_SRV.

Now we need to Activate and Maintain our service, we will do that in transaction /IWFND/MAINT_SERVICE.

     a. First we need to locate and add our service. Click on add service button.

Enter system alias and press enter. From the displayed list locate our service and click o it.

Save it in a package and click on Ok.

Select the request and click on Ok. Again click on ok. Come back and click on our service.

b. Now we need to add System alias to our service, i.e. systems with which we are going to interact.

Click on Create System alias button and enter the required system details and save the changes and come back.

Save the changes in the request.

Now we can see our system alias details.

Now we will explore our service for that click on Explore service button.

Click on Execute to get Service Document .

Service Document:  Describes the location and capabilities of one or more Collections.

Here we can check our Entity set name and we will get our Service URI.

Here our URI: http://<hostname>:<port>/sap/opu/odata/sap/ZBPS_MATR_DEMO_SRV/

Now come back and now choose Get Service Metadata option as shown below and click on execute to get the service mete data.

Now we will get our service Meta data.

Service Metadata Document (Metadata Document): Describes the data model (i.e. structure and organization of all the resources) exposed as HTTP endpoints by an OData service.

Note the URI of our service and we will use it further.

URI: http:// <hostname>:<port>/sap/opu/odata/sap/ZBPS_MATR_DEMO_SRV/$metadata

Testing Our Service.

Now we will test our service in Gateway Client transaction for that is /IWFND/GW_CLIENT.

Paste our URI in Request URI field and click on Get HTTP Method.

Check the Service Meta data.

Now we will test all the CRUD operations.


Here in URI we can pass values for key fields only.

In our example we are trying to READ Material ‘000000000000000023’ and we will do that in Gateway client.

URI: http:// <hostname>:<port>/sap/opu/odata/sap/ZBPS_MATR_DEMO_SRV/matrset(‘000000000000000023’)

Paste this URI against Request URI field in Gateway client and select HTTP Method GET and click on execute.



Query is to get multiple entries and here we can pass ranges for selection.

In our example we will try to fetch Materials within the range ‘000000000000000023’ to ‘000000000000000038’.


http:// <hostname>:<port>/sap/opu/odata/sap/ZBPS_MATR_DEMO_SRV/matrset?$filter=Material ge ‘000000000000000023’ and Material le ‘000000000000000053’

Paste this URI @ Request URI in Gateway client and select HTTP Method GET and click on execute.

Output: We will get three materials in our output   



Now we will try to create Material ‘000000000000000016’. For this first we will READ an existing material and using that XML we will CREATE desired material.

First try to READ Material ‘000000000000000023’ by using the URI same as in our READ operation in Gateway client.

Now click on Use as request button as below.

We will get same XML in HTTP Request Body. Make require changes in that for Material creation. Here we need to select HTTP Method POST for CREATE operation and we need to change URI as below.


http:// <hostname>:<port>/sap/opu/odata/sap/ZBPS_MATR_DEMO_SRV/matrset


UPDATE: Now we will try to UPDATE the Material just we have created through CREATE operation.

Do the same steps as in create operation, first read the Material ‘000000000000000016’ through READ operation and by using that xml as a Request we will try to UPDATE Material Group of that Material.

URI: http:// <hostname>:<port>/sap/opu/odata/sap/ZBPS_MATR_DEMO_SRV/matrset(‘000000000000000016’)

Here MatlGroup is 00108, we will update that to 00107 and we will verify it through READ operation.

Click on Use as Request and make the necessary changes to the XML as below and select the HTTP Method PUT for Updating and click on execute.


<?xml version=“1.0” encoding=“utf-8”?>
<entry xml:base=
http:// <hostname>:<port>/sap/opu/odata/sap/ZBPS_MATR_DEMO_SRV/” xmlns=>
<content type=
<d:MatlDesc>Test material gateway</d:MatlDesc>


Now we will check that whether that Material is updated or not by using READ operation. Select the HTTP Method GET and check the output.


Now we will try to DELETE the Material which we have created, for this we use HTTP method DELETE.

Here to delete the Material we will just set the Delete Flag to ‘X’. First we will read that material and using that xml as a request we will process Delete operation. Here we will select HTTP method DELETE and execute it after modifying xml.


<?xml version=“1.0” encoding=“utf-8”?>
<entry xml:base=
http:// <hostname>:<port>/sap/opu/odata/sap/ZBPS_MATR_DEMO_SRV/” xmlns=>
<content type=


With this we have completed all the CRUD operations.

You must be Logged on to comment or reply to a post.
  • Very Useful Stuff. I proceeded same way to test Material Master & it almost worked well.

    But I have an issue when I execute the QUERY operation. I get the Status Code as 200, which is OK; but materials are not listed in the output.

    Any idea about why is it happening..??

    One point to be noted:

    Query in the thread goes like this:

    ?$filter=Material ge ‘000000000000000023’ and Material le ‘000000000000000053’

    It is giving technical issue for me. So, I am using ‘E’ in place of sign ‘=’.

  • Hi Nagesh,

    I tried all the above steps and its working fine.I tried another method by redefining DPC_EXT and MPC_EXT and i used a custom functional module with TABLE’s as input and output.I passed my input through XML payload in gateway client.I am not sure whether the method i used is proper or not.And i also would like to know a method to do the same thing using GPA.



  • Hi Nagesh,

       Thank you very much for the  stuff.  i have  followed the same scenario it is working fine  in development system  but i was getting problem in Quality system with RFC .

    Failed to connect using the specified RFC destination .

    Example :

    i have created  project in SEGW tool in SAP Net weaver Gateway  in Development system with  rfc destination  (DEV_100) and moved to quality system , but the rfc destination DEV_100 is not there  in Quality system . and getting error  as

    ‘Failed to connect using RFC destination DEV_100’.  How can i resolve this issues …

    Failed to connect using the specified RFC destination .

    do i  manually  create the mapping  again  with giving the new rfc in Quality system ? Please suggest .

  • Hi,

    It’s Perfectly working in tables….please anyone say me how can i work with structure or fields…I got ‘No Output Table is Mapped in the query operation’ error….

    Thank you.

  • Hi Nagesh,

    In Create can we have an internal table(Multiple rows) as input if my FM have internal table as input.

    (I used to do create deep entity for multiple rows as input).



  • Hello Nagesh,

    Thanks!!, really nice documentation and easy to follow . without any failure I was able to  create Gateway service with all CRUD operations and it’s working fine 🙂 🙂 🙂

  • I am getting below error for CREATE operation. Can someone help? Please tell the steps that I need to perform as I have not much experienced with basis. Thanks.


    <?xml version=”1.0″ encoding=”utf-8″?>

    <error xmlns=”“>


        <message xml:lang=”en”>You have not fully maintained the descriptions</message>






                    <message>You have not fully maintained the descriptions</message>






                    <message>You have not fully maintained the descriptions</message>






                    <message>You have not fully maintained the descriptions.</message>







    • Hi Hardik,

      You need to pass the value for Langu as ‘E’ and LanguIso as ‘EN’ in Payload else the BAPI throws the above error “You have not fully maintained the descriptions”.


  • Great it’s working fine. really good job. Similarly i am trying for ‘BAPI_SALESORDER_CREATEFROMDAT2’ i am getting errors 🙁

    please Guide how to do with this BAPI.



  • Hi,


    Thank you for this tutorial.

    I have a question.


    I want to pass a table to my RFC as a create entry (POST).

    How do I do it ?