-
Notifications
You must be signed in to change notification settings - Fork 1
Service Layer
The Service Layer is responsible for exposing projection views (root and child entities) as OData services. This enables external applicationsโsuch as SAP Fiori apps and third-party systemsโto interact with the Fleet Management application in a standardized way.
The Service Definition specifies which projection views are made available to consumers as part of the OData service.
@EndUserText.label: 'Service Definition -- Fleet MGMT -- Projection Views'
define service ZAKS_SD_FLEET_MGMT {
expose ZAKS_P_ROOT_VEHICLE as Fleet;
expose ZAKS_P_CDS_TRIP as Trip;
expose ZAKS_P_CDS_MAINTENANCE as Maintenance;
}What this does:
-
ZAKS_P_ROOT_VEHICLEis exposed as theFleetentity set. -
ZAKS_P_CDS_TRIPis exposed as theTripentity set. -
ZAKS_P_CDS_MAINTENANCEis exposed as theMaintenanceentity set.
The Service Binding connects the service definition to a protocol and scenarioโin this case, to OData V2 โ UIโto make the service consumable by applications.
-
Service Binding Name:
ZAKS_SB_FLEET_MGMT -
Service Definition Used:
ZAKS_SD_FLEET_MGMT - Binding Type: OData V2 โ UI
Once the service is published, the following entity sets and associations are available in the OData service:
-
Fleet
-
to_Maintenance(1:n composition: Vehicles to Maintenance records) -
to_Trip(1:n composition: Vehicles to Trip records)
-
-
Trip
-
to_Vehicle(n:1 navigation: Trip back to Fleet)
-
-
Maintenance
-
to_Vehicle(n:1 navigation: Maintenance back to Fleet)
-

- Test the OData service using the endpoint:
/sap/opu/odata/sap/ZAKS_SB_FLEET_MGMT
(Try in a browser, in Postman, or using SAP Gateway Client) - Use the Preview feature in Eclipse ADT to validate entity sets and navigation.
- Generate a Fiori Elements app using this service binding for rapid UI development.
With this setup, your Fleet Management System is ready for seamless consumption by SAP Fiori Elements and external clients via OData!