11 Creating and Extending Analytical Apps
This chapter explains how to create and extend an analytical app and illustrates the process by walking through a complete example app.
In Chapter 1, we introduced you to the SAP Fiori system landscape with SAP HANA XS. You then learned how to implement a standard SAP Fiori analytical app with and without the SAP Smart Business modeler in Chapter 6. In this chapter, we’ll focus on creating and extending an analytical app with an example based on SAP HANA Live views. All the SAP Fiori analytical apps are based on SAP HANA Live views, so we’ll begin with an overview of SAP HANA Live before digging into the creation and extension process.
11.1 Introduction to SAP HANA Live
By now, you know that analytical apps only run on an SAP HANA database and that these apps are developed on query views from SAP HANA Live. Therefore, it’s important to understand some basic concepts about SAP HANA Live before we look at creating or extending analytical apps. Because SAP HANA Live is a big topic, we’ll keep the introduction brief. However, a basic understanding of SAP HANA Live is needed to get started with the app development. Figure 11.1 shows the logical architecture of the SAP Fiori landscape with SAP HANA Live (VDM).
What is SAP HANA Live? SAP HANA Live is a complete set of predefined virtual data models that expose the SAP Business Suite application data. SAP delivers SAP HANA Live packages for several SAP Business Suite application areas; for example, in Figure 11.1, you can see SAP HANA Live for SAP ERP, SAP CRM, and so on. Customers can download and install the specific packages they need.
In this section, we’ll look at the important aspects of SAP HANA Live, including SAP HANA Live views, the SAP HANA Live Browser, and the process of exposing these views to SAP Fiori analytical apps.
Figure 11.1 Logical Architecture of SAP HANA Live Content
11.1.1 SAP HANA Live Views
A VDM is a structured representation of an SAP HANA database view that follows consistent modeling rules. Data from SAP Business Suite is consumed into the analytical apps using these views. A VDM contains four types of SAP HANA Live views:
-
Values help views
As the name implies, these views are used to populate value help, the dropdown lists in the applications that provide a full list of possible values for entities—for example, customers, materials, and so on. -
Private views
These views summarize certain SQL transformations on one or several database tables. A private view can be based on database tables, other private views, or reuse views. These are the SAP standard views that use SAP tables directly. No one can modify these views. -
Reuse views
These views expose business data from SAP Business Suite systems in a well-structured format. They are designed to be reused in other views, and they consist of one more private views. -
Query views
As previously mentioned, all analytical apps are developed on query views. These are the top level of views, designed to expose business data from the SAP Business Suite system and for direct consumption by the analytical apps.
Now that you know about the different views available in SAP HANA Live, let’s look at how to browse and navigate those views.
11.1.2 SAP HANA Live Browser
SAP HANA Live Browser is a web application built using SAPUI5. With this tool, users can easily browse and navigate between the SAP HANA Live content views. You can access SAP HANA Live Browser at http://<SAPHANAServerHost>:80<SAP HANA Instance>/sap/hba/explorer/.
Figure 11.2 shows the landing page for SAP HANA Live Browser. On this screen, the content is organized by application components; users can navigate among ALL VIEWS, MY FAVORITES, SEARCH, and INVALID VIEWS tabs.
After selecting a view on the left-hand side of the screen, you can see the details of the selected view on the right side. The following icons are shown on the right side (from left to right):
-
Open Definition
Use this icon to view the metadata of the SAP HANA Live views. -
Open Content
Use this icon to view the data of the SAP HANA Live views. -
Open Cross Reference
Use this icon to view the tables and view cross references. -
Add Tags
Use this icon to add personalized tags; select a view, then click the Add Tags button. -
Generate SLT
Use this icon to generate the SAP Landscape Transformation file. -
SAP Lumira
Use this icon to open the SAP HANA Live view in SAP Lumira and build storyboards using data from SAP HANA Live. -
SAP BusinessObjects Analysis
Use this icon to open the SAP HANA Live view in SAP BusinessObjects Analysis to perform further detailed analysis on your data.
Figure 11.2 SAP HANA Live Browser
We’ve now covered the overview of both SAP HANA Live views and SAP HANA Live Browser. In the next section, we’ll discuss how these views work in relation to SAP Fiori analytical apps.
11.1.3 Exposing SAP HANA Live Views to Analytical Apps
Views in SAP HANA Live can be exposed as an OData service. These services can integrate SAP HANA Live views with SAP Fiori analytical apps. By now, you’re familiar with OData services and their concepts. An OData service for SAP HANA XS is defined in a text file with the suffix .xsodata. The data is transferred to analytical apps over HTTP using either the AtomPub (XML) or the JSON format.
A couple of advantages of using SAP HANA Live with analytical apps are as follows:
- Developers can build analytical apps directly on SAP HANA Live views without the need for additional software.
- All analytical apps run on the primary database, so there’s no need for users to wait for the data-loading jobs to complete. The cycle time from recording to displaying in analytical apps is dramatically reduced.
In addition, when working with SAP HANA Live views in correlation with SAP Fiori analytical apps, it’s important to keep the following points in mind:
- Private views should not be copied or modified.
- Use query views or reuse views for extensions by copying them. If you change the original views, then the changes will be lost the next time a new VDM is installed.
- The Enforce SQL Execution flag must be set to True for all graphical calculation views.
- Using attribute and analytical views must be avoided for better performance of the app.
Now that you have a basic understanding of SAP HANA Live and its views, let’s walk through how to create or extend an analytical app using a view from SAP HANA Live. The creation and extension processes are very similar, so we’ll first cover the creation processes in detail, and then we’ll talk about the extension process from a high-level perspective.
Prerequisites
Several prerequisites must be met before you start creating or extending analytical apps:
- The correct version of SAP HANA must be installed on the SAP HANA server per the requirements for SAP HANA Live. Refer to the SAP Fiori apps reference library to find the exact versions.
- The standard SAP tables used by SAP HANA Live must exist and be populated with data by an appropriate data-replication mechanism.
- The SAP HANA client and SAP HANA Studio software must be installed on the client systems.
- A beginner’s knowledge of SAP HANA data modeling is required.
- You must be familiar with or have access to the SAP HANA Live release notes.
- You need to have access to KPI modeler apps (see Chapter 6).
We highly recommend going through Chapter 6 if you haven’t yet done so before you work on the examples in this chapter.