6.3    Analytical Apps with the SAP Smart Business Modeler

The SAP Smart Business Modeler is a tool delivered as part of the SAP Smart Business suite. This tool allows you to model KPIs and report tiles that enable targeted monitoring of key business data using SAP Fiori launchpad.

You can define KPIs and reports in the SAP Smart Business modeler to which you can apply different evaluations so that you can respond to the ever-changing business landscape. You can even add additional perspectives on the relevant data with drilldown views that are accessed through the KPI tile.

Analytical apps using the SAP Smart Business modeler are launched via KPI tiles. The Days Sales Outstanding app allows users to filter and drill down by various dimensions, then check the days sales outstanding data by customer country and company code. As you did in Chapters 4 and 5 for transactional and fact sheet apps, refer to the SAP Fiori apps reference library for information about the app that you’ll be implementing in the next section.

Now, we’ll show you step-by-step instructions for how to create a Days Sales Outstanding analytical app using the SAP Smart Business modeler and how to add a drilldown from the KPI tile. The first step is to create a KPI.

6.3.1    Create the KPI

Create a KPI by following these steps:

  1. Log in to SAP Fiori launchpad.
  2. Click the Create KPI app under the KPI Design group (see Figure 6.2).
    Create KPI

    Figure 6.2    Create KPI

    KPI Design Group

    If you don’t see the KPI Design group in SAP Fiori launchpad, refer to Chapter 2, Section 2.6.4, and grant user access to KPI Design.

  3. In the next screen, you need to fill in the following mandatory details about the KPI (see Figure 6.3):
    • Title: Enter a meaningful name, which will appear in the tile header at runtime. Here, we entered “Days Sales Outstanding (KPI)”.
    • Additional Languages (optional): To create a KPI tile in different language, select a language from the list.
    • Description (optional): Enter “Total Days Sales Outstanding for the last 12 months”.
    • Goal Type: This indicates which kind of KPI value is meaningful for the application. Choose from three options:
      • Maximizing (Higher is better): The higher, the better—for example, profit-related KPI values.
      • Minimizing (Lower is better): The lower, the better—for example, cost-related KPI values.
      • Target (Closer to target is better): The closer value is to the target, the better—for example, attrition rate.
      Here, we chose Minimum (Lower is better).
    • Tags (optional): Enter these to search more easily for your KPI.
    • Owner Name (optional): Enter the name of the person responsible for executing the KPI.
    • Owner ID And Email (optional): Enter the details of the owner.
    KPI ParametersKPIparameters

    Figure 6.3    KPI Parameters

  4. Scroll down to the next section, and select the values by clicking inline image (see Figure 6.4).
  5. The following fields are displayed in Figure 6.4:
    Data Source

    Figure 6.4    Data Source

  6. After the fields have been filled, click Activate and Add Evaluation.
  7. In the next screen you can either assign the changes to a transport, or save it as a Local Object.

6.3.2    Create Evaluations for the KPI

An evaluation defines what information about the KPI or report is visible to the user at runtime. It’s a combination of variants/filters, thresholds, parameters, trends, and authorizations that are applied to a KPI or a report. You can create and activate evaluations for KPIs or OPIs, and several different evaluations can be applied to a single KPI or report.

