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:
-
SAP HANA layer
This layer is extended when the back-end content required for the analytical app extension is available in the SAP HANA models, but isn’t exposed to the OData service. -
UI layer
This layer is extended when the back-end content is exposed to the OData service later, but isn’t exposed in the analytical app.
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:
- Open SAP HANA Studio.
-
Go to Help • Install New Software from the menu bar (see Figure 11.40).
Figure 11.40 Installing New Software
- Enter the following URL to access the tools, then click Add: >http://<HANAServer>:80<HANAInstance>/sap/hba/tools/extn.
-
Select SAP HANA Live Extensibility and then click Next (see Figure 11.41).
Figure 11.41 SAP HANA Live Extensibility
- Click Next.
-
Select the radio button to accept the terms of the license agreement, then click Finish (see Figure 11.42).
Figure 11.42 Accept License Agreement
-
Click OK in the security warning pop-up window (see Figure 11.43).
Figure 11.43 Security Warning Message
-
Click Yes to restart SAP HANA Studio for the changes to take effect (see Figure 11.44).
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:
- Log in to the SAP HANA system from SAP HANA Studio.
- Navigate to the Security folder. From the Users folder, double-click the user name of the user who needs access to the extensibility tool.
- Add the following role in the Granted Roles tab: sap.hba.tools.extn.roles::Extensi-bilityDeveloper (see Figure 11.45).
- 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.
-
Click
.
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:
- Log in to the SAP HANA system from SAP HANA Studio.
-
Under the Content folder, navigate to sap • hba • ecc • Calculation Views (see Figure 11.46).
Figure 11.46 Navigating to Views Folder
-
Right-click SalesOrderQuery, then select Extend View (see Figure 11.47).
Figure 11.47 Extend View
- 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).
- The extensibility tool displays all the SAP-delivered reuse views. Upon clicking a view, the tool will display the unused fields.
- Select SalesOrderHeader, then choose SalesDistrict to include it in the output (see Figure 11.49).
- Click Validate; after the validation completes successfully without any errors, click Activate.
- After the activation is complete, the new extension view is created in the package you selected previously (Figure 11.50).
- 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.
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.