After installing a SAP NetWeaver Gateway system, you’ll want to play around with a OData service. One option is to create everything from scratch; another option is to use a sample service that serves as a basis for learning. SAP NetWeaver ABAP comes with the flight sample, and to no surprise, SAP Gateway comes with a sample OData service based on the flight sample. To maintain a service, transaction /IWFND/MAINT_SERVICE is used. It shows a list of available services:
Adding the service
After a fresh SAP Gateway installation, the flight sample service won’t be listed. The service is already installed, but is not visible in the service catalog. To add it, select the Add Service option: This brings up the Add Selected Services screen.
The get a list of services, first inform the system alias. In my case, I created before in SPRO an alias named GWD for my Gateway system.
Then, click on Get Services: . The brings up the list of services available in the system
The OData service for the flight data is RMTSAMPLEFLIGHT or RMTSAMPLEFLIGHT_2. Select the services you want to add and click on Add Selected Services.
Confirm the following dialog
This will load the service. After everything was done successfully, you’ll hopefully see the following information:
Back at the Activate and Maintain Services transaction shows that the RMTSAMPLEFLIGHT service is added.
Test the service
Click on the service name. This will change the lower section of the screen.
To test the service, click on Gateway Client: . This will open the SAP NetWeaver Gateway Client.
Note that in the Request URI field the service URI is already inserted: /sap/opu/odata/IWFND/RMTSAMPLEFLIGHT/?$format=xml
To see of the service works, just execute a GET request. This should bring back the service description.
To retrieve data from a specific collection, click on Entity Sets: . Select an Entity Set (Collection)
This will set the URI parameter accordingly.
The information returned by the entity set can be used to retrieve the information of a specific flight. Part of the returned XML is an entity, that contains an URL like this: