Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

Hi, my name is Chattrapol Khamchuang, CRM consultant from Achievings Company. A few days ago I stumbled upon a tweet from Gregor Wolf asking for a small trick on WebUI to pre-populate Web Links favourite for all users so that it could be selected from the Favourite via Personalization. Funny enough we just implemented a solution for similar requirement, but with a twist, and I promised Gregor I would blog it. A big credit to my colleague Linawati Lie who helped come up with a quick and easy solution in less than 1 hour.

The Solution:

Instead of just pre-populating the web links for users to pick up for display via Personalization, we did go a step further by defaulting it on the homepage of all users, eliminating those additional clicks - a 'Push' approach, rather than a 'Pull' - and from user experience perspective, a real click killer!

One of the tables used to store personalization is CRMT_PERS_DATA, so we’ll work with this. Check it out before you begin the implementation.

The Steps:

1) Configure web links and web links group. Path: SPRO->CRM->UI Framework definition->Define weblinks

2) Add function profiles EXT_WEB_LINKS to business role in scope, with the value assignment of the web links group. Path: SPRO->CRM->UI Framework definition->Define Business Role

3) Enhance UI component/view: UICMP_WC_FAVORI/FavoriteWebLinks. Look for method GET_WCFAVORITE_LINKS (Get WorkCenter Favorite Links)

METHOD get_wcfavorite_links.
  DATA: lt_pers_links     TYPE crmt_ui_link_pers,
        lt_pers_data      TYPE crmt_ui_pers_data,
        ls_pers_data      LIKE LINE OF lt_pers_data.

  DATA lv_bus_role        TYPE crmt_ic_configprof.
  DATA lt_link_id         TYPE TABLE OF  crmt_ui_web_l_id.
  DATA lv_web_link        TYPE crmt_ic_profile_value.
  DATA lang_pattern       TYPE string.
  DATA ls_link_id         TYPE crmt_ui_web_l_id.
  DATA ls_pers_link       TYPE crms_ui_link_pers.
  DATA ls_web_l           TYPE crmc_ui_web_l.
  DATA ls_web_t           TYPE crmc_ui_web_l_t.

  super->get_wcfavorite_links( ).

  "****************************************************
  " Logic part to get web link url from business role
  "****************************************************
  CLEAR lt_link_id.

  GET PARAMETER ID 'CRM_UI_PROFILE' FIELD lv_bus_role.
  SELECT SINGLE profile_value FROM crmc_ui_prof_a INTO lv_web_link
    WHERE profile    = lv_bus_role
      AND profile_id = 'EXT_WEB_LINKS'.
  " Define Language pattern
  IF sy-langu = 'D'.
    lang_pattern = '%DE'.
  ELSE.
    lang_pattern = '%EN'.
  ENDIF.
  SELECT link_id FROM crmc_ui_web_l_a INTO TABLE lt_link_id
    WHERE web_grp_id = lv_web_link
      AND link_id LIKE lang_pattern.

  LOOP AT lt_link_id INTO ls_link_id.
    READ TABLE lt_pers_links WITH KEY link_id = ls_link_id INTO ls_pers_link.
    IF sy-subrc <> 0.
      CLEAR ls_web_l. CLEAR ls_web_t.
      SELECT SINGLE * FROM crmc_ui_web_l   INTO ls_web_l
        WHERE link_id = ls_link_id.
      SELECT SINGLE * FROM crmc_ui_web_l_t INTO ls_web_t
        WHERE link_id  = ls_link_id
          AND language = sy-langu.
      ls_pers_data-id           = ls_web_l-link_id.
      ls_pers_data-group_type   = ''.
      ls_pers_data-name         = ls_web_t-short_desc.
      ls_pers_data-user_created = ''.
      ls_pers_data-data         = ls_web_l-url_1.
      READ TABLE gt_wcfavoritelinks WITH KEY id = ls_pers_data-id TRANSPORTING NO FIELDS.
      IF sy-subrc <> 0.
        APPEND ls_pers_data TO gt_wcfavoritelinks.
      ENDIF.
    ENDIF.
  ENDLOOP.
ENDMETHOD.

3) Test to find out that the pre-defined web links now display on the CRM Homepage by default. Check to see data entries in table CRMT_PERS_DATA too :)

The Application:

We used this, together with System News (t-code: SM02) to notify our users when a small set of enhancements were made available, where details of the enhancements and new functionalities were stored centrally in an internal website, be it Portal or Sharepoint. This keeps CRM knowledge/update in one central location, and easily accessible by our users from their very own CRM Homepage.

Author: Chattrapol Khamchuang is a CRM business consultant and owner at Achievings Company Limited (www.achevings.com). He has over 11 years of international experience in management consulting, SAP ERP SD & CRM implementation, and CRM business transformation. His roles range from lead SD & CRM functional consultant, SAP CRM solution architect, project manager to CRM management consultant. He is married with his lovely wife Katie, and currently lives in Bangkok, Thailand, where his company, Achievings Company Limited, is offering CRM consulting services to both local and international clients. He can be reached at chattrapol at gmail dot com.

4 Comments

  1. Hi Chattrapol,

    thank you for providing this great solution. I've already tried it on our CRM 7.0 Sandbox system and it works great. I was wondering if the

    GET PARAMETER ID 'CRM_UI_PROFILE' FIELD lv_bus_role.

    would work also if the business role is assigned via the org management but it seems to work fine. I've just made a little correction to the select reading the text descriptions for the links. You've missed to select for the language.

    Best regards
    Gregor

  2. Guest

    Hi Chattrapol,

    thank you for this great blog.

    This fits exactly our requirement for weblinks.

    Best regards

    Manfred

  3. Former Member

    We use this in our CRM system, one of the links we push is longer than 255 characters.  In our upgraded EhP2 landscape this link is not working with this code.  When I look at table CRMC_UI_WEB_L field URL_1 is only holding the 1st 255 bytes the rest of the url is not in field URL_2.   But the table looks the same in our EhP1 system which has me confused why this functions in EhP1 but not in EhP2.

  4. Former Member

    Thank you for this solution!

    Best regards

    valentina