Skip to content

Service Layer

Ankit Kumar Singh edited this page Sep 9, 2025 · 2 revisions

๐Ÿš€ 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.


๐Ÿ“Œ Service Definition

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_VEHICLE is exposed as the Fleet entity set.
  • ZAKS_P_CDS_TRIP is exposed as the Trip entity set.
  • ZAKS_P_CDS_MAINTENANCE is exposed as the Maintenance entity set.

๐Ÿ”— Service Binding

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

๐Ÿ“‚ Entity Sets & Associations

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)

๐Ÿ“ธ Service Binding Screenshot

Service Binding


โœ… Next Steps

  • 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!


Clone this wiki locally