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:
- Log in to SAP Fiori launchpad.
-
Click the Create KPI app under the KPI Design group (see Figure 6.2).
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.
-
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.
- 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.
-
Scroll down to the next section, and select the values by clicking
(see Figure 6.4).
-
The following fields are displayed in Figure 6.4:
- CDS View : This is the source for this Days Sales Outstanding app. Select C_DaysSalesOutstanding.
- OData Service: This is the path of the OData service responsible for aggregating the data. Enter “/sap/opu/odata/sap/C_DAYSSALESOUTSTANDING_CDS”.
- Entity Set: This provides the metadata of the OData service of the SAP HANA calculation view. Enter “C_DAYSSALESOUTSTANDINGResults”.
- Value Measure: Select only one value from this dropdown. Again, select DaysSalesOutstanding.
- Additional Information (optional): You can enter additional information about the data source in this field.
- Semantic Object /Action (optional): You can leave this blank, because you’re using the default drilldown feature of SAP Smart Business apps.
Figure 6.4 Data Source
- After the fields have been filled, click Activate and Add Evaluation.
- 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:
-
Enter the values shown in Figure 6.5 in the Parameters section.
Figure 6.5 Evaluation Parameters
-
Scroll down and verify the Data Source fields. In this section, you have additional options (see Figure 6.6):
-
Scaling Factor: You can select the scaling factor based on the value that you’re expecting:
- Auto: Value is scaled to the available space. (We selected this option.)
- Kilo: Value is displayed in multiples of one thousand.
- Million: Value is displayed in multiples of one million.
- Billion: Value is displayed in multiples of one billion.
- Percent: Value is displayed as a percentage.
- Decimal Precision: You can choose appropriate decimal formats as well. Here, we selected Auto.
Figure 6.6 Evaluation Data Source
-
Scaling Factor: You can select the scaling factor based on the value that you’re expecting:
- 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.
-
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
-
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”
- 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.
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:
-
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).Figure 6.9 Numeric Tile
-
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).Figure 6.10 Deviation Tile
-
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).Figure 6.11 Trend Tile
-
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).Figure 6.12 Comparison Tile
-
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).Figure 6.13 Comparison Tile, Multiple Measures
-
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).
Figure 6.14 Dual Tile
Let’s now look at how to configure a KPI tile, using the numeric tile as an example:
-
After clicking Activate and Configure Tile in the previous steps, you should see the screen shown in Figure 6.15.
Figure 6.15 Configuring Tile
- Enter the following details, as shown in Figure 6.16:
- Click Save.
-
Return to the home screen by clicking
.
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:
-
From SAP Fiori launchpad, click the Configure Drill-Down app (see Figure 6.17).
Figure 6.17 Configure Drill-Down App
- Select the evaluation, and click Configure (see Figure 6.18).
- Follow the below steps to add the first view, Last 12 Months by Customer Country.
- Select Country Key from the Dimension list (see Figure 6.19).
-
Click the Measures tab, select Days Sales Outstanding, and click OK (see Figure 6.19).
Figure 6.18 Configuring Drilldown
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.Figure 6.20 Selected Measures and Dimensions
-
You can sort the dimensions by clicking the Sort Order dropdown list (see Figure 6.21).
Figure 6.21 Dimension Settings
- 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.
-
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).
Figure 6.22 Selecting Visualization Type
Figure 6.23 Additional Visualization Properties
-
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.
Figure 6.24 First View
- 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:
-
Click
, as shown in Figure 6.25.
Figure 6.25 Adding View
-
Select the Company Code from the Dimension list, and click OK (see Figure 6.26).
Figure 6.26 Dimensions
-
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”.
Figure 6.27 View Details
- 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:
-
Click
from the Header section, as shown in Figure 6.28.
Figure 6.28 Adding KPI Header
- Select a Mini Chart; in this example, we selected Actual Vs. Target (see Figure 6.29).
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:
-
Click
to add filters.
-
Select the Display Currency, Customer, and Region filters, and click OK (see Figure 6.30).
Figure 6.30 Selecting Filters
- 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.
Figure 6.31 App-Specific Configuration Details
To assign this role to a specific user in the SAP HANA system, follow these steps:
- Log in to SAP HANA Studio.
- Under the SAP HANA system (HDB SYSTEM), choose Security • Users.
-
Double-click the user name (see Figure 6.32).
Figure 6.32 SAP HANA Users
-
Click the + button on the Granted Roles tab (see Figure 6.33).
Figure 6.33 Granted Roles
-
Search for and then select the sap.hba.r.sfin700.roles::SapSmartBusinessReceivablesManager role, then click OK (see Figure 6.34).
Figure 6.34 Selecting Role
-
Click the Deploy icon
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.
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:
- Log in to SAP Fiori launchpad with the User ID you accessed in the previous steps (see Figure 6.35).
-
Navigate to the ME area by clicking
, and click App Finder
-
Select SAP: KPIs from the catalog dropdown list, as shown in Figure 6.36.
Figure 6.36 SAP KPIs
You should now see the app that you created and activated in earlier steps (see Figure 6.37).Figure 6.37 Days Sales Outstanding Custom App
-
Click the + button, add the app to your My Home group by checking the corresponding box, and then click OK (see Figure 6.38).
Figure 6.38 Adding App to My Home Group
-
Return to the home screen by clicking the
button.
-
You should now see the Days Sales Outstanding app under the My Home group, as shown in Figure 6.39.
Figure 6.39 My Home Group
- Click the app to see the two views you created previously (see Figure 6.40).
- 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.
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:
- Log in to your ABAP front-end server, and run Transaction LPD_CUST.
- Create a new launchpad by clicking the New Launchpad button.
-
Enter the fields as shown in Figure 6.42, and click Confirm.
Figure 6.42 New Launchpad
- Click Yes to ignore the namespace.
- Create a new application by clicking New Application.
- 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).
- Click Show Advanced (Optional) Parameters.
-
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).
Figure 6.44 Application-Related Parameters
- Click Save.
- 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.
- Click Catalogs.
- Create a new catalog by clicking + at the bottom of the screen.
- Enter the Title and the catalog ID shown in Figure 6.45.
- Click Save.
- Select the catalog you created in the previous step.
-
Click the Target Mapping icon
.
- 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):
-
Semantic Object
Represents business entities, such as a product or sales order. You can bundle apps that reflect a specific scenario. In this exercise, we’re specifying a generic semantic object, which allows you to analyze all the semantic objects in a standardized way. -
Action
Defines which operations are performed on the semantic object—for example, displaying a purchase order. Here, display is the action, and the purchase order is the semantic object.
Follow these steps:
-
Enter the details in the Intent section as shown in Figure 6.46.
Figure 6.46 Intent and Target
- In the Target section, enter the details of the custom launchpad you created previously.
- Click Save.
-
Select the Group tab in the SAP Fiori launchpad designer, and then create a new group by clicking
at the bottom of the screen.
- Enter the group Title and the group ID shown in Figure 6.47, and click Save. You should now see the new group created in the SAP Fiori launchpad designer.
-
Add a tile by clicking on the tile with the + sign (see Figure 6.48).
Figure 6.48 Adding Tile to Group
- Click the Search icon to search the catalog.
-
Select the SAP: KPIs catalog from the list, as shown in Figure 6.49.
Figure 6.49 SAP KPIs Catalog
-
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.
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:
- Log in to your ABAP front-end server, and run Transaction PFCG.
-
Enter the Role name “Z_ROLE_SM”, and click Single Role (see Figure 6.51).
Figure 6.51 Create Custom Role
- Enter the Description, and click Save.
- Click the Menu tab, then select Catalog from the Transaction button dropdown menu (see Figure 6.52).
- 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.
-
Add a group you created by selecting SAP Fiori Tile Group from the dropdown menu (see Figure 6.54).
Figure 6.54 Assigning Group Catalog to Role
- To search for your group, click the Search button next to the Group ID.
-
Select the Z_GRP_CM1 group from the pop-up window (see Figure 6.55). Click Execute.
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).
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:
- Select the User tab.
-
Enter the User ID, and click Save (see Figure 6.57).
Important!
All users must be assigned to the generic KPI framework role /UI2/SAP_KPIFRW5_TCR_S. For more information, refer to Chapter 2, Section 2.6.4.
-
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)
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.