Skip to Content
0
Jul 12, 2012 at 09:30 AM

How to pass varialble value from FPM to called component?

34 Views

Hi Forum,

A new component/view is called from FPM component using the below code

DATA: lr_elem TYPE REF TO if_wd_context_element.
DATA: ls_hcp_data TYPE wd_this->element_hcp_data.
DATA: lr_event TYPE REF TO cl_fpm_event.


lr_elem = wdevent->get_context_element( name = 'CONTEXT_ELEMENT').

lr_elem->get_static_attributes( IMPORTING static_attributes = ls_hcp_data ).

lr_event = cl_fpm_event=>create_by_id( cl_fpm_event=>gc_event_view_switch ).

IF ls_hcp_data-view_id IS INITIAL.
lr_event->mo_event_data->set_value(
iv_key = cl_fpm_event=>gc_event_param_view_id
iv_value = ls_hcp_data-id ).
lr_event->mo_event_data->delete_value(
iv_key = cl_fpm_event=>gc_event_param_subview_id ).
ELSE.
lr_event->mo_event_data->set_value(
iv_key = cl_fpm_event=>gc_event_param_view_id
iv_value = ls_hcp_data-view_id ).
lr_event->mo_event_data->set_value(
iv_key = cl_fpm_event=>gc_event_param_subview_id
iv_value = ls_hcp_data-id ).
ENDIF.

CALL METHOD wd_comp_controller->mr_fpm->if_fpm~raise_event
EXPORTING
io_event = lr_event.

I want to pass one value to the called WD component may be using URL parameters and get that parameter in the view of called component.

Is that possible?

Thank you,

Anubhav