Fiori CRUD End to End Scenario
There are many Fiori CRUD scenario implementations. How this one is different from others? It is based on SAP Template and represent best development practises. Besides of, it covers creation of CRUD OData Service and provides insight of what happens at back-end.
To begin with, create CRUD OData Service following Chandra Mahajan’s instructions in his blog. Please make a small change to ZUSERINFO_SRV ODataService to enable WebIDE template to see UserCollection Entity Set:
Note: if you do not have access to gateway system, then you can use cloud trial system as described in my blog.
Once CRUD OData Service is ready, proceed with Fiori application creation.
In HCP Cockpit create destination pointing to your gateway system (in my case it is ABAP 7.40 cloud trial system):
Then in WebIDE from menu choose File -> New -> Project from Template
Select SAP Fiori Application from Category drop down
Select CRUD Master-Detail Application template and click Next
Provide Basic Information and click on Next
Select you destination from drop down (NPL in my case)
Select ZUSERINFO_SRV from services drop down and click Next
Customize template as follows and click on Next
Click on Finish to complete project genetation
Note: generated Fiori application scope of functionality depends on DataService. Try to explore CRUD template with other services as well.
Run generated CRUD Fiori application
As you can see Query operation works providing a list of Users.
Click on Add button to test Create operation
Provide enter user details and press Save
Select just added entry and click Edit to test Update operation
Make changes and press Save
Finally test Delete Operation selecting the entry from master list and clicking Delete
Play with you generated Fiori CRUD application and explore it.
You can check data at back-end at any time in ZUSERINFO table.
You can also explore ZUSERINFO_SRV Data Service setting external break-points in OData Service implementation class. So during Fiori application execution it will take you in ABAP Debugger session.
Play with you back-end service enhancing it, for example, adding error handling for creation of duplicate entries.
Now if duplicated user entry is added, then Fiori provides a meaningful message