Show TOC

Preparing OData ServicesLocate this document in the navigation structure

You access the back-end system information using OData services. Smart templates support OData version 2 with vocabulary-based annotations.

The qualities that your service requires depend on the template you are using and how you want to use it, for example, whether it is read-only or editable. If it is editable, your service must support create, read, update, and delete (CRUD) operations and draft document handling.

Implement additional actions that must be supported as part of your OData service. If the data is represented in a list page, $count must be supported as well as $filter (for all filterable properties).

Creating a New OData Service
The easiest way to create a new OData service in an ABAP back-end system is to establish a Core Data Services (CDS) consumption view and generate the OData service from this view (data-source driven service creation). Combined with Service Adaptation Description Language) (SADL) this provides the following advantages:
  • CRUD request handling is covered by a Business Object Processing Framework (BOPF) model that can be implicitly generated and controlled by the following annotations:
    @ObjectModel.writeEnabled: true
            @ObjectModel.writeDraftPersistance: '<BO name>' 
  • Locking is handled by BOPF (implicit lock with modification requests)

  • Paging is implicitly handled by SADL

  • Draft document handling is implicitly covered if @ObjectModel.writeDraftPersistance is specified. However, you must also specify annotations, as defined in the draft specification.

For more information, see the SAP - ABAP Programming Model for SAP Fiori.

As an alternative, SADL support is also available in the SAP Gateway Service Builder (transaction SEGW).

This option is described in detail in Generating an OData Service Based on a Referenced Data Source.

More Information