Skip to Content
Author's profile photo Sheetal Reddy Proddutur

Steps to create custom Gateway service and Android application through Eclipse Part 1

Below are prerequisites before starting development of Gateway service and Android application.
–>. ECC system (Backend system)
–>. Gateway system
–>. RFC connections defined between above two systems.
–>. Eclipse with gateway plugin installed.
Here i am expecting that all the connections between two systems are in place and all the components that are required are installed in Eclipse. Most of the installation steps are already posted in SCN.
Below are steps i will discuss in my blog:
1. Create a custom RFC Function Module to get PO header and item details. ( Developed in Backend system)
2. Create service in gateway system using above RFC Function Module.
3. Test our service in ‘Service Explorer’.
4. Create Application in Eclipse and testing on Simulator.
1. Create a custom RFC Function Module to get PO header and item details. ( Developed in Backend system)
      In this function module i am using FLAG variable to get data separately for header and items.( I am using same function module for both Header & Item      Entity sets)
     As there is no filter on PO number, i am getting only first 50 records.
     /wp-content/uploads/2013/11/2_313054.jpg
      You can get sample code in the attached file.
2. Create service in gateway system using above RFC Function Module.
    Create New Project in SEGW:
     /wp-content/uploads/2013/11/1_313076.jpg
     Import Entity type for header from RFC Function Module
     /wp-content/uploads/2013/11/4_313078.jpg
Select required fields and mark EBELN as Key field.

     /wp-content/uploads/2013/11/5_313082.jpg

Import Entity type for Items from RFC Function Module
/wp-content/uploads/2013/11/1_313076.jpg/wp-content/uploads/2013/11/2_313054.jpg

     Create Entity Sets:

     Mark entity set’s as Addressable.

/wp-content/uploads/2013/11/3_313088.jpg

Create Association to navigate from Header to Items data:

/wp-content/uploads/2013/11/4_313078.jpg

HEADER -> Map to Data source (GetEntity – Read)

/wp-content/uploads/2013/11/5_313082.jpg

/wp-content/uploads/2013/11/6_313091.jpg

HEADER -> Map to Data source (GetEntitySet – Query)

/wp-content/uploads/2013/11/7_313092.jpg

/wp-content/uploads/2013/11/9_313095.jpg

ITEMS -> Map to Data source (GetEntity – Read)

/wp-content/uploads/2013/11/10_313096.jpg

As we are using single RFC to get both Header and Item details, we are using flag to distinguish Header and Item.

/wp-content/uploads/2013/11/1_313076.jpg

ITEMS -> Map to Data source (GetEntitySet – Query)

/wp-content/uploads/2013/11/2_313054.jpg

/wp-content/uploads/2013/11/3_313088.jpg

Save and Activate the project.

Maintain service – Goto Transaction code: /IWFND/MAINT_SERVICE

Add service:

/wp-content/uploads/2013/11/4_313078.jpg

  Select service and add system aliases.

/wp-content/uploads/2013/11/5_313082.jpg

   3. Test our service in ‘Service Explorer’:

/wp-content/uploads/2013/11/6_313091.jpg

/wp-content/uploads/2013/11/1_313076.jpg

/wp-content/uploads/2013/11/2_313054.jpg

    Here we will get first 50 PO’s, as we are using UPTO 50 rows in our FM and we are not specifying any condition in URI.

    You can see sample data from the attached ‘PO Header Data’ file.

    Use Filter to get PO details: (Header & Items)

    POHeader/?$filter=(Ebeln eq ‘3000000191’)&$expand=PONavigation

/wp-content/uploads/2013/11/3_313088.jpg

     You can see sample data from the attached ‘PO Header & Items’ file.

In the second part Steps to create custom Gateway service and Android application through Eclipse Part 2, we will see how to Create Application in Eclipse and testing on Simulator.

Assigned Tags

      5 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Tom Krutis
      Tom Krutis

      Thank you for this blog, very helpfull.

      Author's profile photo Rakshit Doshi
      Rakshit Doshi

      Hi Sheetal,

      What steps did you follow to enable subscription and notification collection on your segw project based odata service?

      Thanks,

      Rakshit Doshi

      Author's profile photo Sheetal Reddy Proddutur
      Sheetal Reddy Proddutur
      Blog Post Author

      Hi Rakshit,

      Try to check this blog : http://scn.sap.com/thread/3451972

      Thanks,

      Sheetal Reddy

      Author's profile photo Former Member
      Former Member

      Hi Sheetal,

      Very helpful blog.

      I have a query here. At the time of field mapping for service implementation, you have mentioned the RFC destination there. I hope its Dev front end to Dev back end system. How will we handle this when we are moving this to Quality system? Should we have the same RFC destination name in Quality systems?

      Regards,

      Lijo John.

      Author's profile photo Former Member
      Former Member

      Hi Sheetal,

       

      Can please attache your Function module code .

       

      I have tried same with sales order with multiple in put parameters and Header and item Entities but not getting the navigation values, Individually it is showing the values ( I.e both entities ).