Running Fiori elements App on local VM with SAP Developer Edition

    I would recommend to start reading this topic with my previous article  Getting started with ODATA

    In the previous part I have created a CDS view and exposed it as OData service. Now I want to build frontend as Fiori elements list report object page on this OData service. Using the standard tutorials for setup Visual Stusio Code and setup the prerequisites for SAP Gateway, the first fiori app was generated.     But it was too early to be glad, because the preview of the application in the browser did not show any data. 


    Good, F12 says for the error request that we have to look into /IWFND/ERROR_LOG (do not forget to put /n before the transaction name, othervise it says "no such transaction").


Error log contains the error: No service found for namespace '', name 'ESH_SEARCH_SRV', version '0001'. After some googling I found and implemented the following solution from the help article:
  1. Activate OData service in the back-end (SAP_BASIS is higher than 752):
    1. On your Gateway System, execute transaction /IWFND/MAINT_SERVICE
    2. Click on the 'Add service' button on the header
    3. In the next page, under the System Alias field, select LOCAL
    4. Click on 'Get services' at the top
    5. In the list on the next page, select ESH_SEARCH_SRV
    6. Assign this to a package, or select 'Local Object' button
    7. Click 'Continue'
    8. The service is now active
Okey, ESH_SEARCH_SRV service is activated now, but I still cannot see data in fiori. This time I am getting 403 error on GetServerInfo request.

    
    I have spend 3 days fighting with this error, actually the problem was in enterprise search services, which were not activated. I have activated them in SICF transaction:

And... got next error after that, but now on the next GetResponse action: "UI requires connectors ESH_CONNECTOR and ESH_CATEGORY to be active". Actually that's right, enterprise search is not configured on my local VM and I am not sure it is possible to configure it at all there.
But my OData service seems to be working, but how can I get data from it? Actually you just needed to put the name of your entity set after the OData service call to see the data. Name of the Entityset you can find in metadata.xml

So it is ZOO_DD_ACCOUNTS in my case and the whole url to get the data will be: http://vhcalnplci:8000/sap/opu/odata/sap/ZOO_DD_ACCOUNTS_CDS/ZOO_DD_ACCOUNTS
And it works, I can finally see the data (I have also used Postman tool to test OData):
    

But if the OData service works fine, why it cannot be consumed by my fiori list app? After a lot of investigation, the trouble was in URI in manifest.json file. When I have generating Fiori List App I have entered wrong call of OData forgotten to remove debug parameter:

After removing it from manifest.json - here we are - first Fiori List App is up and running on local machine using OData disposed on SAP Gateway on local VM:

Fiori List App

It is interesting, that I am still getting the same 400 error for enterprise search connectors and a lot of other errors in browser console, but the frontend app is running. So actually ES is not necessary for standard fiori app.


Articles used:

Setup VS Code https://developers.sap.com/tutorials/fiori-tools-vscode-setup.html

Generate Fiori Elements App https://developers.sap.com/tutorials/fiori-tools-generate-project.html

1797736 - SAP Gateway Troubleshooting Guide

SAP Gateway Configuration Guide https://help.sap.com/viewer/68bf513362174d54b58cddec28794093/7.4.17/en-US/eaf72651c294256ee10000000a445394.html

Activate OData Service on SAP Gateay https://help.sap.com/viewer/cc0c305d2fab47bd808adcad3ca7ee9d/202110.000/en-US/1b023c1cad774eeb8b85b25c86d94f87.html

2359472 - Receiving message "User no longer logged on" using a SAP Gateway and Fiori Transaction

2776662 - "No service found for namespace", Name 'ESH_SEARCH_SRV', Version '0001'

Add Authorisation for OData Backend https://help.sap.com/saphelp_ssb/helpdata/en/6f/0e415370107d77e10000000a441470/frameset.htm

Postman tool for testing OData calls https://www.odata.org/getting-started/learning-odata-on-postman/

Comments

Popular posts from this blog

Installing SAP AS ABAP 7.52 SP04 Developer Edition on VMWare

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