You are on page 1of 6

Configuration Settings: while accessing SAP NETWEAVER gateway server :

--------------------------------------------------------------------------

In your operating system :

goto below path :

C:\Windows\System32\drivers\etc

open Hosts file and

Add the below entry


______________________________________
117.218.22.191 stfiorisrvr.st.com
______________________________________
save

Note : For Testing gateway services , our server should be enabled with below
pattern

HOSTNAME.DOMAINNAME.EXTENSION
-------- ---------- ---------
________________________________________________________________________________

Developing ABAP Gateway service using BAPI/RFC

There Are ways:

1) BY Directly using MAPPING Technique:


2) BY Implementing COde
___________________________________________________

Before Developing ABAP Gateway service using BAPI?RFC ,

first Recognise the Parameters of BAPI/RFC.

which para Import, ?

which para Export ?

which para TABLES ?

Recognize the business functionality of BAPI/RFC


_________________________________________________________________________________
Step by STEP Procedure of Service development using BAPI_FLIGHT_GETLIST
_________________________________________________________________________________

goto segw tcode :

Create ZBAP_FLIGHT_PROJECT

save it in package

Right click Model


IMport from RFC/BOR option

Provide ENTITY TYPE NAME = FLIGHT

TYPE = REMOTE FUNCTION CALL

BAPI NAME = BAPI_FLIGHT_GETLIST

Select Default ENTITYSET


----------------------------
Click next option

Chose FLIGHT_LIST option

chose required Fields

Click NEXT

Chose Airlineid as KEY FIELD

Click on Continue

_________________________________________________________
NOTE : PROPERTIES are known As FIELDs of "ENTITY TYPE"
__________________________________________________________

save

Provide ENTITY TYPE as "FLIGHT"

provide ENTITY SET as "FLIGHTSET"

save

___________________________________________________________________________________
___________

Note : FLIGHTSET is ADDRESSABLE : means Frontend Application can recognize this


entityset
___________________________________________________________________________________
___________

NOTE : After generating ENTITYSET , automatically below options are generated :

CREATE 1
DELETE 1
UPDATE 1
GETENTITY 1
GETENTITYSET N
____________________________________________________

Now
MAintain MAPPING FOR INPUT and OUTPUT with BAPI_FLIGHT_GETLIST
________________________________________________________________________
expand service implementation,

expand FLIGHTSET
right click GETENTITYSET option

MAP to data source

Provide REMOTE FUNCTION CALL

provide BAPI NAME = BAPI_FLIGHT_GETLIST

Add Airlineid field

Click on "PROPOSE MAPPING " with FLIGHT_LIST of BAPI ( OUTPUT )

chose Airlineid , and drag drop Airline Field from BAPI ( INPUT )

save

________________
check syntax errors;
_____________________

Click on Generate "RUNTIME OBJECTS"

click continue
save

_______________________

NOTE : ALL RUNTIME CLASSES are generated automatically ,


And the code is implemented based on the "MAPPING which we maintained"
---------------------------
________________________________________________________________________________

Register and Maintain THE GATEWAY service inside GATEWAY HUB


--------------------------------------------------------------
Expand Service MAINTAINENCE folder

double click SAP_UI5

Click on REGISTER option

chose System ALIAS as "LOCAL"

Provide Service NAME = <PROJECTNAME>_SRV ( THis is the name of service shud be


used by front END apps )

chose package/local object

click on Continue

Click on MAINTAIN option

__________________________________________________________
NOTE : You can activate / deactivate /delete the service
__________________________________________________________
TESTING Procedure :
-----------------------

click on NW "Gateway Client "

To get the Technical details of service , Mainly "Complete URL of THAT Service"

/sap/opu/odata/sap/ZBAPI_FLIGHTS_PROJECT3_SRV/?$format=xml

and execute
______________________________________________________________

To get All records :

/sap/opu/odata/sap/ZBAPI_FLIGHTS_PROJECT3_SRV/FlightSet

and Execute
______________________________________________________________
To fetch records based on INput option

/sap/opu/odata/sap/ZBAPI_FLIGHTS_PROJECT3_SRV/FlightSet?$filter=Airlineid eq 'DL'

and execute ;
______________________________________________________________

To get count of Records :

/sap/opu/odata/sap/ZBAPI_FLIGHTS_PROJECT3_SRV/FlightSet/$count

and execute
_____________________________________________________________
To display few columns :

/sap/opu/odata/sap/ZBAPI_FLIGHTS_PROJECT3_SRV/FlightSet?$select=Airline,Price

and execute
__________________________________________________________________________
To get records in JSON format :

/sap/opu/odata/sap/ZBAPI_FLIGHTS_PROJECT3_SRV/FlightSet?$format=json

and execute
____________________________________________________________________

JSON = JavaScript Object Notation


____________________________________________________________________
to display first 2 records only :

/sap/opu/odata/sap/ZBAPI_FLIGHTS_PROJECT3_SRV/FlightSet?$top=2

and Execute
_________________________________________________________________

NOTE :
For TEsting Purpose :
we can also use the REST CLIENT Editor from MOZILLA FIRE FOX :
__________________________________________________________________
REST Client is alternative for GATEWAY client
__________________________________________________________________

You might also like