SAP Fiori Elements using CAP Model – Introduction
In the past weeks, I’ve been working on a demo project about SAP Fiori Element using CAP Model. It all started when I was exploring the capabilities of the new SAP Fiori Tools to help aid in SAP Fiori Element app development. Then I realized that there are not that many references of SAP Fiori Element app that uses CAP Model — I guess this is not surprising as CAP is relatively a new programming model. So I decided to come up with a comprehensive example that showcases a real-world scenario.
The demo project is patterned after the SAP Tutorial — Create a List Report Object Page App with SAP Fiori Tools, but using the North Wind Service data model. I enjoyed developing this demo app, and I must say, the CAP framework exceeded my expectations. I hope you will find this demo project useful.
As a teaser, here’s the screenshot of the List Report page:
Blog Post Series
- SAP Fiori Element using CAP Model – Introduction
- SAP Fiori Element using CAP Model – List Report App
The Goal: No-Code Challenge
Let’s get into a more detailed explanation by first discussing SAP Fiori Elements. In the official documentation of SAP Fiori Elements extension, it is mentioned there that only use app extensions if the desired behavior cannot be produced by annotations and setting the manifest file. So for this reason, I avoided getting into app extensions.
Here’s the screenshot of the Object Page:
The Demo Project
The demo project is a mono repo that hosts both the SAP Fiori Element List Report app (generated by SAP Fiori Tools) and CAP-based backend service.
The repository can be accessed through the GitHub repository below:
Please refer to the README.md file on how to install and test the app.
Here’s the screenshot of the Object Page showing the Monthly Revenue Bar Chart:
Inspired by the Devtoberfest 2020 event, I have turned this demo project as an opensource demo project where anybody is welcome to contribute for any scenario or behavior that is still not catered.
It can be a contribution that is riding along with the no-code challenge or expanding in other areas like Fiori Element API Extension scenarios together with CAP Model backend service.
Try it yourself and I hope you will have fun building your own app (like I did!) using these frameworks.
The fun doesn’t stop here. In fact, we are just getting started. In my next blog post, I will try to decompose the project into smaller pieces so that it will be easy for consumers who are new to Fiori Element or CAP Model (or both) to understand and replicate the behavior used in the app. So stay tuned!
SAP Fiori Element using CAP Model – List Report App
Appreciate it if you have any comments, suggestions, or questions. Cheers!~
Thanks for this wonderful post. The information in this article is very helpful to me. Thanks a lot for sharing.
You're welcome sachin patil ! And thanks for your comment!
Thanks for your great post as always.
This annotation sample really helps. It includes many features I wanted to try.
You're welcome Mio Yasutake ! And thanks for the positive comment!
Happy no-coding! 🙂
Your project has also been of great help to me.
Thank you very much!
You're welcome Juanjo Gersol Ortega ! I'm glad that you find it helpful!
Another great blog post! Thanks again for sharing this Jhodel, finding the right annotation and the right syntax can be tricky so this example will probably help many developers.
Thanks Pierre Dominique for the wonderful comment!
You're spot on, annotations can be tricky and that's how I find it as well during my journey. Also, add to the equation the vast resources using to ABAP CDS that is not directly applicable to CAP CDS. 🙂
Thanks again for the wonderful post.
Hi tummagunta chaitanya - thanks for your comment! Sure - and have fun learning!
Thanks for sharing this Jhodel Cailan.
Good to see how CAP and Fiori tools come together to easily developing enterprise grade Apps.
You're welcome Venu Ravipati ! And thanks for your comment!
Thank you so much for this blog post! I finally manage to understand better how annotations work 🙂 Very much appreciated!
Thanks for your comment Ioana Stefania Santimbrean !
Glad to know that it helped you!
Hi Jhodel Cailan
Thank you so much for awesome blog post! I have watched your tutorial.
I have a question about develop UI app for CAP project. Instead of use config for UI by xml, Im now using annotation from cds model, like this:
And here is structure of project
I put UI app into “app” directory” and service in “srv” directory.
As you see Im using another way, So i wonder if by approach annotation directly from this CDS model for UI:
I’ve just done it, so it really takes a right direction to avoid wasting time. Thank’s you very much!
Thanks for your comment Hieu Ngo Xuan !
There are no limitations on either of the approach. Think of it this way, there are 2 teams from SAP side namely CAP Team and the Fiori Element Team. The CAP Team introduced an approach they think you should use in order for you to modularize your backend and frontend code within one CAP project -- and this is the approach you are using. While Fiori Element team has their own approach of starting your UI5/Fiori Element project independent of the backend service you are using, and this is the approach that has always been there even before CAP.
At the end of the day, it just a matter of preference and development standards or practices that needs to be followed within your development team. In practice, I prefer to have the frontend and backend projects separate to keep things consistent with how we do it in the ABAP stack.
Hi Jhodel Cailan,
Many thanks for your enthusiasm!
Maybe I'll implement the interface the way I'm doing, I think the CAP will support this well, and our application is simply neatly contained in the "app" directory, connect via Approuter. Anyway many thanks for your very clear answer. I will continue to move forward in the direction of what I am doing, with the convenience and disadvantages that I will share above so that we have more perspectives on the development of an application.