0% found this document useful (0 votes)
18 views

RAP Part-1 Developing Read-only List Reporting Apps

This document outlines the development of a Read-only Reporting Application (RAP) focusing on creating an OData service with multiple read-only features. Key objectives include enhancing knowledge of OData services, implementing associations between CDS views, and providing value help and search capabilities. The document also includes a detailed data model for flight details and source code examples for various CDS views used in the application.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

RAP Part-1 Developing Read-only List Reporting Apps

This document outlines the development of a Read-only Reporting Application (RAP) focusing on creating an OData service with multiple read-only features. Key objectives include enhancing knowledge of OData services, implementing associations between CDS views, and providing value help and search capabilities. The document also includes a detailed data model for flight details and source code examples for various CDS views used in the application.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

(Rest Full Applica on Programming) RAP Part-1

1.Developing Read-only List Repor ng Apps: -

Basically, in this chapter we will develop a RAP Applica on which is having Read-Only features.

What you will learn from this Development: -

1.we will learn how to develop an OData service including Mul ple read-only features.

2.We will also learn How to Consume this OData service by FIORI Element Applica ons or by any
Other OData client.

Develop Following Features and Query Capabili es: -

 Expanding the Data Model with addi onal CDS views.


 Naviga ng Between CDS views Using Associa on.
 Changing UI field labels and descrip on.
 Displaying Text for Unreadable elements.
 Providing Value help for the selec on fields.
 Adding Search Capabili es.

Objec ve of this Development: -

 Apply and enhance your knowledge about how to create and expand and OData service.
 Implement Associa on Between Two CDS views.
 Expose New CDS views for an Exis ng OData service.
 Use @EndUser. Text Annota ons.
 Develop value Helps for Input Fields.
 Implement search Capabili es.

Data Model for Read-Only Scenario of Flight Details

(Value Help Provider Without Associa on)


ZI_Connec on_R
Text Associa on

1 ZI_Airport_R

ZI_Carrier

Associa on for Naviga on

Text Associa on N N

ZI_Flight_R
Describe The above figure: -

 The entry point of Flight scenario is - ZI_Connec on_R and It manages data for flight
connec on.
 ZI_Flight_R – This view is linked with connec on view by Associa on and it is basically used
to display Flight informa on.
 ZI_Carrier – This view is basically used to display the full name of Airline.
 ZI_Airport_R – This view is basically used for Value help provider for the Airport elements in
the Connec on CDS view.

Defining CDS view: -

To provide a complete Data model, CDS view have to be define first.

Data Defini on Data source Descrip on


CDS view name
ZI_Connec on_R SPFLI(DB table) 1.provides informa on about
the Airlines connec on.
1.Provides informa on about
the available flights including
ZI_Flight_R SFLIGHT (DB table) flight dates and plane
informa on.
2.You can navigate to this
view once you have chosen a
flight connec on.
1.Provide informa on about
the airlines that operates the
ZI_Carrier SCARR (DB table) flights.
2.This view is la er used as
Value help provider for the
view ZI_Connec on_R
ZI_Airport 1.SAIRPORT 1.Provide informa on about
2.SCITAIRP the involved airports.

Data model with Source code for Flight App: -

Connec on CDS view - ZI_Connec on_R

Descrip on: -

This CDS is the Entry point of the Flight Reference App. It provides the element for the connec on
by searching this connec on user can find a suitable flight for his journey.
Source Code: -

Source code Overview: -

1.Associa on with ZI_Flight_R – this view used to provide Flight details.

2. Associa on with ZI_Carrier – This view used to provide a Airline name as text for Airline id(carrid).

3.Annota on: - @ObjectModel.text. associa on: '_Carrier’, this Annota on is used the Add the Text
informa on as Airline name for Airline Id’Carrid’.

Flight CDS view – ZI_Flight_R

Descrip on: - This CDS view provides detailed informa on about the Flights. It is displayed as a 2nd
Facet in the UI, which means we only need a limited number of UI Annota ons.
Source code: -

Carrier CDS view - ZI_Carrier

This view is used as Text Provider view for the main views of the App. It Contains the text for the
element ‘Carrid’

Source Code: -

1.Annota on: - @Seman cs.text: true

This Annota on provides this field value as text informa on to main CDS view ‘Connec on’.
Airport CDS view - ZI_Airport

This CDS view is used as Value help provider for the Connec on CDS view. It Contains detailed
informa on about the available Airports that can be used for the value help.

Source code: -

Metadata Extension: - ZI_Connec on_R

This Metadata extension used to Design the UI for Airline Reference Applica on.

Source Code: -
Use Case for Metadata Extension: -

Set Header informa on: -

Basically this Annota on Provides Header informa on for UI .

the type name – Connec on defines single Connec on and Type name plural – Connec ons defines
for mul ple Connec ons.
Display Header informa on in Header Object page using UI Facet.

Header Page: -

Header Object Page: -

Line-Item Details: -
Tool p Annota on: -

@EndUserText.quickInfo: 'Airline that operates the flight'

This annota on provides a Tool p informa on about a column when mouse hovers on it.

Annota on used to add search capabili es for a field: -

@Search.defaultSearchElement: true

Note: - To use this annota on, you have to add a Annota on - @Search.searchable: true , on the top
of your metadata extension or your Main CDS view.

Annota on used for Fuzzy search: -

@Search.fuzzinessThreshold: 0.7

this fuzziness threshold needs minimum 70% matches for the input value.
Annota on used for value help for a field: -

Possible Values: -
Metadata extension for Flight details: -
Service defini on: -

Basically, Service defini on need to create for expose the CDS views as OData service.

Service Bindings: -

Create service binding on the top of Service defini on and publish it.

Use preview op on to Display the Applica on on Browser.

Applica on

Header Page: -
Header Object Page: -

Thank You……………………….

Part 2 is coming soon where I will explain how to create a Transac onal applica on (CRUD).

In case of any Query, you can Contact me on my phone - +91 8917651406.

----------------xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx…………………………………………………………

You might also like