Let’s now create evaluations for the KPIs. Follow these steps:

  1. Enter the values shown in Figure 6.5 in the Parameters section.
    Evaluation Parameters

    Figure 6.5    Evaluation Parameters

  2. Scroll down and verify the Data Source fields. In this section, you have additional options (see Figure 6.6): All the values that are configured in tiles, drilldowns, and tables for all measures of the selected evaluation are formatted by Decimal Precision. Only two decimal places are displayed to the right of the decimal point when the measure represents currency.
    Evaluation Data Source

    Figure 6.6    Evaluation Data Source

  3. Next, you need to add variants/input parameters. A variant is a set of filter settings and input parameters that you define to achieve a particular perspective on a KPI or a report. Variants can be created without reference to a specific KPI or report because they’re global in nature.
  4. Scroll down to the Input Parameters and Filters section. Add the input parameters expected in the calculation view (see Figure 6.7):
    • Display Currency Equal to (=) USD
    • Exchange Rate Type Equal to (=) M
    • Months for Calculation of Rolling Average for Receivables Equal to (=) 1
    • Months for Calculation of Rolling Average for Revenue Equal to (=) 1
    Input Parameters and FiltersInput parameters

    Figure 6.7    Input Parameters and Filters

  5. Next, you need to add the Target, Thresholds, and Trend values. The thresholds defined for the KPI evaluation are determined by the Goal Type you selected for the KPI earlier in Figure 6.3:
    • Critical: Enter “100”
    • Warning: Enter “30”
    • Target: Enter “10”
    Critical, Warning, and Target values are the threshold values of a KPI. These depend on the goal type selected previously. For example, if you select Lower is Better, then your Critical and Warning values should be high. Therefore, when the KPI value is above 100, the KPI value color turns red, and when the KPI value is below 29, the KPI value color turns green. When the color is yellow, this indicates that the KPI has a value between 30 and 99 (see Figure 6.8).
  6. Click Activate and Configure Tile.

You’ve now successfully created the KPI with the evaluation and activated the evaluation. In the next step, you’ll configure the KPI tile.

Target, Thresholds, and Trend

Figure 6.8    Target, Thresholds, and Trend

6.3.3    Configure the KPI Tile

A KPI tile is the graphical representation of the evaluation of the KPI, which is visible to the user at runtime. The KPI is displayed in a tile. When you click the tile in SAP Fiori launchpad, you’ll be able to drill down into the details. There are six types of KPI tiles:

  1. Numeric tile
    The aggregated value of the KPI measure of the evaluation that you created in
    Section 6.3.2 is displayed in the tile. In this tile, data is displayed in numeric format. The color of the value displayed depends on the threshold values, which you created with critical and warning values (see Figure 6.9).
    Numeric Tile

    Figure 6.9    Numeric Tile

  2. Deviation tile
    In this tile, data is displayed graphically in the form of a bullet chart that shows the current value of the KPI in relation to the target value and its thresholds (see
    Figure 6.10).
    Deviation Tile

    Figure 6.10    Deviation Tile

  3. Trend tile
    For this title, data is displayed graphically in the form of a line chart showing the trend over time. You must enter a time dimension representing a duration to visualize this tile (see
    Figure 6.11).
    Trend Tile

    Figure 6.11    Trend Tile

  4. Comparison tile
    With this tile, you select a dimension to show the top KPI values in comparison to each other. For example, if you select Country as a dimension, you’ll see a comparison of the values for the countries contributing to this KPI (see
    Figure 6.12).
    Comparison Tile

    Figure 6.12    Comparison Tile

  5. Comparison tile, multiple measures
    This tile is like the comparison tile, but instead of comparing dimensions, you compare different measures. You can select a maximum of three measures and must select at least two measures for this tile (see
    Figure 6.13).
    Comparison Tile, Multiple Measures

    Figure 6.13    Comparison Tile, Multiple Measures

  6. Dual tile
    This tile shows two tile types in a single tile. The left part of this tile always displays the numeric tile; on the right side, you can select any chart that’s supported (see
    Figure 6.14).
Dual Tile

Figure 6.14    Dual Tile

Let’s now look at how to configure a KPI tile, using the numeric tile as an example:

  1. After clicking Activate and Configure Tile in the previous steps, you should see the screen shown in Figure 6.15.
    Configuring Tile

    Figure 6.15    Configuring Tile

  2. Enter the following details, as shown in Figure 6.16:
    Tile ParametersTilesparameters

    Figure 6.16    Tile Parameters

  3. Click Save.
  4. Return to the home screen by clicking inline image.

That’s it! You’ve successfully created a KPI tile. Now users will see this KPI tile in SAP Fiori launchpad. The next step is to create a generic drilldown so that when users click on the tile they will see the detail level. A drilldown can be a generic drilldown application, which we’ll be covering in the next section, or it can even be a drilldown to another application, such as SAP Lumira or a custom application.

6.3.4    Configure the KPI Drilldown

When you click on a KPI tile, it will take you to a drilldown application. This functionality is configured using the Configure Drill-Down app. You can create your own drilldown applications with different kinds of charts, tables, and filters, and you can customize them with different colors as well. A drilldown application contains views with tables and charts. In this section, we’ll look at configuring the KPI drilldown by creating views, configuring the KPI header, and creating filters.

Create Views

In this section, we’ll show you how to create views using the dimensions and measures from the KPI evaluation. Follow these steps:

  1. From SAP Fiori launchpad, click the Configure Drill-Down app (see Figure 6.17).
    Configure Drill-Down App

    Figure 6.17    Configure Drill-Down App

  2. Select the evaluation, and click Configure (see Figure 6.18).
  3. Follow the below steps to add the first view, Last 12 Months by Customer Country.
  4. Select Country Key from the Dimension list (see Figure 6.19).
  5. Click the Measures tab, select Days Sales Outstanding, and click OK (see Figure 6.19).
    Configuring Drilldown

    Figure 6.18    Configuring Drilldown

    Selecting Dimensions and MeasuresDimensions

    Figure 6.19    Selecting Dimensions and Measures

    You should now see the dimension and the measure that you selected, as shown in Figure 6.20.
    Selected Measures and Dimensions

    Figure 6.20    Selected Measures and Dimensions

  6. You can sort the dimensions by clicking the Sort Order dropdown list (see Figure 6.21).
    Dimension Settings

    Figure 6.21    Dimension Settings

  7. In addition, you can configure views to provide additional insights into the KPI data. You can add a chart, add a table, or add both. The available visualization types are Bar chart, Column chart, Line chart, Columns and Lines combination chart, Bubble chart, Table, and Donut chart, as shown in Figure 6.22.
  8. You can further configure the charts by choosing different color schemes, selecting single or dual axis, and formatting the value displayed in the chart (see Figure 6.23).
    Selecting Visualization TypeVisualization

    Figure 6.22    Selecting Visualization Type

    Additional Visualization Properties

    Figure 6.23    Additional Visualization Properties

  9. As shown in Figure 6.24, enter or select the following fields:
    • Visualization Type: Select the type of visualization that you want to add to the view. Here, we selected Column.
    • View Title: Enter “Last 12 Months by Customer Country”.
    • View Title: This view name will be visible to the user during runtime. Select Last 12 Months by Customer Country.
    • Set Data Limit (optional): You can set the maximum number of records that can be retrieved during runtime.
    • Data: You can develop a view with the dummy data as well. Select Actual Back-end Data.
    First View

    Figure 6.24    First View

  10. Click OK.
Drilldown Application

You don’t need to activate the drilldown application; changes are available immediately, as soon as you save the application.

We’ve successfully created the Last 12 Months by Customer Company view. You can create several views and switch between different views during runtime.

Let’s add one more view: Days Sales Outstanding by Company Code. Follow these steps:

  1. Click inline image, as shown in Figure 6.25.
    Adding View

    Figure 6.25    Adding View

  2. Select the Company Code from the Dimension list, and click OK (see Figure 6.26).
    Dimensions

    Figure 6.26    Dimensions

  3. Select or enter the following details, as shown in Figure 6.27:
    • Visualization Type: Choose Column.
    • View Title: Enter “Last 12 Months by Company Code”.
    View Details

    Figure 6.27    View Details

  4. Click Ok.

With these views, you can analyze data in several formats and with different selection criteria to allow for better insight into the business processes from different perspectives.

Configure the KPI Header

In the previous section, you created two views in the drilldown app. The next step in this process is to configure the KPI header, the header area of the KPI drilldown app. You can add mini charts in the header section, and these mini charts can be created on multiple measures. To configure the header, follow these steps:

  1. Click inline image from the Header section, as shown in Figure 6.28.
    Adding KPI Header

    Figure 6.28    Adding KPI Header

  2. Select a Mini Chart; in this example, we selected Actual Vs. Target (see Figure 6.29).
