Getting started with SAP Fiori and OData on local SAP ABAP Developer Edition VM

    I continue developing the OOpenFriend project and the next step should be the first fiori elements list page for accounts as proof of concept. But does my local developer environment support fiori at all?

Lets clarify this. From the OpenSAP course we can get following architectural overview

Fiori Architectural Overview

Fiori elements app need OData services to work, so we need to implement OData services first. And also I need SAP Gateway, where these OData services may be placed and run. OData services may be developed in Cloud using CAP and on-premise using RAP - ABAP RESTful Application Programming Model. Lets take a look on requirements of RAP and here is the first problem:


 We need Application Server ABAP 7.55 SP03, but I have only ABAP 7.52 SP04 on my developer edition VM. And there is no later versions of ABAP Server VM on SAP Trials and Downloads since 2018, so I suppose later versions will be avaiable in Cloud only. 

    Okey, lets use, what we have. There must be another way to implement OData service in ABAP 7.52. And yes, there is one. If we look on evolution of RAP:



    The predecessor of RAP - ABAP Programming Model for SAP Fiori should be supported on my system.
Nice, that no HANA DB is required as I have only ASE DB.
    Actually after adding additional roles to my user I may start with creation of first data definition object - CDS View. But can I create CDS Views on non HANA DB? The answer is yes, but it will be so called ABAP CDS view in my case, restricted in functionality and based on traditional ABAP dictionary view. The whole difference between them you may read from article I linked below.
    Using tutorial from ABAP Programming model page the CDS view is created
@AbapCatalog.sqlViewName: 'ZOO_SQL_ACCOUNTS'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'CDS View for accounts'
@OData.publish: true

define view ZOO_DD_ACCOUNTS as select from zoo_t_accounts as account {
    key account.client as Client,
    key account.accountid as Accountid,
    account.nickname as Nickname,
    account.firstname as Firstname,
    account.lastname as Lastname
}
The annotation @OData.publish: true is needed for auto-exposure of CDS as OData Service (see also link below). After the activation of CDS View the OData service will be created and placed on Gateway automatically. Now the OData service need only be activated in the trancaction /IWFND/MAINT_SERVICE and that's it!

    Activated OData Service will be shown in ADT available to test in browser.

    So the next step will be to consume this newly created OData service by Fiori elements app, but this will be done in the next part.


Ressources used for article:

Open SAP Course - SAP Fiori Overview: Design, Develop and Deploy  https://open.sap.com/courses/fiori3 

Set Up Fiori Tools https://developers.sap.com/tutorials/fiori-tools-vscode-setup.html

OData and SAP Gateway https://www.sapspot.com/odata-and-sap-netweaver-gateway-part-i-introduction/

ABAP RESTful Application Programming Model https://help.sap.com/viewer/923180ddb98240829d935862025004d6/Cloud/en-US/289477a81eec4d4e84c0302fb6835035.html

SAP Trials and Downloads https://developers.sap.com/trials-downloads.html

ABAP Programming Model for SAP Fiori https://help.sap.com/viewer/cc0c305d2fab47bd808adcad3ca7ee9d/202110.000/en-US

HANA CDS vs ABAP CDS https://erlebe-software.de/abap-und-co/abap-cds-views-und-hana-cds-views/

Exposing CDS as OData service https://help.sap.com/viewer/cc0c305d2fab47bd808adcad3ca7ee9d/202110.000/en-US/ed2ed4e2cbc54ffdba3aead4f3a73640.html

OOpenFriends Kanboard https://github.com/users/msminakov/projects/3

Comments

Popular posts from this blog

Installing SAP AS ABAP 7.52 SP04 Developer Edition on VMWare

Running Fiori elements App on local VM with SAP Developer Edition