cancel
Showing results for 
Search instead for 
Did you mean: 

Call Web Dynpro application on a button Click.

former_member389677
Active Participant
0 Kudos

Hi,

I have 2 web dynpro components.(COMP1 and COMP2). I wants to call the application of COMP2 from a button click from COMP1.

1. In COMP1 view i have a button. I have created an outbound plug 'TO_APP' with parameter 'URL' type string.

2. Inside the event handler method for the button i have written the code as given below.

data str_url type string.

CALL METHOD cl_wd_utilities=>construct_wd_url

EXPORTING

application_name = 'COMP2_APP'

IMPORTING

out_absolute_url = str_url

.

wd_this->fire_to_app_plg(

url = str_url

).

When i click the button it wont navigate to COMP2. Is there any other step required ?

Please helps me to solve this issue...

Regards,

Shaira.

View Entire Topic
former_member199125
Active Contributor
0 Kudos

In your button action just copy this and try

data str_url type string.

CALL METHOD cl_wd_utilities=>construct_wd_url

EXPORTING

application_name = 'COMP2_APP'

IMPORTING

out_absolute_url = str_url

.

data lo_window_manager type ref to if_wd_window_manager.

data lo_api_component type ref to if_wd_component.

data lo_window type ref to if_wd_window.

lo_api_component = wd_comp_controller->wd_get_api( ).

lo_window_manager = lo_api_component->get_window_manager( ).

lo_window = lo_window_manager->create_external_window(

url = str_url ).

lo_window->open( ).

Regards

Srinivas

former_member389677
Active Participant
0 Kudos

Hi Srinivas,

Thanks for the response .

But i want to display COMP2 application in same window. I don't want to create a new window.I want to navigate to another application from current one.

Please help me to solve this...

Regards,

Shaira.

Former Member
0 Kudos

Hi,

To call URL in same window first create an outbound plug in your current window(ex: EXIT_PLUG ),mark this

EXIT_PLUG as interface and plug type EXIT. Now use the following code in your button action.


 data : lr_view_cont TYPE REF TO if_wd_view_controller.
data : lr_win_cont TYPE REF TO if_wd_window_controller.
data : lt_parameter_list type wdr_event_parameter_list.
data : ls_parameter type wdr_event_parameter.
data : lr_val type ref to data.
data : lr_comusg type ref to if_wd_component_usage.
field-SYMBOLS : <fs> type any.
lr_view_cont = wd_this->wd_get_api( ).
CALL METHOD LR_VIEW_CONT->GET_EMBEDDING_WINDOW_CTLR
  RECEIVING
    RESULT = lr_win_cont
    .

ls_parameter-name = 'URL'.

create data lr_val type string.
assign lr_val->* to <fs>.
<fs> = 'HTTP://APPLICATION URL' .                                       "PASS YOUR URL HERE
ls_parameter-value = lr_val.
insert ls_parameter into TABLE lt_parameter_list.

lr_win_cont->if_wd_view_controller~fire_plug(
 exporting
    plug_name = 'EXIT_PLUG'
    parameters = lt_parameter_list ).

former_member389677
Active Participant
0 Kudos

Hi Harshith,

Thanks for your help.

Shaira.

former_member199125
Active Contributor
0 Kudos

FYI,

If you are using only exit plugs in portal then its fine.

But Suspend and resume calls are not released for use in a portal environment.

Regards

Srinivas

Edited by: sanasrinivas on Feb 10, 2012 12:36 PM