Wednesday 15 August 2018

Create a Self-Service BI application powered by SAP Lumira and ABAP CDS views

SAP BusinessObject Lumira (a.k.a. Lumira) is a business intelligence tool focused on analytics and data visualisation, it provides the ability for business analysts to alter data structures and the correlation in the way they need without help of a professional designer or IT specialist.

Applications created with Lumira are really impressive and they provide the perfect user experience allowing you to construct powerful dashboards with different kinds of visualisation based on charts, tables and even maps.

SAPUI5, SAP Lumira, SAP ABAP CDS, SAP Development, SAP ABAP Guides

After some time focusing on SAPUI5, ABAP CDS and exploring the SAP Analytics world I had the opportunity to try out this marvellous tool and implement some functionalities provided out-of-the-box.

The purpose of this post is to share my experiences and discoveries in the last couple of months and provide a quick user guide for developers who want to enrich User Experience with some simple techniques.

Starting now a short series of two articles I’m going to discuss two different developments I had implemented using SAP Lumira Designer and ABAP CDS views.

Create a Self-Service BI application powered by SAP Lumira and ABAP CDS views
Create a Geo-Analytical application powered by SAP Lumira, ESRI Maps and ABAP CDS views

In this first article I’m going to explore a little bit about the architecture, some of the predefined templates and explain how simple it’s to connect a Lumira application with an analytical data model constructed with ABAP CDS views.

Exploring SAP Lumira architecture


At the moment, Lumira is delivered in two different versions:

◉ SAP Lumira Discovery
◉ SAP Lumira Designer

While Lumira Discovery is focused on the business user providing intuitive interfaces, flexibility to connect data from multiple data sources and a good set of options to manipulate the data and generate different kinds of visualization, Lumira Designer is ideal for professional designers and developers who need to create corporate analysis applications and reports, expanding and enriching applications with custom functionalities.

Lumira Discovery

SAPUI5, SAP Lumira, SAP ABAP CDS, SAP Development, SAP ABAP Guides

Lumira Designer

SAPUI5, SAP Lumira, SAP ABAP CDS, SAP Development, SAP ABAP Guides

Since this article is directed to IT consultants, it’s totally focused on the Lumira Designer edition. Here it goes some interesting facts about the tool:

◉ Lumira Designer is based on Eclipse IDE.
◉ The user interface is intuitive providing drag and drop commands to consume the components available in the Palette of Components.
◉ Possibility to enhance applications with custom code using the Script Editor. Events are available in most part of the components and data sources.
◉ A good set of Predefined Templates are available with Lumira Designer, reducing the time spent in the front-end development and allowing to put more focus on the back-end.
◉ Lumira applications are constructed on top of SAPUI5 libraries, this means the code used in the Script Editor is based on Javascript.

This is just a brief introduction but if you want to acquire more knowledge about the subject I advise to have a look in the SAP Help Portal documentation:

◉ SAP BusinessObject Lumira

Now that you have the basic understanding about the tool it’s time to proceed and check the available templates.

SAP Lumira Designer Templates


Lumira Designer offers you a set of standard and ready-to-run templates that serve various design and business needs. When you choose a template, the system automatically creates a copy of it and you can change this copy according to your needs.

SAPUI5, SAP Lumira, SAP ABAP CDS, SAP Development, SAP ABAP Guides

The following Standard templates are available:

◉ Blank

◉ Basic Analysis Layout

◉ Basic Layout

◉ Planning Layout

◉ Tabstrip Layout

The following Ready-To-Run template is available:

◉ Generic Analysis

Before you proceed check in details the official documentation and understand the purpose of each one of these templates, since our main goal is to generate a self-service BI application we’ll focus on the Basic Analysis Layout and Generic Analysis.

Both templates provide similar functionalities, the main difference is the Basic Analysis doesn’t allow the user to change the data source during the runtime while the Generic Analysis allows the selection of a different data source based on the back-end connections configured in the BI platform.

The layout of both templates are pretty similar, let’s have a look:

SAPUI5, SAP Lumira, SAP ABAP CDS, SAP Development, SAP ABAP Guides

The application is composed by the following sections:

◉ Header: Application name in the centre and extra options in the right section (favourites, technical details, export data, etc)
◉ Filter Bar: Visualize and select new filters.
◉ Toolbar: Change between different perspectives (tabular view, chart view, mixed view).
◉ Navigation Pane: List of all measures, dimensions, columns and rows. Everything customized by the user and manipulated via drag & drop.
◉ Content: Main section of the application with the data output based on the configuration defined in the navigation pane.

Header
Filter Bar  
Toolbar  
Navigation Pane
Measures & Dimensions
Columns & Rows
Content
Data Output

Now that you’re familiar with the self-service template we can start the development of our demo, I’m going to split this content in two parts, back-end and front-end development.

Back-end development: ABAP CDS


Analytical data models constructed with ABAP CDS views are really powerful, you have the advantage to consume the data in real-time avoiding the work with extractors and possible replication issues. Also, with the power of CDS annotations all the SAP BW objects are generated automatically, based on simple analytical annotations placed in your CDS views the system generates automatically BEX queries and all the dependent BW objects through the Analytical Engine.

SAPUI5, SAP Lumira, SAP ABAP CDS, SAP Development, SAP ABAP Guides

The business scenario is based on the Flights data model provided in the previous article, the query Flight Bookings is going to be reused in this exercise, check the details below:
  • CDS View: Z_Query_FlightBookings
    • Description: Flight Bookings
    • View Type: Consumption / Analytical Query
    • SQL View Name: ZQUERYFLIGHTBOOK
With the definition of our business case and back-end data model we can proceed straight to the front-end development and configuration.

Front-end development: SAP Lumira Designer


Start by logging into your SAP BusinessObject BI platform.

Create a new document with the name Flights and create a new application under this document with the name ZDEMO_SS_FLIGHTS, select the Basic Analysis Layout and confirm.

SAPUI5, SAP Lumira, SAP ABAP CDS, SAP Development, SAP ABAP Guides


This should be the structure of document and application after you complete this step, you can visualize it through the Documents pane in the left section.

In the Outline pane, search the folder Data Sources and select the <unassigned> – DS_1, after one click over this object the Properties pane will show up with all the details about the data source, open the search help for name / connection to open a new pop-up with a configuration screen.

SAPUI5, SAP Lumira, SAP ABAP CDS, SAP Development, SAP ABAP Guides

Select the connection of your back-end server and the query Flights Bookings created in the previous post. Remember the name convention for the data source is not based on the CDS view name but in the SQL view name. This is the expected pattern:

2C + <SQL_VIEW_NAME>

And this should be the name of the Flight Bookings query:

2CZQUERYFLIGHTBOOK

Check the configuration below:

SAPUI5, SAP Lumira, SAP ABAP CDS, SAP Development, SAP ABAP Guides

After you press OK the application will update automatically the Navigation Pane and Content including the measures, dimensions, columns and rows exactly as configured in your CDS view.

SAPUI5, SAP Lumira, SAP ABAP CDS, SAP Development, SAP ABAP Guides

Save and run the application by pressing  Check the result below:

SAPUI5, SAP Lumira, SAP ABAP CDS, SAP Development, SAP ABAP Guides

In this quick demo I tried to explore a few of the functionalities available with the self-service template:
  • Selection of dimensions (via drag & drop)
  • Display (Key & Text)
  • Attributes
  • Totals
  • Filters
  • Output visualization:
    • Tabular view
    • Chart view
    • Mixed view

3 comments: