Blogs

How to create a direct URL for xRPM Item
Sharad Agrawal 
Business Card
Company: Valero Energy Corporation
Posted on Feb. 09, 2010 04:00 AM in ABAP, Enterprise Portal (EP), SAP xApps, Web Dynpro

Subscribe.Subscribe
Print. Print
Permalink Permalink
Share

There was a business requirement in our xRPM 4.5 SP6 implementation to send emails out on Gate approvals. The expectation was to provide xRPM item link in the email text so that user can click on the link and navigate directly to xRPM item.
There was no standard functionality available in xRPM to achieve this. SAP customer support confirmed that.

xRPM 4.5 item dashboard is built on ABAP WebDynpro  technology while item overview is  a Java WebDynpro application. We investigated how the control moves from item dashboard to item overview. We found that this functionality is based on Portal Eventing.  When a user clicks on one particular item in item dashboard, a portal even is fired. That portal event is subscribed by Java application to start Java WebDynpro application. We leveraged on SAP standard functionality to build our own functionality. The solution involved the following. A new custom ABAP WebDynpro component was created with URL parameter in the application to accept Item GUID

  • ABAP WebDynpro component reads the item attributes, prepares the event parameters and fire the portal event SetContextEvent (available in portal event namespace 'urn:com.sap.pct.cprxrpm.wdrSetContextEventFire).
  • The event is fired at WDDOMODIFYVIEW event of the view ‘Main’.
  • This ABAP WebDynpro in isolation does not redirect to Item Overview screen of the xRPM item. The steps below are also needed. This application has to issue the portal event in portal environment so that it can be listened by Java WebDynpro application.
  • On xRPM portal, we created a portal page.
  • This portal page contains the i-view (type WebDynpro). This I-View renders the ABAP WebDynpro , we created above.
  • The Portal Page was configured to accept the parameter for item overview and pass it on to I-View to WebDynpro.
  • Now  the portal page URL can be sent ( with Item GUID) as parameter can be sent via email and it will redirect user to item overview page of xRPM item.
  • Navigation Panel  need to be added under dynamic navigation of the page.
 Please note the following.1. The format of the event parameter is as following.
  1. LinkId for item overview| item guid |  item name | item external id | '1' | 'False'
  2. Link Id for the item overview can be found from IMG-> SAP xRPM->Global Customizing->Process and Service setting->Define Navigation. Please data type for Link Id is N ( 4 digits).

2. Portal event via ABAP WebDynpro is fired using the interface IF_WD_PORTAL_INTEGRATION method FIRE.   

Added by author :-

There have been several comments where people tried the approach given in blog. They were able to fire the Portal even but even was not caught.  I am uploading the snapshots of Portal configuration depicting what needs to be done at portal side.

  • Create ABAP webdynpro iView, add iView to Page. Add page to Portfolio Management role.

image

" mce_src="" alt="Portal Configuration -1" border="" hspace="" vspace="" width="" height="" align="" />

  • Navigation Panel  need to be added under dynamic navigation of the page.image

Sharad Agrawal   Sharad Agrawal is Manager SAP Projects working for Valero Energy Corporation


Comment on this article
Comment on this weblog
Showing messages 1 through 11 of 11.

Titles Only Main Topics Oldest First

  • How to call from a mail
    2010-11-08 06:22:12 AMITTEJA VUTPALA Business Card [Reply]

    My requirement is almost similar but we have to call the role through FES and that should send through,however I tried the same to call a role through FES but faile any idea of how to achive this .


    Regards,
    Amit

  • Thanks!! and a question
    2010-06-11 12:44:05 P 409840 Business Card [Reply]

    Hi Sharad,


    We followed all the steps in the blog.


    We are facing an issue with the custom Web Dynpro Application created for this purpose.


    I Created the iView and page and also the WDA App which accepts the parameters
    DRILLDOWN_LINKID,MY_OBJECTS_STRING,OBJECT_GUID,OBJECT_ID,OBJECT_NAME,OBJECT_TYPE,SCOPE_STRING


    And we are getting the parameters.


    We previewed the iView and appending the URL parameters to the URL of the iView and when previewing it is not taking to the Item Overview, basically it is not triggering the WDDOMODIFYVIEW of the application.


    Please suggest where are we doing wrong.


    And would appreciate if you can send the Portal definition of the iView and also the coding for the Custom WebDynpro App.


    Best Regards,
    Pramod

    • Thanks!! and a question
      2010-06-11 13:28:59 Sharad Agrawal Business Card [Reply]

      Pramod,
      I have been several replies complaining about portal event not being fired. First thing, I want to make it clear we are on XRPM 450_700 SP 006, SAP_BASIS release 700 SP 0018.


      Web dynpro Application- It has one parameter PROJECT_GUID. At the startup plug of main window, I have the following code.
      method HANDLEDEFAULT .


      data : l_item type /rpm/item_d,
      l_context type /RPM/TS_OBJECT_HIER,
      l_attributes type /RPM/TS_ITEM_D_API,
      l_lang type LAISO.


      data : l_event_param type string,
      l_guid_str type string.



      if project_guid is initial.
      exit.
      endif.


      select single * from /RPM/ITEM_D into l_item where guid = project_guid.
      if sy-subrc <> 0.
      exit.
      endif.


      *-----Fill the context and get all attributes
      l_context-PORTFOLIO_GUID = l_item-PORTFOLIO_GUID.
      l_context-parent_guid = l_item-PORTFOLIO_GUID.
      l_context-object_guid = l_item-guid.


      l_lang = sy-langu.
      CALL FUNCTION '/RPM/ITEM_DISPLAY'
      EXPORTING
      IS_CONTEXT = l_context
      IV_LANGUAGE = l_lang
      IMPORTING
      ES_ATTRIBUTES = l_attributes.



      DATA lo_nd_item_info TYPE REF TO if_wd_context_node.
      DATA lo_el_item_info TYPE REF TO if_wd_context_element.
      DATA ls_item_info TYPE wd_this->element_item_info.
      DATA lv_item_guid LIKE ls_item_info-item_guid.
      * navigate from <CONTEXT> to <ITEM_INFO> via lead selection
      lo_nd_item_info = wd_context->get_child_node( name = wd_this->wdctx_item_info ).
      * get element via lead selection
      lo_el_item_info = lo_nd_item_info->get_element( ).
      * get single attribute
      lo_el_item_info->set_attribute(
      EXPORTING
      name = `ITEM_GUID`
      value = l_item-guid ).


      lo_el_item_info->set_attribute(
      EXPORTING
      name = `NAME`
      value = l_attributes-proj_description ).



      lo_el_item_info->set_attribute(
      EXPORTING
      name = `EXTERNAL_ID`
      value = l_attributes-external_id ).


      l_guid_str = l_item-guid.
      concatenate '0121' l_guid_str 'RIH' l_attributes-proj_description l_attributes-external_id '1' 'FALSE'
      into l_event_param separated by '|'.
      condense l_event_param no-gaps.


      lo_el_item_info->set_attribute(
      EXPORTING
      name = `EVENT_PARAMETER`
      value = l_event_param ).



      endmethod.


      method WDDOMODIFYVIEW .
      data : ld_event type ref to CL_WD_CUSTOM_EVENT,
      my_comp type ref to if_wd_component,
      my_win_mngr type ref to IF_WD_WINDOW_MANAGER.


      CREATE OBJECT ld_event
      EXPORTING
      name = 'Dummy'.


      *-----Issue portal event to launch Java webdynpro
      me->ONACTIONON_CLICK( exporting wdevent = ld_event ).



      endmethod.



      DATA:
      l_componentcontroller TYPE REF TO ig_componentcontroller,
      l_api_componentcontroller TYPE REF TO if_wd_component,
      l_portal_manager TYPE REF TO if_wd_portal_integration,
      iv_portal_event_namespace TYPE string VALUE 'urn:com.sap.pct.cprxrpm.wdrSetContextEventFire',
      iv_portal_event_name TYPE string VALUE 'SetContextEvent',
      lv_window_manager type ref to IF_WD_WINDOW_MANAGER.



      DATA lo_nd_item_info TYPE REF TO if_wd_context_node.
      DATA lo_el_item_info TYPE REF TO if_wd_context_element.
      DATA ls_item_info TYPE wd_this->element_item_info.
      DATA lv_event_parameter LIKE ls_item_info-event_parameter.
      * navigate from <CONTEXT> to <ITEM_INFO> via lead selection
      lo_nd_item_info = wd_context->get_child_node( name = wd_this->wdctx_item_info ).


      * get element via lead selection
      lo_el_item_info = lo_nd_item_info->get_element( ).


      * get single attribute
      lo_el_item_info->get_attribute(
      EXPORTING
      name = `EVENT_PARAMETER`
      IMPORTING
      value = lv_event_parameter ).



      l_componentcontroller = wd_this->get_componentcontroller_ctr( ).
      l_api_componentcontroller = l_componentcontroller->wd_get_api( ).
      l_portal_manager = l_api_componentcontroller->get_portal_manager( ).
      *lv_event_parameter = '0121|DE56A0F1228F34F182C8005056A7433F|RIH|test|VPL09-EP-0000085|1|FALSE'.
      l_portal_manager->fire(
      EXPORTING
      portal_event_namespace = iv_portal_event_namespace
      portal_event_name = iv_portal_event_name
      portal_event_parameter = lv_event_parameter ).


      l_portal_manager->fire(
      EXPORTING
      portal_event_namespace = iv_portal_event_namespace
      portal_event_name = iv_portal_event_name
      portal_event_parameter = lv_event_parameter ).


      Portal IView
      It is URL IView.
      In URL IView editor, URL field contains the URL of Webdynpro application URL. Request Method is 'GET'. We specified the URL parameter 'PROJECT_GUID'. This iView is on the custom page ( quick info com.sap.pct.cprxrpm.ItemOverviewRedirectPage)



      I hope it helps.

  • portal does not respond
    2010-05-17 13:46:32 Johannes Bacher Business Card [Reply]

    Hello Sharad,
    Unfortunately I have the same problem as stated by Prashant. The portal (or RPM) does not respond to the raised event.
    I have tried to fire the event from a BSP page, then also from a WDA component, no effect.
    I can receive the event in another BSP page, so the event is actually fired.
    I compared the event parameters, they match exactly the standard event in the item dashboard.


    Is there anything else I could be missing ? any special configuration in the portal page or iview ?


    Your help is highly appreciated!
    Thanks,
    Johannes

  • Event not being caught
    2010-03-02 01:50:57 Prashant Verma Business Card [Reply]

    Hi Sharad,
    we have built application as stated however portal doesnt seem to respond to event. Have we to place the PORTAL PAGE in same workset where other standard RPM pages reside ?


    iv_portal_event_namespace = 'urn:com.sap.pct.cprxrpm.wdrSetContextEventFire'.
    iv_portal_event_name = 'SetContextEvent'.
    iv_portal_event_parameter = '0121|DF16381F52916FF1A649005056A05754|RIH|BT N/W Update|A5I/00259|1|FALSE'.


    if l_portal_manager is BOUND.



    l_portal_manager->fire(
    EXPORTING
    portal_event_namespace = iv_portal_event_namespace
    portal_event_name = iv_portal_event_name
    portal_event_parameter = iv_portal_event_parameter ).
    endif.

    • Event not being caught
      2010-03-02 06:48:17 Sharad Agrawal Business Card [Reply]

      No, it does not have to be in same workset but looks like your external id has '|' character which might confuse event manager. Try with out that.
      • Event not being caught
        2010-03-03 00:11:57 Prashant Verma Business Card [Reply]

        External ID is A5I/00259 there is no '|' charachter in there ? Param list that i have pasted here is exactly what i get in debug mode when we click on the item link in the ITEM Dashboard.


        In case of your development where did you place your portal page? did u add it to any workset at all ?

        • Event not being caught
          2010-03-03 06:48:31 Sharad Agrawal Business Card [Reply]

          I just talked to portal resource who did the portal side development. I did the WDA development. As per him-
          "We added the page in the role under standard workset,not directly in the standard workset
          I believe it should not matter.


          The Path is Portfolio Management PMO role -> Portfolio Management Workset -> Portfolio Management Workset -> Item Overview Redirect Page"


          I hope it helps.

  • Helpful information
    2010-02-18 12:16:18 Simmi Balakrishnan Business Card [Reply]

    Thanks for this information.It would be great if you can update the blog with some screen shots for clear understanding.


    Regards,
    Simmi

  • Thanks!
    2010-02-09 23:23:48 Vivek Pandey Business Card [Reply]

    Hi Sharad,
    Many thanks for sharing this across on SCN. This blog is really helpful and is one of the most common requirements in RPM implementations.


    Regards,
    Vivek Pandey


Showing messages 1 through 11 of 11.