Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member182874
Active Contributor

Requirement: Show dynamic information of the Fiori/ Fiori-Like application on Fiori Tiles.

As we know that there are different types of tile in Fiori, if we go with Transactional apps, we have Static Tile and Dynamic Tile. Or in Fiori standards these are called as Static App launchers tiles or Dynamic App launcher Tiles. We have News Tile as well, but that has nothing to do with this requirement

There are 2 workarounds:

1. Create an OData service which will show real time data and at every refresh the Tile will show dynamic numbers.

2. Create a custom tile, which can populate dynamic data. (Hosting on standard launch page/Launchpad not possible. Either extend the Launchpad UI application or create a custom Launchpad.)

First option is the best and low cost method.

You can also visit this page for information on what are the properties that can be used for Odata service to be configured for tile configuration Service URL.

Reference:

http://help.sap.com/saphelp_uiaddon10/helpdata/en/92/dda11afc814a538a8ec626f4a74c8d/content.htm

In contrast to regular (static) app launcher tiles, the information that is displayed on a dynamic app launcher tile can be pulled from a back-end system using an OData service

The dynamic information pulled from the back-end overwrites the configuration values given in the tile configuration. Some tile functionality (for example, the state arrow) can only be configured by dynamic information (and not in the tile configuration).

Parameter

Description

Service URL

URL of an OData service from which data should be read.

The response is expected in JSON format.

When the service is called, the values that are provided by the service override the values that have been configured manually in the tile details.

Note that the service is executed on the home page only. On the admin page, sample data is displayed instead.

Tip: If you only want to read a number of entities dynamically from an OData service, and read all other content for the app launcher statically from the configuration, you can use the $count parameter in the service URL.

Refresh Interval

Number of seconds after which dynamic content is read from the data source again and the display is refreshed.

The Launchpad uses a default of 10 seconds unless you enter a higher value in this field.

The Launchpad will fall back to 10 seconds, if the value entered is > 0 and < 10. If the value entered is 0, the dynamic tile is updated only once on load. If the value is >= 10, the value is taken as refresh interval.

OData Structure for Dynamic App Launchers

In order to feed an app launcher with dynamic content, you have to create an OData service that returns the configuration properties as in the following example structure:

{

                "d": {

"icon": "sap-icon://travel-expense",

"info": "Quarter Ends!",

"infoState": "Critical",

"number": 43.333,

"numberDigits": 1

                               “numberFactor”: “k”,

"numberState": "Positive",

"numberUnit": "EUR",

"stateArrow": "Up",

"subtitle": "Quarterly overview",

"title": "Travel Expenses",

                     }

}

  1. So as you see, these are the properties which you may look forward to show on your fiori tiles, which also shows the place where the desired info will appear

Table 1: Properties

Property

Description

icon

Enter an sap-icon:// URL, for example sap-icon://cart.

You can look up the names of the available icons in tile configuration.

For more information, see Static App Launcher Tiles.

info

Text to be displayed at the bottom of the tile.

infoState

The color of the tile is adapted according to the value of this property. The precise color depends on the theme that you have selected in UI theme designer.

Allowed values: Negative, Neutral, Positive, Critical

number

Number to be displayed in the top right corner of the tile.

numberDigits

Number of digits to be displayed following the decimal separator (decimal point or decimal comma, depending on the language settings).

numberFactor

A factor for scaling numbers, for example, for displaying large numbers like 1.000.000 (-> number = 1 and numberFactor="M") or for percentages (number = 22.2 and numberFactor = “%”). The scaling is not done by the front end but has to be provided by the app developer.

numberState

The color of the number is adapted according to the value of this property. The precise color depends on the theme that you have selected in UI theme designer.

Allowed values: Negative, Neutral, Positive, Critical

numberUnit

Unit to be displayed below the number, for example, USD.

stateArrow

Displays an arrow indicating a trend.

Allowed values: None, Up, Down

subtitle

Subtitle to be displayed below the tile title.

targetParams

List of key-value-pairs separated by ampersands.

When the application is lauched (by clicking on it), these parameters are passed to the application as business parameters (if semantic object-based navigation is used) or as URL parameters (if URL-based navigation is used).

If any parameters have been entered in the Parametersfield in the tile configuration, the parameters passed by the OData service are appended to the list of parameters to be passed to the application.

title

Title to be displayed in the tile.

If the service returns an entity collection (rather than a single entity), all values from the numberelements are accumulated

For my scenario, I use Get entity method as it will show single entity.


Step 1: RFC Development/Code based

This step is not mandatory.  You can either use Structure or create a redefinition and write logic in the Get entity method of DPC EXT class.I use RFC because every time I don’t have to change the modelling. I can change the logic in the BAPI and that BAPI is called in my redefinition or I can map it directly with the Entities.


Step 2: Use case


Here I am taking a real time scenario, where the rfc will show the Count of Total Entry list present in the table( or created till date) and the latest Entry list number along with Name of the Entry list.


As per the logic, my RFC will calculate the entry list every time the table is updated and also populate the latest record.

Now once we have the data coming from the RFC, we just have to include properties in gateway modelling as per the table 1 above:



COUNT: “number”

NAME: “info”


Write Get entity method and you should get response as below in Gateway client.

Step 3: Create a Dynamic Tile in Fiori Admin page


Open URL: https: //<host>.<domain>:<port>/sap/bc/ui5_ui5/sap/arsrvc_upb_admn/main.html?sap-client=<Client>?scope=CUST


Step 4 : Create Custom Catalog, Group and Dynamic Tile configuration


Once you enter admin page, you should create custom tile catalog and choose a dynamic tile.




   Choose App Launcher - Dynamic.




Above screenshot is for Purchase order scenario. You can configure your custom gateway service URL in field : Service URL.

                                                                               

  • In the Dynamic Data section provides your OData URL. Click on save and move on with the next steps on Tile configuration.


  • As per the configuration, we should see something like this:

  • Now to check whether the tile is dynamic:
  • Create an entry list from backend: tcode IK31


  • Refresh the Launchpad:


  • You can see count increases to 150 and Info also shows the latest entry list details with dynamic text.


Thank You  

Tejas Chouhan

37 Comments
Labels in this area