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.

Accepted Solutions (1)

Accepted Solutions (1)

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

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You dont need to fire the plug to call webdynpro application. By using the following code you can call the URL in

an external window.


  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( ).

CALL METHOD lo_window_manager->CREATE_EXTERNAL_WINDOW
  EXPORTING
    URL            =  ' "PASS YOUR APPLICATION URL HERE'
    MODAL          = ABAP_FALSE
    HAS_MENUBAR    = ABAP_TRUE
    IS_RESIZABLE   = ABAP_TRUE
    HAS_SCROLLBARS = ABAP_TRUE
    HAS_STATUSBAR  = ABAP_TRUE
    HAS_TOOLBAR    = ABAP_TRUE
    HAS_LOCATION   = ABAP_TRUE
  RECEIVING
    WINDOW         = lo_window.

lo_window->open( ).

former_member389677
Active Participant
0 Kudos

Hi,

My requirement is navigate to the application with out create in a new window. I want to view all in same window.

Thanks and regards,

Shaira.

Former Member
0 Kudos

Hi shaira,

Look into my second post, that will open the application in same window.

Former Member
0 Kudos

You have to use suspend and resume to open other application in the same window. Check for more information on suspend and resume plugs as there are so many threads. You can also call the other application as a popup if that component is defined as a usage in your component.