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.

Logical Architecture of SAP HANA Live Content

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:

  1. 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.
  2. 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.
  3. 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.
  4. 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):

SAP HANA Live Browser

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:

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:

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:

We highly recommend going through Chapter 6 if you haven’t yet done so before you work on the examples in this chapter.