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.