Blog
Requirement
The below approach explains the process of defining a custom Fiori for SAP BPC Embedded. The tile below shows the list of list of Open BPF activities against the user in SAP BPC Embedded on HANA 1610. The purpose of this development is to show the total activities assigned to user alongside the open activities. The aim of this development is to serve as the notification point of the assigned BPF (Business Process Flow) Activities to the business users via the Fiori tile.
Fiori allows the creation of static as well as dynamic app launcher tiles. A dynamic tile gets information from a data source (OData Service) and constantly queries the source at regular interval and keeps it updated.
The outcome of the solution should look like the following.

DDIC Structure
We should create a DDIC structure from SE11 transaction. This will help to define the OData Services in the next steps.

Gateway Service
We use gateway services builder (tcode: SEGW) for creating services that will make the data available via the OData services. SEGW is a design-time transaction, which provides developers with an easy-to-use set of tools for creating services. It has been conceived for the code-based OData Channel.
We will be leveraging gateway services functionality to query the number of open and total activities assigned to the user. The steps involved in this process is to do the following


Get Entity Method Implementation
You should redefine the GetEntity method to implement the code needed to determine the open and total activities. This method will hold the ABAP code which will determine and return the necessary data for populating the Dynamic App tile.

ABAP Code
METHOD ZBPF_INSTSET_GET_ENTITY.
DATA:
LT_INST TYPE CL_RSBPCB_SERVICE=>TN_T_INST,
LS_INST TYPE CL_RSBPCB_SERVICE=>TN_S_INST,
LT_STEP_RGN TYPE CL_RSBPCB_SERVICE=>TN_T_STEP_RGN,
LS_STEP_RGN TYPE CL_RSBPCB_SERVICE=>TN_S_STEP_RGN,
LV_CNT_PROCESS TYPE I,
LV_CNT_ACTV_TO TYPE I,
LV_CNT_ACTV_OP TYPE I,
LV_CNT_ACTV_CO TYPE I,
LV_CNT_ACTV_PE TYPE I,
LV_CNT_ACTV_TO_S TYPE C LENGTH 5,
LV_SUBTITLE TYPE C LENGTH 40.
FIELD-SYMBOLS <LS_INST> TYPE CL_RSBPCB_SERVICE=>TN_S_INST..
CL_RSBPCB_INST=>GET_INSTANCE_TODOLIST(
EXPORTING
I_APPSET_ID = ‘BPCENV’
IF_WITH_TEXT = ‘X’
IMPORTING
E_T_INST = LT_INST).
LOOP AT LT_INST ASSIGNING <LS_INST>.
CLEAR: LS_INST, LT_STEP_RGN.
LT_STEP_RGN = <LS_INST>-T_STEP_RGN.
LV_CNT_PROCESS = LV_CNT_PROCESS + 1.
LOOP AT LT_STEP_RGN INTO LS_STEP_RGN.
LV_CNT_ACTV_TO = LV_CNT_ACTV_TO + 1.
IF LS_STEP_RGN-STATUS = ‘OP’.
LV_CNT_ACTV_OP = LV_CNT_ACTV_OP + 1.
ELSEIF LS_STEP_RGN-STATUS = ‘CO’.
LV_CNT_ACTV_CO = LV_CNT_ACTV_CO + 1.
ELSEIF LS_STEP_RGN-STATUS = ‘PE’.
LV_CNT_ACTV_PE = LV_CNT_ACTV_PE + 1.
ENDIF.
ENDLOOP.
ENDLOOP.
LV_CNT_ACTV_TO_S = LV_CNT_ACTV_TO – LV_CNT_ACTV_CO.
CONCATENATE ‘Total: ‘ LV_CNT_ACTV_TO_S INTO LV_SUBTITLE.
ER_ENTITY = VALUE #(
ICON = ‘sap-icon://multiselect-all’
NUMBER = LV_CNT_ACTV_OP
NUMBERDIGITS = ‘0’
NUMBERFACTOR = ”
NUMBERSTATE = ‘Negative’
NUMBERUNIT = ‘Open’
SUBTITLE = LV_SUBTITLE
TITLE = ‘BPF Activities’
).
ENDMETHOD.
Activate and Maintain Service
Log in to Fiori Front End Server and navigate to “Active and Maintain Service” using tcode /N/IWFND/MAINT_SERVICE.

Test OData Service
You can test the OData services via the SAP Gateway Client. This tool will allow you to test the service registered as part of the previous step.

Fiori Configuration
As the last step go to Fiori Launchpad Designer (tcode: /UI2/FLPD_CUST)
- Create a Catalog
- Add “App Launcher – Dynamic” tile
- Add this tile to a group

Result
You should assign the appropriate permissions to the user to make the Fiori tile available.

Useful TCODE
Gateway Runtime
Gateway Client – /IWFND/GW_CLIENT
Error Log – /IWFND/ERROR_LOG
Application Log – /IWFND/APPS_LOG (Gateway Hub System)
Application Log – /IWBEP/VIEW_LOG (Business Suite Backend)
Clear Cache – /IWFND/CACHE_CLEANUP
Disable Cache – /IWFND/MED_ACTIVATE
Gateway Node Activation – SICF
Alert Monitoring – RZ20
Performance Trace – /IWFND/TRACES
Gateway Design
Gateway Service Builder – SEGW
Service Validation – /IWFND/SRV_VALIDATE
Register/Test Backend System – SM59
Create a Service – SE80
Activate a Service – /IWFND/IWF_ACTIVATE
Reference Links
https://blogs.sap.com/2017/02/07/dynamic-fiori-launchpad-tile-explained/
https://blogs.sap.com/2017/07/22/scaling-dynamic-tile-on-fiori-launch-pad/
https://blogs.sap.com/2015/03/06/create-dynamic-app-launcher-fiori-tile/
https://help.sap.com/saphelp_uiaddon10/helpdata/en/4d/2b9e3c92e54b2192f031a2941927d6/frameset.htm
https://blogs.sap.com/2017/01/28/how-to-create-custom-tile-types-for-onpremise-fiori-launchpad/
https://help.hana.ondemand.com/cloud_portal/frameset.htm?06372b11e2234aef879b0167588158c1.html
