Hands-On Document - Step04 - Analytical Query & Web Dynpro Grid
Hands-On Document - Step04 - Analytical Query & Web Dynpro Grid
2
Introduction
The purpose of this hands-on is to understand the creation and use of Analytical Query, a type of CDS view, and how to use the predefined VDM.
The communication protocol commonly used in Fiori applications is OData Service, but only analytical apps use Analytical Queries that
communicate with the Transient Provider. CDS views created as Analytical Queries can be used in the same way as BW queries.
In this Step4, you learn how to create a custom Analytical Query (Consumption View) using a predefined VDM (Interface View). Furthermore, you
also learn how to register the created Analytical Query as a Fiori application.
3
Hands-on exercises
This hands-on consists of the following exercises:
Exercise 1: Review how to investigate Virtual Data Models (VDMs)
Exercise 2: Execute standard Analytical Query “C_GLLINEITEMSQ0001” with T-cd: RSRT and check how it works
Exercise 3: Create an Analytical Query “ZZ1_GLITEMQ_XXX” with Fiori Key User Tool “Custom Analytical Query”
Exercise 4: Create Fiori Multidimensional Reporting Application from “ZZ1_GLITEMQ_XXX” with Launchpad Designer
Optional - Exercise 6: Create an Analytical Query “ZXC_ GLITEMQ_XXX” with ABAP Development Tools
Note: Replace XXX in the hands-on steps with a unique string or assigned number in order not to overlap the technical name within the
S/4HANA system. In this document, all screen shots use "00" (2 digit) as a unique number.
*Multidimensional reporting in Exercise 4 can also be created using BW query as a source. The BPC Optimized for S/4HANA Fiori Multidimensional
Reporting app has created a BW query in its source.
4
Prerequisites
For the following exercises to work satisfactorily, the following needs to be considered.
[PFCG roles] It is assumed that you have the following roles in addition to SAP_ALL profile:
l SAP_BR_ANALYTICS_SPECIALIST
Ø F2170 View Browser
Ø F1572 Custom Analytical Queries
l SAP_BR_EMPLOYEE
Ø F1068 Query Browser
[Tool]
l Web Browser
Google Chrome / Edge (Chromium) / Firefox are recommended.
l (Optional) ABAP Development Tools
In order to do Exercise 6 (Optional), ABAP Development Tools must be installed. If you want to follow Exercise 6 (Optional), refer to the guide
below for installation. Note that if you have already installed ADT in an older version, you do not need to perform this task.
Installing ABAP Development Tools
Chapter 6 “Installation” describes the prerequisites and installation steps.
[User] In this Hands-on content, DEVELOPERXXX is assumed to be used where XXX stands for a pre-assigned 3-digit number. It is assumed
that DEVELOPERXXX have the roles listed above. In the screenshots, “DEVELOPER00” (2 digits) is used to show Hands-on steps. If a user has
PFCG Roles listed above on S/4HANA system, you can go through this Hands-on with the user.
5
Exercise 1: Check the Virtual Data Model
In this exercise, you will see two different Virtual Data Models (predefined CDS views): We will also use the Fiori app F2170 View Browser to
explore VDMs.
l I_GLAccountLineItemCube … it is a VDM, which acts as a data source (Cube) used throughout this hands-on.
l C_GLLineItemsQ0001 … An Analytical Query used in the standard Fiori app F0956A Journal Entry Analyzer.
URL in CAL:
https://vhcals4hcs.dummy.nodomain:44301/
sap/bc/ui2/flp#Shell-home
6
Steps / Comments Screenshots
* PFCG Role
“SAP_BR_ANALYTICS_SPECIALIST“ i
s required
4. For example, if you are looking for “a Enter "G/L" in the search window
data source VDM for G/L Account”, you
might be able to proceed as follows:
A) Enter "G/L" in the search window
B) Click the “Data Category” column
and filter as follows:
7
Steps / Comments Screenshots
data source
8
Steps / Comments Screenshots
9
Steps / Comments Screenshots
10
Exercise 2: Execute an Analytical Query
Analytical Query, one of the types of CDS views, can be used on the front side just like BW queries. Analytical Query allows OLAP operations
such as drill down, slicing, and so on. In this exercise, we run an Analytical Query "C_GLLINEITEMSQ0001" - which is used by Standard Fiori
app F0956 Journal Entry Analyzer – in BW query test transaction T-cd: RSRT. Then perform OLAP operations such as drill down and
understand the characteristics of Analytical Query. Finally, we check the definition of the CDS View which generates the Analytical Query.
Steps / Comments Screenshots
https://fioriappslibrary.hana.ondemand.c
om/sap/fix/externalViewer/#/detail/Apps(
'F0956')/S19OP
Navigate as follows:
IMPLEMENTATION INFORMATION
-> Configuration
-> BEx Query
BEx Query
11
Steps / Comments Screenshots
[WebGUI URL]
https://<hostname>:<Port>/sap/bc/gui/sap/it
s/webgui
[WebGUI URL in CAL]
https://vhcals4hcs.dummy.nodomain:44301/
sap/bc/gui/sap/its/webgui
4. "2CIFIGLLITMCUBE/2CCFIGLLITMQ00
01" is automatically filled in. It means that
the entered query is recognized by the
system.
12
Steps / Comments Screenshots
Result
13
Steps / Comments Screenshots
Result
14
Steps / Comments Screenshots
Result
15
Steps / Comments Screenshots
16
Steps / Comments Screenshots
• @AbapCatalog.sqlViewName:
'CFIGLLITMQ0001'
Defines the name of SQL View. SQL
View is on the database layer and has
different technical name from its CDS
View. If @Analytics.query: true is also
added, the technical name of the
query is defined based on SQL View
name as explained in previous step.
17
Exercise 3: Create Analytical Query using Custom Analytical Queries
In this exercise, you will create an Analytical Query using F1572 Custom Analytical Queries, one of the Key User Extensibility Tools.
Analytical Query is a type of CDS view that allows OLAP operations such as drill down (can be used in the same way as BW queries). In
addition to being able to create Analytical Query in ADT (see Exercise 6), F1572 Custom Analytical Queries is provided as one of the Key
User Extensibility Tools. In this exercise, you will use this tool to create an Analytical Query. In addition to this, this exercise uses the
predefined VDM "I_GLAccountLineItemCube" as the source. It is also intended to understand the creation of content using predefined VDMs.
Steps / Comments Screenshots
*PFCG Role
“SAP_BR_ANALYTICS_SPECIALIST”
is required
18
Steps / Comments Screenshots
19
Steps / Comments Screenshots
7. Add the following fields in the same Selected fields in this step
way:
- Controlling area (ControllingArea)
- Cost center (CostCenter)
- Segment
- G/L account (GLAccount)
- Fiscal year (FiscalYear)
20
Steps / Comments Screenshots
21
Steps / Comments Screenshots
11. Make your filter settings. Press “Filters” and “Fiscal Year”
Press “Filters” to go to the filter settings
screen and select “Fiscal year”.
22
Steps / Comments Screenshots
Result
23
Steps / Comments Screenshots
Result
24
Steps / Comments Screenshots
Publish
17. Execute the Analytical Query you Back to Home and launch Query Browser
created from the Query Browser.
Press the home button, go back to the
home screen, and press “F1068 Query
Browser” from “Query Browser” group.
* PFCG role “SAP_BR_EMPLOYEE” is
required
25
Steps / Comments Screenshots
19. Press “Open for Analysis” to launch You can check the query definition - Press “Open for Analysis” on the right bottom corner.
Fiori Design Studio screen and run
multi-dimensional reports.
26
Steps / Comments Screenshots
27
Steps / Comments Screenshots
21. Launch the saved view from FLP. Back to Home and launch the Tile
Result
28
Steps / Comments Screenshots
22. Check its name of the query. Press gear icon -> Information…
You created the Analytical Query
“ZZ1_GLITEMQ_XXX” explicitly. In fact,
it generates an executable query in the
background with a different technical
name. You must investigate the name
of that generated query to proceed to
next Exercise.
23. Then you can see the Information of the Check your “Query Name” – in this case “2CZZ1_GLITEMQ__1”
Analytical Query. Please take a memo
of your “Query Name”. It will be needed
in the following exercise to create a
Fiori application.
29
Steps / Comments Screenshots
[Comment] What is the naming convention for the query?
When a CDS view is given “@Analytics.query: true”, an executable query is created in the background. The created query has a different
technical name from the CDS View itself. The naming convention of the query is as follows:
2C<SQL View Name of CDS View>
In the case of ZZ1_GLITEMQ_XXX above, the SQL View was named “ZZ1_GLITEMQ__1” automatically. Then, the query name is
"2CZZ1_GLITEMQ__1".
24. Check your query can be executed also Transaction RSRT
from T-cd: RSRT. Start WebGUI and
execute transaction RSRT.
[WebGUI URL]
https://<hostname>:<Port>/sap/bc/gui/sap/its
/webgui
[WebGUI URL in CAL]
https://vhcals4hcs.dummy.nodomain:44301
/sap/bc/gui/sap/its/webgui
25. Specify an object name for the query Enter Query Name
name with the following name:
l 2C<SQLView name of CDS View>
26. Please do not forget to set “WD Grid” Set “WD Grid” on “Query Display” and Execute
on “Query Display” option.
30
Steps / Comments Screenshots
27. Enter “2021” as a Fiscal Year and Enter Fiscal Year and execute
aggregated data is on the screen.
31
Exercise 4: Create Multidimensional Reporting Application
In this exercise, you will create a Fiori Multidimensional Reporting application. Analytical Query created in Exercise 3 can be run from Query
Browser and saved as a tile. However, it cannot be shared with other users yet. To make it available to any user, you need to create a separate
custom tile. You will create tiles in Launchpad Designer, in which you create apps by using the Web Screen Grid screen framework
(FPM_BICS_OVP) and assigning it a query name (2C<SQL View name of CDS View>) as a parameter. Until S/4HANA 1909, a standard
multidimensional report was created with “Fiori Design Studio” that was also run in the Exercise 3, but from 2020 it is basically replaced by a
WebDynpro Grid based application.
Please check the following SAP Blog for details if you are interested. It also explains how to create multi-dimensional analysis apps with Fiori
Design Studio that are not included in this exercise and how to configure them in detail.
How to create custom Fiori Multidimensional Reporting Application in S/4HANA on-premise
In this exercise, Launchpad Designer is used to create a custom Catalog / Tile. You can also use a new Fiori application Manage Launchpad
Business Catalogs to create a custom Catalog as also introduced in Step2. Please refer to the SAP Blog to see more details.
SAP Fiori for SAP S/4HANA – Overview of tools for maintaining custom launchpad content and layout | SAP Blogs
32
Steps / Comments Screenshots
33
Steps / Comments Screenshots
34
Steps / Comments Screenshots
7. Create a Target Mapping for the Target Mapping -> Create Target Mapping
Semantic object/Action(=Intent) you
configured in the tile.
Click on “Target Mapping” tab, then
click on “Create Target Mapping” on
the bottom right of the screen under.
35
Steps / Comments Screenshots
Intent section:
l Semantic Object: MultiTestXXX
l Action: analyze
l Application Type: Web Dynpro
Target section:
l Title: Custom Analytical Query with
WD Grid XXX
l Application: FPM_BICS_OVP
l System Alias: S4FIN (in CAL
system)
Note: Replace XXX with a unique
string or assigned number.
* "FPM_BICS_OVP" is a technical Result:
application name of WebDynpro Grid.
General section:
l Exclude Device Types: Tablet,
Phone
l Parameters:
Ø Name=bsa_query
Ø Defalut Value=2C<SQLView name
of CDS View>
*e.g. 2CZZ1_GLITEMQ__1
36
Steps / Comments Screenshots
37
Steps / Comments Screenshots
13. Go to “User” tab and enter your user Assign your user and Save
ID and Save it.
38
Steps / Comments Screenshots
39
Steps / Comments Screenshots
40
Steps / Comments Screenshots
41
Optional - Exercise 5: Consume Analytical Query from Analysis Office
In this exercise, we will use Analysis Office to consume Analytical Query on S/4HANA and realize multidimensional reporting. The Analytic Query
can be used from the front-end tools in the same way as BW queries, so it can be used in the BusinessObjects tools – like Analysis Office - without
WebDynpro Grid framework.
42
Steps / Comments Screenshots
43
Steps / Comments Screenshots
44
Steps / Comments Screenshots
(e.g.) 2CZZ1_GLITEMQ__1
45
Steps / Comments Screenshots
46
Steps / Comments Screenshots
47
Optional - Exercise 6: Create an Analytical Query Using ADT
In this exercise, we use ADT to create an Analytical Query “ZXC_GLITEMQ_XXX”. Analytical Query is a type of CDS view that is created by
adding “@Analytics.query: true” annotation in the CDS View definition. In the CDS view with this annotation we can add analytic annotations
to make settings specific to analytical scenario. The purpose of this exercise is to understand that Analytical Queries can be created not only
by “Custom Analytical Queries” from Exercise 3, but also created by ADT.
1. Start Eclipse.
48
Steps / Comments Screenshots
3. Choose ABAP
-> Core Data Services
-> Data Definition
and click Next
49
Steps / Comments Screenshots
50
Steps / Comments Screenshots
@AbapCatalog.sqlViewName : 'ZXCGLITEMQXXX'
8. Copy the source code on the right and @Analytics.query: true
paste it into the ADT edit screen. @OData.publish: true
When doing so, Replace XXX with a @EndUserText.label: 'Custom Analytical Query CAQ XXX'
unique string or assigned number. define view ZXC_GLITEMQ_XXX as select from I_GLACCOUNTLINEITEMCUBE
There are three places in total to {
replace. @AnalyticsDetails.query.totals: #SHOW
Also check the following points: @AnalyticsDetails.query.display: #TEXT
@Consumption.filter :{
l @Analytics.query: true is defined selectionType: #SINGLE,
multipleSelections: false,
l You have specified the name of
mandatory: true,
the SQL View on the first line. defaultValue: '2021'
The name here is prefixed with }
2C and a query is generated. @AnalyticsDetails.query.axis:#ROWS
FiscalYear,
@AnalyticsDetails.query.display: #KEY_TEXT
@AnalyticsDetails.query.axis:#ROWS
@AnalyticsDetails.query.displayHierarchy: #ON
@AnalyticsDetails.query.hierarchyInitialLevel: 3
@AnalyticsDetails.query.hierarchyBinding : [
{type :#CONSTANT,value :'YCOA'}
]
GLAccount,
ControllingArea,
Segment,
CostCenter,
AmountInCompanyCodeCurrency
}
51
Steps / Comments Screenshots
52
Steps / Comments Screenshots
Result
53
www.sap.com/contactsap
The information contained herein may be changed without prior notice. Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors. National product
specifications may vary.
These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind, and SAP or its affiliated companies shall not be liable for errors or
omissions with respect to the materials. The only warranties for SAP or SAP affiliate company products and services are those that are set forth in the express warranty statements accompanying such products and services, if
any. Nothing herein should be construed as constituting an additional warranty.
In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related presentation, or to develop or release any functionality mentioned therein. This
document, or any related presentation, and SAP SE’s or its affiliated companies’ strategy and possible future developments, products, and/or platform directions and functionality are all subject to change and may be changed by
SAP SE or its affiliated companies at any time for any reason without notice. The information in this document is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. All forward-
looking statements are subject to various risks and uncertainties that could cause actual results to differ materially from expectations. Readers are cautioned not to place undue reliance on these forward-looking statements, and
they should not be relied upon in making purchasing decisions.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE (or an SAP affiliate company) in Germany and other countries. All other product
and service names mentioned are the trademarks of their respective companies. See www.sap.com/trademark for additional trademark information and notices.