Selecting Mini ChartMini chart

Figure 6.29    Selecting Mini Chart

Create Filters

The next available option is to create filters. You can specify up to five filters that allow you to look at the drilldown data from different perspectives. Follow these steps:

  1. Click inline image to add filters.
  2. Select the Display Currency, Customer, and Region filters, and click OK (see Figure 6.30).
    Selecting Filters

    Figure 6.30    Selecting Filters

  3. Click Save Configuration.

You’ve now successfully created a numeric KPI tile with an evaluation and created a drilldown with two views. The KPI tile is now ready to be made available to users on SAP Fiori launchpad.

6.3.5    Assign Roles to Users to Access SAP HANA Data

Users launch analytical apps from SAP Fiori launchpad, then SAP Web Dispatcher directs the OData request from the client to SAP HANA XS. Both the data and the KPI definitions are stored in the SAP HANA system. Therefore, for users to access the data and the KPI definitions from the SAP HANA system, you need to ensure that they’re given the correct access rights.

In Chapter 2, we gave you an overview of the SAP Fiori architecture with the SAP HANA XS landscape. SAP HANA XS contains the SAP Fiori app content, KPI modeling framework, generic drilldown, and VDM reuse content. SAP HANA XS reads data from the SAP HANA database. Using the OData services that require authorizations (i.e., SAP HANA privileges), these privileges are grouped together in roles, and these roles are assigned to SAP HANA database users.

There are certain generic roles that must be assigned to all users. In Chapter 2, we discussed these roles in greater detail. In addition to generic roles, SAP delivers a role for each analytical app, which includes all app-specific privileges as well. For users who need access to a specific app, you need to assign the correct app-specific role to the user.

SAP HANA Role

For more information on the SAP HANA role for a specific app, refer to the app-specific documentation.

Figure 6.31 shows the Days Sales Outstanding app-specific role that has to be assigned to a user for the user to read the KPI data from the SAP HANA system.

App-Specific Configuration Details

Figure 6.31    App-Specific Configuration Details

To assign this role to a specific user in the SAP HANA system, follow these steps:

  1. Log in to SAP HANA Studio.
  2. Under the SAP HANA system (HDB SYSTEM), choose SecurityUsers.
  3. Double-click the user name (see Figure 6.32).
    SAP HANA Users

    Figure 6.32    SAP HANA Users

  4. Click the + button on the Granted Roles tab (see Figure 6.33).
    Granted Roles

    Figure 6.33    Granted Roles

  5. Search for and then select the sap.hba.r.sfin700.roles::SapSmartBusinessReceivablesManager role, then click OK (see Figure 6.34).
    Selecting Role

    Figure 6.34    Selecting Role

  6. Click the Deploy icon inline image to save the changes.

You’ve successfully enabled the user to access data from the SAP HANA database.

6.3.6    Enable the App for Access in SAP Fiori Launchpad

After the ICF service is activated, the next step is to assign authorizations to the user to access the SAP KPI catalog in SAP Fiori launchpad. By now, you know that SAP Fiori launchpad is the entry point for SAP Fiori apps. For users, SAP Fiori launchpad displays the apps that have been assigned to the catalog designated for a user’s role. Therefore, users who have the role SAP_KPIFRW5_TCR_S assigned to their user IDs will have access to the KPI’s catalog.

Via Transaction PFCG (Role Maintenance), you can grant access to a user to the role SAP_KPIFRW5_TCR_S. This role allows the user to view all the analytical apps that are activated using the SAP Smart Business modeler. Refer back to Chapter 4, Section 4.3.3 for a refresher on how to assign roles to a user. Figure 6.35 shows the role assigned to an end user using Transaction PFCG.

Adding User to Role

Figure 6.35    Adding User to Role

