Overview of SAP Ui Elements
Overview of SAP Ui Elements
Elements
Objectives
Describe the advantages of using SAP Fiori Elements for SAP Fiori app
development
Describe the concept of adding annotations to OData services
Define smart controls
SAP Fiori elements is a framework that comprises the most commonly used floorplan
templates and is designed to:
SAP Fiori elements can be used in the different modern programming models as a UI
technology. We will not discuss these models in this course. However, we already have
courses on this topic on our learning platform that we would like to refer to.
This video gives you an overview of how SAP Fiori elements is used to create SAP Fiori
applications.
When SAP started building SAP Fiori apps, it became clear early on that SAP needed a
way to scale development across the organization.
80% of the Fiori apps that SAP delivers for SAP S/4HANA have been built with SAP
Fiori elements.
There is straightforward logic, like navigating between pages or apps, or the ability to
search, sort, and filter lists. Additionally, there are more complex functions including
editing with draft management, support for translation, and compatibility with mobile
devices.
SAP Fiori Elements Page Types
An important thing to know is that SAP Fiori elements generate the application at
runtime by combining three fundamental building blocks: OData services, OData
annotations, and SAP Fiori element page types.
In the SAP world, the only OData versions that are relevant are V2 and V4. The V4
version was released in 2014.
With OData V4, you get a reduced amount of data, through a more powerful query
language, a revised and optimized JSON protocol and a change in the metadata
concept.
Located at the OData service root, the service document lists the top-level resources
that are available. The metadata document, on the other hand, describes the structure
of all resources in the OData service; the metadata document is located at the address
$metadata relative to the OData service root.
The OData protocol defines the concept of the annotations without adding any details
concerning the particular names and values, which can or should be used for them. In
addition, SAP defines its own specific set of annotations.
Vocabulary
Vocabulary defines how you can add annotations to an OData service. All annotation
files must start from references and give an alias to some vocabularies.
Target
Some annotations are nothing about data, or do not bind with a particular entity type.
Those annotations do not have a target, they should be contained in a group of
annotations with a blank "" target.
All annotations must have a term. A term determines the meaning of an annotation. For
example, term UI.FieldGroup defines a group of fields.
If you have two annotations with the same term for the same target, a qualifier must be
added to make your annotation unique.
Most terms are described by a complex type. A complex type can have properties,
which are further described by other complex types, or OData built in types ( Edm.*) like
string,int32,boolean.
Type Inheritance
Smart Controls
Smart controls are a specific category of SAPUI5 controls that have some special
features in addition to the standard SAPUI5 features. This makes it easier to use the
control in certain scenarios.
Objectives
List Report
Object Page
Analytic List Page
Overview Page
Worklist Page
Let's look at each of these templates more closely.
List Report
With a list report, users can view and work with a large set of items. This floorplan offers
powerful features for finding and acting on relevant items. It is often used as an entry
point for navigating to the item details, which are usually shown on an Object Page .
Charts are not only used for visualization. Users need to switch between
Analytical list
integrated chart and table views (hybrid view).
page
Users need to see the impact of their action on a KPI.
Users need to see not only the result, but also the impact of their filter settings
directly in a chart representation
From that, we can use the List Report as replacement of ALV in SAP GUI. Lots of ABAP
queries created by SQVI and ALV-based ABAP reports can be replaced by List Report.
Object Page
The object page floorplan is used to display and categorize all relevant information
about an object. Categorized content can be accessed quickly using anchor or tab
navigation, and users can switch from display to edit mode to change the content. To
create a new object, users can switch to create mode.
The object page floorplan comes with a flexible, responsive layout and a dynamic page
header that can be adapted to display simple and complex business objects. This
allows you to adjust the layout to a wide range of use cases.
Use the object page floorplan if:
Overview Page
The overview page (OVP) is a data-driven SAP Fiori app type and floorplan that
provides all of the information a user needs in a single page, based on the user’s
specific domain or role. It allows the user to focus on the most important tasks, and
view, filter, and react to information quickly.
Each task or topic is represented by a card (or content container). The overview page
acts as a UI framework for organizing multiple cards on a single page.
The Overview page is based on SAP Fiori elements technology and uses annotated
views of app data, meaning that the app content can be tailored to the domain or role.
Different types of cards allow you to visualize information in an attractive and efficient
way.
An Overview page is a data-driven SAP Fiori application built using SAPUI5 technology,
OData services, and annotations for organizing large amounts of information.
The analytical list page (ALP) offers a unique way to analyze data step by step from
different perspectives, to investigate a root cause through drilldown, and to act on
transactional content. All of this can be done seamlessly within one page. The purpose
of the analytical list page is to identify interesting areas within datasets or significant
single instances using data visualization and business intelligence.
Visualizations help users to recognize facts and situations, and reduce the number of
interaction steps needed to gain insights or to identify significant single instances. Chart
visualization increases the joy of use, and enables users to spot relevant data quickly.
The main target group are users who work on transactional content. They benefit from
fully transparent business object data and direct access to business actions. In addition,
they have access to analytical views and functions without having to switch between
systems. These include KPIs, a visual filter where filter values are enriched by
measures and visualizations, and a combined table/chart view with drill-in capabilities
(hybrid view). Users can interact with the chart to dig deep into the data. The
visualization enables users to identify spikes, deviations, and abnormalities faster, and
allows them to take appropriate action right away.
Worklist Page
A worklist displays a collection of items a user needs to process. Working through the
list usually involves reviewing details of the items and taking action. In most cases, the
user has to either complete a work item or delegate it.
The worklist is a versatile floorplan that offers three main variants: a simple worklist
(plain page with a table), a worklist with tabs, and a worklist with one or more KPI tags.
These variants are based on different user needs and use cases.
Use the worklist floorplan if:
Users have numerous work items and need to decide which ones to process first.
You want to give users a direct entry point for taking action on work items.
Users need to work with multiple views of the same content (for example, items
that are "Open", "In Process", or "Completed"). You want to offer tabs for
switching between views.
Do not use the worklist page floorplan if: Use instead:
The items you are showing are not work items.
You want to show large item lists, or combine different data visualizations
(charts or tables).
List report
floorplan
Users need to find and act on relevant items from within a large set of items
by searching, filtering, sorting, and grouping.
List the basic process steps of building SAP Fiori Elements applications
Note
The process is not 100% the same for all templates. Here, we only take List Report as
an example. Processes for other templates will be discussed in later units.
The entities of the models defined in ABAP CDS provide enhanced access functions
compared with existing database tables and views defined in ABAP Dictionary, making
it possible to optimize Open SQL-based applications. This is particularly clear when an
AS ABAP uses an SAP HANA database, since its in-memory characteristics can be
implemented in an optimum manner.
Note
The purpose of this lesson is to let you gain a basic understand of CDS.
In the figure below, we use ABAP annotations and UI annotations. As an example, the
ABAP annotations @OData.publish:true ensures that an OData service is created when
the CDS view is activated. The annotations @UI.lineItem ensures that a column is
created.
CDS annotations are extra information to describe the data. They let the consumer of
the CDS view know how to use data from the CDS view.
Annotations are grouped according to usage. The figure above shows the most relevant
groups of association for SAP Fiori elements.
To have full knowledge of CDS annotations, you can access the CDS annotation
document. Search for ABAP Programming Model for SAP Fiori on the Sap Help
Portal.
Follow these steps:
1. Go to SAP Help.
2. Search "ABAP Programming Model for SAP Fiori" and press Enter.
3. Choose the correct result according your Kernel version.
4. Click "Reference" on left bottom of the screen.
If an annotation term represents a structure, two options are available for writing the
annotation.
Let's explore!
Both syntax have same meaning and can be used in combination, such as
@UI.headerInfo.title: { value: 'SalesOrderID' }
If an annotation term represents an array, the only option is to use a JSON array.
In some cases, a term is an array type, but most of its usage only has single line of
record.
In this situation, you can use object style to simplify the input.
CDS Associations
Usually, you need to define some reusable CDS views, which define associations as a
representation of the business entity. Then you can write a consumption CDS view,
which uses the interface view as its data source, to consume the data and associations.
In the figure, Interface View 1 has two associations connected to Interface View 3 and
Interface View 2.
When Consumption View 1 accesses the data of interface View 1, it can do the
following:
Access fields of Interface View 1.
Access fields of Interface View 2 through association 1 of interface View 1.
Expose Association 2 of Interface View 1 again, to let the consumer of this view
have the ability to access fields of Interface View 3.
There are three main areas of an association. Let's look at each of them.
Using the Service Adaption Definition
Language (SADL)
Objectives
Explain the usage of SADL for publishing CDS views to an Odata service
All SAP Fiori elements related annotations are translated to OData annotations. In this
way, you can combine your business logic, OData service development, and annotation
into one CDS view.
The CDS view you are working on is transformed to an EntitySet with a name identical
to the generated OData service.
All CDS views associated to this view are also transformed to an EntitySet. The
association relationship is transformed to the Association and Navigation Property in the
OData service.
In SAP Gateway Service Builder, you can reference an existing CDS view. Then, you
can add associated CDS views selectively. Even associations of associated views can
be added to your OData Service.
You can then override MPC or DPC standard implementation to add write support and
advanced OData features for the OData Service.
In the figure below, we see on the left side the CDS UI annotations @Ui.lineItem to
create columns. @UI.identification represents an ordered collection of specific data
fields that together with headerInfo identifies an entity to an end user.
@UI.selectionField annotation allows filtering a list of data. This annotation is usually
used in an initial page floorplan as filter bar. On the right side we see the transformation
of the CDS annotations into OData annotations.
Like OData Annotations, CDS Annotations can apply on an EntitySet or a data field.
In most cases, there is a 1:1 relationship between an OData annotation term and a CDS
annotation with a similar name.
CDS Annotations are grouped by target. Annotations with the same target stay together.
Objectives
Metadata Extension
The syntax of CDS will grow if complex annotations are needed. That may reduce the
readability of CDS.
Note
Metadata extensions only allow annotation of JSON style.
Some annotations relevant to the activation of CDS, like @odata.publish,
@AbapCatalog.sqlViewName are not supported in a metadata extension.
Note
If there is more than one metadata extension annotation for the same CDS, refer
to https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abencds_meta_data
_extension_eval.htm to know how to determine which metadata extension is used.
Scenarios
System Requirements for SAP Fiori Elements Development with SADL
To use SAP Fiori elements in SAP NetWeaver AS ABAP, the minimum version of SAP
NetWeaver is 7.50 SP01, otherwise the SADL will not work.
Many new annotations are added in each upgrade of SAP NetWeaver. Hence, SAP
Fiori elements will be more powerful if you choose the newest version of SAP
NetWeaver.
In general, CDS works on any database, but SAP HANA is recommended when good
performance is needed, due to CDS push down the calculation to the DB layer.
When writing annotation as a local file using SAP WebIDE, SAP Fiori elements works
with any OData service, even from non-SAP back end.
If SAPUI5 runs on a non-ABAP platform like SAP CP, or you're using OpenUI5, SAP
Fiori elements only requires the version of SAPUI5/OpenUI5.
If SAPUI5 runs on ABAP platform, SAP Fiori elements require version of SAP_UI.