This guide explains how to get started with OData Channel quickly on the basis of an SFLIGHT example. The tasks which need to be done first to get an OData Channel application up-and-running are described. The basic steps focus on two classes:
Runtime /IWBEP/CL_MGW_RT_SFLIGHT (delegates the runtime methods to inner classes)
The SAP Gateway application in this guide is based on the SFLIGHT demo scenario and gives you a step-by-step guidance to create a simple OData application which returns a list of flights and carriers from the backend. The main points are as follows:
Flight and carrier entities are used
The flight entity is enriched with complex type for flight details
Association are used to connect flight and carrier
The navigation property is used to navigate from a flight to its carrier
The navigation property is used to navigate from a carrier to its flights
Function imports are used to retrieve all flights from a specific city
Proceed as follows:
For your information you can find several copy-and-paste code snippets as example implementation under 3 Code Snippets.
A more sophisticated SFLIGHT demo scenario is part of the SAP Gateway standard shipment in package /IWBEP/MGW_SAMPLE_SFLIGHT in your backend system. All CRUD methods are supported. You can find the implementation in the following classes:
/IWBEP/CL_MGW_MED_SFLIGHT for the metadata.
/IWBEP/CL_MGW_RT_SFLIGHT for the runtime. This class delegates the runtime methods to inner classes.
For the enhanced SFLIGHT model the technical service name is /IWBEP/RMTSAMPLEFLIGHT_2 and the external service name is RMTSAMPLEFLIGHT_2.
You can find general information on the SFLIGHT model in the SAP NetWeaver documentation about Flight Model.