Additional Blogs by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

I wrote a How to create a direct URL for xRPM Item a while ago to tell how we can create a direct URL of xRPM 4.5 item.  The item overview in xRPM was Java WebDynpro based. Therefore we used portal event from ABAP webdynpro to invoke Item Overview functionality.

We are in the process of upgrading from xRPM 4.5 to PPM 5.0 at my work place. SAP PPM 5.0 is ABAP webdynpro based.  The PPM application has used Floor Plan Manager for layouts and organizations of different webdynpro components very heavily.  For this obvious reason, we needed to rewrite the direct URL functionality completely. A basic understanding of Floor Plan Manager and Launch Pad (Roles ad Instance) functionality is required to make this blog sense.  The following steps are performed to accomplish this

·         Create a new custom webdynpro component. Create a application parameter to accept the ‘Project GUID’.

·          Add a text box in the main view showing the message “Item is being loaded…..”

·         On WDDOModify event – do the following –

  1. 1.       Get the information of Launch Pad role 'RPM_RIH' and Instance ‘DRILLDOWN’ by using static method of class CL_APB_LAUNCHPAD_API method READ_FOR_DISPLAY.  It will give you the instance of Launch pad class CL_APB_LAUNCHPAD.
  2. 2.       Get the launch pad content from launch pad class instance using method GET_CONTENT.
  3. 3.       Every row in content will have 2 other tables as fields. One is for application parameters and other is for business parameters.
  4. 4.       Add the following business parameters to first row to contents.
  •   Key - OBJECT_GUID   Value –Item GUID
  •   Key - OBJECT_TYPE   Value – ‘RIH’
  •   Key - PARENT_GUID   Value – Bucket GUID
  •   Key - Parent Type             Value ‘RBH’
  •   Key - PORTFOLIO_GUID   Value  Portfolio GUID
  •   Key-PORTAL_ROLE            Value  'RPM_PORT'

     5.       Change the following application parameter to first row of contents.

  •  Read application parameter LINK_TEXT (title of window) and change it with external id of the item.
  •  To replace the main view with item overview ( to open the application in the same window) change the application parameter ‘SHOW_INPLACE’ value to ‘X’ (ABAP_TRUE).

      6.       Launch the floor plan manager application by calling method               LAUNCH_APPLICATION of launch pad class instance.

 

The sample code is as following.

  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: lr_navigation       TYPE REF TO if_fpm_navigation,
        ls_appl_params      TYPE apb_lpd_s_params,
        lt_par_mapping      TYPE apb_lpd_t_parameter_mapping,
        ls_targets          LIKE LINE OF lr_navigation->mt_targets,
        lv_system_alias     TYPE string.

  DATA: lr_wd_component     TYPE REF TO if_wd_component,
        lr_provider         TYPE REF TO if_apb_lpd_provider,
        lr_launchpad        TYPE REF TO cl_apb_launchpad_api,
        lv_lpd_role         TYPE apb_lpd_role,
        lv_lpd_instance     TYPE apb_lpd_instance,
        lt_param            TYPE apb_lpd_t_params,
        ls_param            TYPE apb_lpd_s_params,
        lt_content          TYPE apb_lpd_t_content,
        ls_content          TYPE apb_lpd_s_content,
        lt_messages         TYPE apb_lpd_t_bapiret1,
        l_lpd_save          TYPE boole_d,
        ls_item_d           TYPE /rpm/item_d.

  lo_nd_item_info = wd_context->get_child_node( name = wd_this->wdctx_item_info ).
  lo_el_item_info = lo_nd_item_info->get_element( ).
  lo_el_item_info->get_static_attributes(
    IMPORTING
      static_attributes = ls_item_info ).
  CHECK ls_item_info-item_guid IS NOT INITIAL.
  SELECT SINGLE * FROM /rpm/item_d INTO ls_item_d WHERE guid = ls_item_info-item_guid.
* Get System Alias from Item dashboard
  lv_lpd_role =     'RPM_RIH'.
  lv_lpd_instance = 'DRILLDOWN'.
  CREATE OBJECT lr_provider TYPE cl_powl_runtime_services.
  lr_wd_component = wd_this->wd_get_api( ).
  CALL METHOD cl_apb_launchpad_api=>read_for_display
    EXPORTING
      id_role           = lv_lpd_role
      id_instance       = lv_lpd_instance
      ir_provider       = lr_provider
      ir_wd_component   = lr_wd_component
    RECEIVING
      er_launchpad      = lr_launchpad
    EXCEPTIONS
      parameter_missing = 1
      not_found         = 2
      OTHERS            = 3.
  CHECK lr_launchpad IS BOUND.
  lt_content = lr_launchpad->get_content( ).
  READ TABLE lt_content INTO ls_content INDEX 1.
  CHECK ls_content IS NOT INITIAL.

  CLEAR ls_param.
  ls_param-key = 'OBJECT_GUID'.
  ls_param-value = ls_item_info-item_guid.
  APPEND ls_param TO ls_content-business_parameter.

  CLEAR ls_param.
  ls_param-key = 'OBJECT_TYPE'.
  ls_param-value = 'RIH'.
  APPEND ls_param TO ls_content-business_parameter.

  CLEAR ls_param.
  ls_param-key = 'PARENT_GUID'.
  ls_param-value = ls_item_d-parent_guid.
  APPEND ls_param TO ls_content-business_parameter.

  CLEAR ls_param.
  ls_param-key = 'PARENT_TYPE'.
  ls_param-value = 'RBH'.
  APPEND ls_param TO ls_content-business_parameter.

  CLEAR ls_param.
  ls_param-key = 'PARENT_GUID'.
  ls_param-value = ls_item_d-parent_guid.
  APPEND ls_param TO ls_content-business_parameter.

  CLEAR ls_param.
  ls_param-key = 'PORTFOLIO_GUID'.
  ls_param-value = ls_item_d-portfolio_guid.
  APPEND ls_param TO ls_content-business_parameter.

  CLEAR ls_param.
  ls_param-key = 'PORTAL_ROLE'.
  ls_param-value = 'RPM_PORT'.
  APPEND ls_param TO ls_content-business_parameter.

*------Change application parameter
  read table ls_content-application_parameter into ls_param with key key = 'LINK_TEXT'.
  if sy-subrc = 0.
    ls_param-value = ls_item_d-external_id.
    MODIFY ls_content-application_parameter from ls_param index sy-tabix.
  ENDIF.

  read table ls_content-application_parameter into ls_param with key key = 'SHOW_INPLACE'.
  if sy-subrc = 0.
    ls_param-value = 'X'.
    MODIFY ls_content-application_parameter from ls_param index sy-tabix.
  ENDIF.

* Launch application
  lr_launchpad->launch_application( it_application_parameters = ls_content-application_parameter
                                    it_business_parameters    = ls_content-business_parameter ).

1 Comment