Quantcast
Channel: SAP Gateway
Viewing all articles
Browse latest Browse all 253

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

$
0
0
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 GWPA components.
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.
     2.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:
     1.jpg
     Import Entity type for header from RFC Function Module
     4.jpg
Select required fields and mark EBELN as Key field.
     5.jpg
Import Entity type for Items from RFC Function Module
1.jpg2.jpg

     Create Entity Sets:

     Mark entity set's as Addressable.

3.jpg

 

Create Association to navigate from Header to Items data:

4.jpg

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

5.jpg

6.jpg

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

7.jpg

9.jpg

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

10.jpg

 

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

1.jpg

 

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

2.jpg

3.jpg

 

Save and Activate the project.

 

Maintain service - Goto Transaction code: /IWFND/MAINT_SERVICE

Add service:

4.jpg

  Select service and add system aliases.

5.jpg

   3. Test our service in 'Service Explorer':

6.jpg

1.jpg

2.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

3.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 with GWPA Part 2, we will see how to Create Application in Eclipse and testing on Simulator.

 

 


Viewing all articles
Browse latest Browse all 253

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>