11.3    Extending Analytical Apps

You can extend an analytical app when the standard SAP Fiori analytical apps don’t meet your requirements. In this section, we’ll look at how to extend an app using an example based on the sales order query calculation view.

As previously mentioned, the SAP Fiori system landscape for analytical apps is comprised of two main layers: the SAP HANA layer and the UI layer. Depending on the individual analytical app extension requirements, you can extend one or multiple layers. Note the following when extending either of these layers:

In the previous section, you learned that analytical apps are developed on predelivered SAP HANA objects such as views, and these views reside in SAP Business Suite on the SAP HANA server. These SAP HANA Live views can be extended by adding a field from a standard SAP table or a custom field.

For this example, you’ll expose an additional back-end field from the SAP HANA database in the sales order query calculation view. To do so, you need to modify all the layers; we’ll explain how in the following sections.

11.3.1    Extend the SAP HANA Live View

To extend SAP HANA Live views, you need to install the extensibility tool in SAP HANA Studio. The SAP HANA Live extensibility tool is an Eclipse plugin for SAP HANA Studio that can enhance standard SAP HANA views. With this tool, users can expose fields from a standard model, remove unnecessary fields from a view, or include custom tables and fields.

Follow these steps in SAP HANA Studio to install the SAP HANA Live extensibility tool:

  1. Open SAP HANA Studio.
  2. Go to HelpInstall New Software from the menu bar (see Figure 11.40).
    Installing New Software

    Figure 11.40    Installing New Software

  3. Enter the following URL to access the tools, then click Add: >http://<HANAServer>:80<HANAInstance>/sap/hba/tools/extn.
  4. Select SAP HANA Live Extensibility and then click Next (see Figure 11.41).
    SAP HANA Live Extensibility

    Figure 11.41    SAP HANA Live Extensibility

  5. Click Next.
  6. Select the radio button to accept the terms of the license agreement, then click Finish (see Figure 11.42).
    Accept License Agreement

    Figure 11.42    Accept License Agreement

  7. Click OK in the security warning pop-up window (see Figure 11.43).
    Security Warning Message

    Figure 11.43    Security Warning Message

  8. Click Yes to restart SAP HANA Studio for the changes to take effect (see Figure 11.44).
    Restarting SAP HANA Studio

    Figure 11.44    Restarting SAP HANA Studio

You’ve successfully installed the extensibility tool. After SAP HANA Studio is restarted, you need to grant access to users so that they can use the extensibility tool. Follow these steps:

  1. Log in to the SAP HANA system from SAP HANA Studio.
  2. Navigate to the Security folder. From the Users folder, double-click the user name of the user who needs access to the extensibility tool.
  3. Add the following role in the Granted Roles tab: sap.hba.tools.extn.roles::Extensi-bilityDeveloper (see Figure 11.45).
    Assigning RolesRolesassign

    Figure 11.45    Assigning Roles

  4. Add REPO.READ, REPO.EDIT NATIVE OBJECTS, and REPO.ACTIVATE NATIVE OBJECTS permissions to the package in which the new extended view will be created.
  5. Click inline image.

With the preconfiguration of the extensibility tool out of the way, we’ll now show you how to extend a standard sales order query view by adding new fields. As previously mentioned, SAP recommends that you don’t reuse the standard query views; instead, use a copy in your own namespace and make the necessary modifications. A new view is automatically created in SAP HANA Studio when you extend a standard SAP HANA Live view, and the original view isn’t affected when you make any changes in the extended view.

Follow these steps to extend the view:

  1. Log in to the SAP HANA system from SAP HANA Studio.
  2. Under the Content folder, navigate to saphbaeccCalculation Views (see Figure 11.46).
    Navigating to Views Folder

    Figure 11.46    Navigating to Views Folder

  3. Right-click SalesOrderQuery, then select Extend View (see Figure 11.47).
    Extend View

    Figure 11.47    Extend View

  4. Enter the new view name in the Name of Copied View field, then select the package in which you want to save this new view (see Figure 11.48).
    Selecting Replace ViewViewsreplace

    Figure 11.48    Selecting Replace View

  5. The extensibility tool displays all the SAP-delivered reuse views. Upon clicking a view, the tool will display the unused fields.
  6. Select SalesOrderHeader, then choose SalesDistrict to include it in the output (see Figure 11.49).
    Selecting New FieldsNewfield

    Figure 11.49    Selecting New Fields

  7. Click Validate; after the validation completes successfully without any errors, click Activate.
  8. After the activation is complete, the new extension view is created in the package you selected previously (Figure 11.50).
    Activating New ViewNewview

    Figure 11.50    Activating New View

  9. Activate the new calculation view and check whether the data is being populated.

We’ve successfully extended a calculation view by adding a new field and saving it to a new package. Next, you need to activate and create an OData service on the extended view.

11.3.2    Create the OData Service

You now need to create an SAP HANA XS project (see Figure 11.51) and then create an OData file on the extended calculation view. The OData process creation is just as described in Section 11.2.2. Repeat the same steps to create an OData service.

SAP HANA XS Project

Figure 11.51    SAP HANA XS Project

11.3.3    Configure the KPI

The final step in the extension process is to configure and create a KPI tile. The steps to configure a KPI tile are the same as for both the creation and extension scenarios. Follow the same steps to create a new KPI tile based on the new OData service, as described in Section 11.2.3.