Skip to Content

Fiori is based on roles, but sometimes customize launchpad could be difficult.

In my case, I need to customize different tiles from different countries. This task is easy and large task using roles. I can make many roles as countries but the result was more than 50 roles.

For these reason I modified the standard method in Fiori launchpad to hidden tiles in execution time with some rules.

First of all, we need to create enhancements in class  /UI2/CL_GW_ABSTRACT_DP method EXP_GET_EXPANDED_ENTITY at lasted line:

 

– In previous enhancements we add next lines:

 

TRY.
ASSIGN COMPONENT ‘KEY_TAB’ OF STRUCTURE IS_REQUEST_DETAILS TO <KEY_TAB>.

*   Add dynamic functionality on tiles
l_where
= ‘NAME = ”id” AND VALUE = ”/UI2/Fiori2LaunchpadHome”’.
LOOP AT <KEY_TAB> ASSIGNING <dummy> WHERE (l_where).
EXIT.
ENDLOOP.
*   *  Only if launchpad get data modify tiles according to user.
IF sysubrc = 0.
*         Get all groups and start check
ASSIGN ER_ENTITY->* TO  <lw_entity>.
ASSIGN COMPONENT ‘PAGES’ OF STRUCTURE <lw_entity> TO <LT_PAGES>.
LOOP AT <LT_PAGES> ASSIGNING <LW_PAGES>.
*          Check all pages (groups)
ASSIGN COMPONENT ‘PAGECHIPINSTANCES’ OF STRUCTURE <LW_PAGES> TO <LT_PAGECHIPINSTANCES>.
IF sysubrc <> 0.
CONTINUE.
ENDIF.

*           For every row check configuration of tile
LOOP AT  <LT_PAGECHIPINSTANCES> ASSIGNING <LW_PAGECHIPINSTANCES>.

CLEAR: l_hidden, l_url, l_multi_link, l_where.

ASSIGN COMPONENT ‘PAGE_ID’ OF STRUCTURE <LW_PAGECHIPINSTANCES> TO <dummy>.
IF sysubrc = 0.
l_page_id
= <dummy>.
ENDIF.

ASSIGN COMPONENT ‘USAGE_ID’ OF STRUCTURE <LW_PAGECHIPINSTANCES> TO <dummy>.
IF sysubrc = 0.
l_usage_id
= <dummy>.
ENDIF.

IF 1)some conditions determine delete TILE.

*               In case off configuration tile mark as hidden, delete entrie from launchpad list
CONCATENATE ‘PAGE_ID = ”’ l_page_id ”’ AND  USAGE_ID = ”’ l_usage_id ”” INTO l_where.
DELETE <LT_PAGECHIPINSTANCES> WHERE (l_where).

 

             ELSEIF.
ASSIGN COMPONENT ‘CHIP’ OF STRUCTURE <LW_PAGECHIPINSTANCES> TO <L_CHIP>.
IF sysubrc = 0.
ASSIGN COMPONENT ‘CONFIG’ OF STRUCTURE <L_CHIP> TO <l_CONFIG>.
IF sysubrc = 0.
                    2)Other configurations
ENDIF.
ENDIF.
ENDIF.


ENDLOOP.
ENDLOOP.

ENDIF.
CATCH cx_root INTO oref.

ENDTRY.

– Two important things in points:

 

     – 1) Delete tile from configuration table. This tile not appear in launchpad. To identify the tile the variables are equals:

          l_page_id = group ID.

          l_usage_id =Tile instance ID.

/wp-content/uploads/2016/06/2_976802.jpg

     – 2) If you want to change the configuration of the tile , we can change this string ( not recommended), this string have this form:

*{“tileConfiguration”:”{\”display_icon_url\”:\”sap-icon://activity-individual\”,\”display_info_text\”:
*\”\”,\”display_title_text\”:\”Tile name\”,\”display_subtitle_text\”:\”\”,\”
*navigation_use_semantic_object\”:false,\”navigation_target_url\”:\”http://www.google.es\”,
*\”navigation_semantic_object\”:\”\”,\”navigation_semantic_action\”:\”\”,\”navigation_semantic_parameters\
*”:\”\”,\”display_search_keywords\”:\”\”}”}

To report this post you need to login first.

4 Comments

You must be Logged on to comment or reply to a post.

  1. Vijay Vegesana

    Hi Enric,

    Thanks for the blog, It seems we are trying to see if this method can be enhanced. Our external breakpoints are not triggering this method while we execute Fiori Launchpad. Is this the same method which you redefined, can you add more inputs here.

    Our requirement is to make tiles visible/invisible depends on business logic.

    Thanks,
    Vijay

    (0) 
    1. Enric Castella Gonzalez Post author

      Yes, in my case this is the class and method.

      In some cases you need to force to refresh launchpad to get data from databases and execute standar odata.

      Please, Try to put a Break Point in method: /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_EXPANDED_ENDTITY in line 106 ( if lv_read_from_db eq abap_true) and change lv_read_from_db from blank to ‘X’.

      (0) 
  2. Prashanth Nanjappa

    Hello Enric,

    Are you able to confirm the expected behavior in the following scenario?

    Catalog C1 has tile T1 and C2 has Tile T2. Both tiles are assigned to group G1 and the user role is assigned with catalog C1 and group G1 however, in launchpad the user is also able to see tile T2.

    Is this standard behavior? If so then I dont quite understand the need to define catalog in the role and if not, then I have no clue what I am missing so any help is much appreciated.

    tagging – @castellagonzalez

    (0) 

Leave a Reply