Skip to Content
Technical Articles
Author's profile photo Soren Hansen

Embedded Analytics: From CDS to Fiori LaunchPad

Have you ever wandered how you got your CDS view with the annotation @Analytics.query: true to be displayed on the Fiori Launchpad? Well here is an example on how to use the “design studio” app that pops up with the View and Query Browser. Keep in mind that embedded analytics is not only this very simple app, but it does provide some basic functionality that can be very useful.

Prerequest: You have access to the Fiori Catalog you have created it or someone have done this for you (mine is called “Z_Stories”) here you would like to create a tile accessing the CDS Query View. You will also need access to the Fiori Catalog “SAP_TC_CA_SSB_COMMON” and access to the Fiori Launchpad with scope=CUST

Step by step creating a tile for a CDS Query

Step 1: Open the Fiori Launchpad (FLP) for development

http://<host>:<port>/sap/bc/ui5_ui5/sap/arsrvc_upb_admn/main.html?sap-client=<client>?scope=CUST

Step 2: Create a target mapping for your analytical query

  1. Locate the SAP Catalog “SAP_TC_CA_SSB_COMMON
  2. Switch to the tab “Target Mapping” and find the Semantic object: “AnalyticQuery” and the action “analyze
  3. In the bottom find the action “Create Reference” and push in the selection window find your Catalog “Z_Stories” where your analytical query will go

Step 3: Create a Tile in your catalog 

  1. In the left overview of Catalog, locate your catalog (“Z_Stories”) and select it
  2. go to “Tile” tab
  3. Select the kind of tile you would like to create

Step 4: Maintain the information for the tile

  1. Add title, Subtitle, key words and icon
  2. Maintain the service for Dynamic Data (nope you have to lookup how to do this somewhere else)
  3. Maintain the setting for Navigation
    – Check the “Use semantic object navigation” flag
    – Semantic Object “AnalyticQuery
    – Action “analyze
    – Parameters: XQUERY=2C<SQLViewname of CDS view>
  4. Lower right corner press “Save

Step 5: Test the output

go to the FLP and assign the Tile to a group by editing the Home page. The Tile is available under the catalog you created it in. Press the tile

How can the output be influenced by parameters?

The parameter XQUERY is used to identify the CDS view that will be shown in the cross-tab. But it is possible to use another set of parameter to influence what must happen when the tile is pressed

XQUERY

Used to tell what CDS query to be displayed – Use the SQLView name of the CDS view prefixed with 2C => 2C<SQLVIEWNAME>

XPROMPT

By default any missing mandatory parameter will cause the prompt for input parameter to be shown. Missing optional parameter will not do this. Using the parameter XPROMPT=X will cause the prompt for parameter to be display always

Navigation Parameters

If selection parameter f.x. CompanyCode is defined as a prompt using the annotation @Consumption.filter.selectionType: #SINGLE you can add the value to the URL

XQUERY=2C<CDS>&CompanyCode=1000&XPROMPT=X

Would cause the query prompt to show with a value already added for the Selection of CompanyCode (naming CDS view) or with the XPROMPT=X will start the query with the selection for CompanyCode to be only ‘1000’

XDISPLAY

Can have three different values: TABLE, CHART or CHART_TABLE if the CHART is used the data is displayed as a chart – CHART_TABLE means that a chart is showed at the top with a table below of the same information

Alongside the XDISPLAY the parameter XCHARTTYPE can be used to control what chart type is used (corresponding to the chart type that can be selected)

XCHARTTYPE=<PIE|COLUMN|BAR|LINE|STACKED_COLUMN| STACKED_BAR|AREA|HORIZONTAL_AREA>

NAV_INITIAL_STATE

Use to force a navigational state previously saved as a variant. Use the drop-down in the top left corner next to “Standard” to create and manage variants.

XDATALIMIT_ROWS, XDATALIMIT_COLS

Use to limit the maximum number of rows and columns

2557541 – Configuration of amount of data to retrieve from server

Hope this is helpful
/Hansen

Assigned Tags

      6 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Klaus Köbler
      Klaus Köbler

      Hi Soren,

      I am struggling with the parameter NAV_INITIAL_SATE.

      I created a CDS Query and it is working when staring it with the Design Studio Grid in the Fiori Launchpad. The semantic Object is ZRMLatestLosses.

      Parameter XQUERY=2CXXXXX is accepted and the default view is defined it in the ABAP CDS Query by using annotations.

      After that I created a public variant (RMLatestLosses) and assigned it to a transport request and added the variant name with the parameter NAV_INITIAL_SATE.

      The variant and the parameter NAV_INITIAL_SATE are appearing in the URL which looks like this:

      https://<host>:8443/sap/bc/ui2/flp#ZRMLatestLosses-analyze?NAV_INITIAL_STATE=RMLatestLosses&P_DisplayCurrency=EUR&P_ExchangeRateType=M&FinancialYear=2019&sap-xapp-state=AS8QD0EE8DHO8E52R8IS5N9H4PFGDI0ALF0SNGED&/sap-iapp-state=ASXEZO74G2709MCXIXVN79QSDPZ0UOV9US4O8CYT

      but the browser does not react.

      As you might noticed the query has parameters and additionally I want to skip the parameter screen.

      This is also not working - no idia how to use parameter XPROMPT=X.

      Thanks in advance and Regards

      Klaus

       

       

      Author's profile photo Pawel Tscherkaschin
      Pawel Tscherkaschin

      Hello klaus,

      were you able to find a solution for your question regarding NAV_INITIAL_SATE?
      I am also looking for a solution how to dictate via URL which saved variant should be used.

      Author's profile photo Klaus Köbler
      Klaus Köbler

      Hi Pawel, sry, still no solution for that regards Klaus

      Author's profile photo Soren Hansen
      Soren Hansen
      Blog Post Author

      Hi Klaus!

      Sorry for the late answer - I had to look fare and wide for the answer... the NAV_INITIAL_STATE parameter have no longer any effect - sorry

      Søren

      Author's profile photo Raju Venkata
      Raju Venkata

      is it possible to add semantic object navigation inside query browser data Eg:- in query browser on click of GL No/Description it should go to GL Line item Standard apps

      Author's profile photo Soren Hansen
      Soren Hansen
      Blog Post Author

      Hi Raju

      There is no easy way - I've used the - https://blogs.sap.com/2018/09/03/report-to-report-interface-rri/. This will allow you to create the a new type as target for a jump-to that is processed in a user-exit. Here you can create the URL that will jump to a FIORI target with the parameters of the object that have been chosen. The standard menu for GOTO will contain the implemented jump-to-target

      Best

      Søren