Create cap application using fiori elements (list report/object page) in visual studio
This blog post is on regarding how to develop SAP Fiori Elements (List Report Page/Object Page) with cap in visual studio.
The SAP Cloud Application Programming model (CAP) is a framework of languages, libraries, and tools for building enterprise-grade services and applications.
A CAP application commonly provides services defined in CDS models and served by the CAP run times.
SAP capm support to SAP Fiori using SAP Fiori Elements. As well known, Fiori Elements are created using the semantic annotations from OData.
Steps to create the cap application:
#1 In terminal -give command (cds init <projectname>) to create the capm app.
#2 In db folder create data-model.cds file and define the entity’s.
#3 In srv folder create service in cat-service.cds file
#4 create csv folder in db folder and create my.bookshop-Books.csv file and my.bookshop-Authors.csv file and provide the data.
Procedure to create Fiori elements(list report/object page)
#1 Using app folder – Go to view-command pallete- fiori:open application generator -use sap fiori elements(list report /object page)
#2 Give data source and service selection
#3 select entity
#4 configure the project Attributes
Using UI annotations in annotations.cds file for list report/object page
#1 To display data in table and filtering data.
i)UI.SelectionFields – For filtering data.
ii)UI.LineItem and UI.DataField – For displaying table data.
#2 To display header information.
i) UI.HeaderFacets – to display header section.
ii) UI.HeaderInfo – to display information.
#3 To display sections using facet
i) UI.Facets- can hold multiple facets.
ii) UI.ReferenceFacet – To display the contents.
iii) UI.FieldGroup -To display the information.
Output: Run the application use command(cds watch)in terminal
This sap cap framework is best suited for the development of applications for the enterprise having Cloud Infrastructure.
SAP Fiori elements apps are generic frontends, which construct and render the pages and controls based on annotated metadata documents. The annotations provide semantic annotations used to render such content.
It supports application developer extensions for an application developer to incorporate very specific business demands.