You’ve successfully assigned the SAP standard role to a user, who now has access to all the analytical apps. You created the Days Sales Outstanding app with the SAP Smart Business modeler, and all the analytical apps that are created using the SAP Smart Business modeler are automatically added to the predefined KPI catalog in SAP Fiori launchpad. After you activate the app in the SAP Smart Business modeler, it’s automatically added to the KPI Catalog category.

Follow these steps to add the app to SAP Fiori launchpad:

  1. Log in to SAP Fiori launchpad with the User ID you accessed in the previous steps (see Figure 6.35).
  2. Navigate to the ME area by clicking inline image, and click App Finder
  3. Select SAP: KPIs from the catalog dropdown list, as shown in Figure 6.36.
    SAP KPIs

    Figure 6.36    SAP KPIs

    You should now see the app that you created and activated in earlier steps (see Figure 6.37).
    Days Sales Outstanding Custom App

    Figure 6.37    Days Sales Outstanding Custom App

  4. Click the + button, add the app to your My Home group by checking the corresponding box, and then click OK (see Figure 6.38).
    Adding App to My Home Group

    Figure 6.38    Adding App to My Home Group

  5. Return to the home screen by clicking the inline image button.
  6. You should now see the Days Sales Outstanding app under the My Home group, as shown in Figure 6.39.
    My Home Group

    Figure 6.39    My Home Group

  7. Click the app to see the two views you created previously (see Figure 6.40).
    Days Sales Outstanding App with Custom ViewsCustomview

    Figure 6.40    Days Sales Outstanding App with Custom Views

  8. Toggle between the table view and the chart view by clicking the buttons above the chart. In addition, you can zoom in, zoom out, or view the app full screen by using the buttons shown in Figure 6.41.
View Features

Figure 6.41    View Features

You should now understand the basics of creating an analytical app with the SAP Smart Business modeler and how to grant access to users. In the next section, we’ll discuss a more advanced topic: assigning an app using a custom role.

6.3.7    Assign the App Using a Custom Role

In a real-world scenario, you wouldn’t want to give access to all analytical apps to your users (i.e., any user assigned to the SAP_KPIFRW5_TCR_S role will have access to all the apps). In this section, we’ll show you how to create a custom catalog and role to give access to specific analytical apps in SAP Fiori launchpad.

In Chapter 4, Section 4.6, we discussed how to create a custom catalog and custom role for a transactional app. You’ll be following a similar process for nonsmart analytical apps.

To enable your app with custom roles and catalogs, you must complete the following steps:

  1. Log in to your ABAP front-end server, and run Transaction LPD_CUST.
  2. Create a new launchpad by clicking the New Launchpad button.
  3. Enter the fields as shown in Figure 6.42, and click Confirm.
    New Launchpad

    Figure 6.42    New Launchpad

  4. Click Yes to ignore the namespace.
  5. Create a new application by clicking New Application.
  6. Enter “Days Sales Outstanding (KPI)” in the Link Text field. From the Application Type dropdown list, select URL. Click the Edit button next to the URL input box. Enter “/sap/bc/ui5_ui5/sap/ca_kpi/drilldown/” in the URL box (see Figure 6.43).
    App ParametersAppparameters

    Figure 6.43    App Parameters

  7. Click Show Advanced (Optional) Parameters.
  8. Click the Edit button next to the Application Alias input box. Enter “analyzeKPIDetails” in the box. Enter “SAPUI5.Component=drilldown” in the Additional Information box (see Figure 6.44).
    Application-Related Parameters

    Figure 6.44    Application-Related Parameters

  9. Click Save.
  10. Log in to the SAP Fiori launchpad designer at http://hostname:port/sap/bc/ui5_ui5/sap/arsrvc_upb_admn/main.html20?sap-client=120&scope=CUST.
  11. Click Catalogs.
  12. Create a new catalog by clicking + at the bottom of the screen.
  13. Enter the Title and the catalog ID shown in Figure 6.45.
    Create CatalogCatalog

    Figure 6.45    Create Catalog

  14. Click Save.
  15. Select the catalog you created in the previous step.
  16. Click the Target Mapping icon inline image.
  17. Click Create Target Mapping.

