Key Steps and Development Tools
The development of a SAP Fiori application starts with the data modelling phase. The back-end developer uses ABAP in Eclipse to build ABAP CDS sources. Using appropriate annotations (odata.publish: true) the back-end developer registers the OData service in the back end and publishes it to the SAP Gateway Hub system using transaction /IWFND/MAINT_SERVICE. The published service is finally taken by the UI developer that uses SAP Web IDE to generate a user interface.
Please note that for standard UI's Fiori elements generates the complete UI, so that no coding is required.
CDS views are the next generation data definition and access for database centric applications. CDS views provide a cross-platform unified abstraction layer - similar to OData for UI abstraction. For SAP S/4HANA ABAP CDS views are used. Using CDS views provides a maximum transparency for different programing models. CDS views integrate with platform lifecycle-management. ABAP CDS views provide a consistent Lifecycle Management and extensibility as with all other ABAP artifacts and are transported using the correction and transport system.
CDS Development Environment
It offers textual and graphical editors and a rich feature set for fast development:
In the following we will show what options you have to leverage CDS views when creating OData services starting with SAP NetWeaver 7.40.
OData Service Development with CDS
There are three options to leverage CDS views in an OData service development in SAP Gateway. The options are as follows:
SAP Fiori Programming Model — SAP NetWeaver 7.0
With SAP NetWeaver 7.0 or later, it is possible to use SAP Gateway to build OData services that access arbitrary business data through existing frameworks (function modules, RFC, BAPI, SPI…).
As we have learned, this can either be done through service development or through service generation.
SAP Fiori Programming Model — SAP NetWeaver 7.4
With SAP NetWeaver 7.40 or later, it is possible to use SAP Gateway for building OData services that read access to CDS objects.
Use CDS views as mapped data sources, it is no longer necessary to use coding for read access.
Requests that perform changes can be implemented using code based implementation of the CREATE, UPDATE, and DELETE method of the DPC_EXT class.
SAP Fiori Programming Model — SAP NetWeaver 7.51 SP1
As of SAP NetWeaver 7.51 SP1, the so called draft engine is supported that leverages BOPF objects. The BOPF objects are generated based on appropriate annotations in the CDS view and have to be implemented using code based implementations in order to call existing APIs to perform change requests to the business data.
In addition, code based implementation can be used to call existing custom code or if CDS views are not suitable to solve the business scenario. Code based implementation can also be used to implement create, update, and delete requests in 7.50 with referenced data source implemented services where no draft is supported.