In the next steps, you’ll define the target mapping, but before that, let’s explore some of the components of target mapping.

An intent allows users to perform actions on semantic objects. In this example, we choose *, which means we want to navigate to all the analytical apps and analyze all the details. The Intent area of the screen lets you perform actions without worrying about the technical part of the navigational target.

Intent has the following components (see Figure 6.46):

Follow these steps:

  1. Enter the details in the Intent section as shown in Figure 6.46.
    Intent and Target

    Figure 6.46    Intent and Target

  2. In the Target section, enter the details of the custom launchpad you created previously.
  3. Click Save.
  4. Select the Group tab in the SAP Fiori launchpad designer, and then create a new group by clicking inline image at the bottom of the screen.
  5. Enter the group Title and the group ID shown in Figure 6.47, and click Save.
    Create GroupGroup

    Figure 6.47    Create Group

    You should now see the new group created in the SAP Fiori launchpad designer.
  6. Add a tile by clicking on the tile with the + sign (see Figure 6.48).
    Adding Tile to Group

    Figure 6.48    Adding Tile to Group

  7. Click the Search icon to search the catalog.
  8. Select the SAP: KPIs catalog from the list, as shown in Figure 6.49.
    SAP KPIs Catalog

    Figure 6.49    SAP KPIs Catalog

  9. You’ll now see all the KPI tiles that have been modeled using the SAP Smart Business modeler. Select the Days Sales Outstanding (KPI) app by clicking + at the bottom of the tile, as shown in Figure 6.50.
    Adding App to Group

    Figure 6.50    Adding App to Group

You should now see the Days Sales Outstanding app added to your group in the SAP Fiori launchpad designer.

You’ve successfully created a custom catalog, created a custom group, and assigned the Days Sales Outstanding app to the group. The next step is to create a custom role and add the category and group to the role. Follow these steps:

  1. Log in to your ABAP front-end server, and run Transaction PFCG.
  2. Enter the Role name “Z_ROLE_SM”, and click Single Role (see Figure 6.51).
    Create Custom Role

    Figure 6.51    Create Custom Role

  3. Enter the Description, and click Save.
  4. Click the Menu tab, then select Catalog from the Transaction button dropdown menu (see Figure 6.52).
    Assigning Tile Catalog to RoleTilescatalog

    Figure 6.52    Assigning Tile Catalog to Role

  5. Enter “Z_SMGR_CATALOG” in the Catalog ID field, and click Confirm (see Figure 6.53). This is the ID of the catalog you created previously.
    Catalog IDCatalogID

    Figure 6.53    Catalog ID

  6. Add a group you created by selecting SAP Fiori Tile Group from the dropdown menu (see Figure 6.54).
    Assigning Group Catalog to Role

    Figure 6.54    Assigning Group Catalog to Role

  7. To search for your group, click the Search button next to the Group ID.
  8. Select the Z_GRP_CM1 group from the pop-up window (see Figure 6.55). Click Execute.
    Group ID

    Figure 6.55    Group ID

You’ve successfully created the custom role. Your role should now show both the category and group (see Figure 6.56).

Role Menu with Catalog and Group

Figure 6.56    Role Menu with Catalog and Group

The last step in this process is to assign the custom role to the user. Follow these steps:

  1. Select the User tab.
  2. Enter the User ID, and click Save (see Figure 6.57).
    Assigning UserUser

    Figure 6.57    Assigning User

  3. Log in to SAP Fiori launchpad with the user ID that you assigned to the role, and you should see the Days Sales Outstanding (KPI) app under the Sales Managers Group (see Figure 6.58)
    Days Sales Outstanding (KPI) App

    Figure 6.58    Days Sales Outstanding (KPI) App

In this section, we explored how to provide user access to analytical apps using both an SAP standard role and a custom role. You’ve successfully created a KPI tile, completed the front-end tasks, and created user authorizations.