cancel
Showing results for 
Search instead for 
Did you mean: 

Opening a new browser window?

Former Member
0 Kudos

Hi,

I need to open another WD component/application from a WD application. This is not a problem, but I need to open it into a new browser window.

I tried the pop-up wizard (and some of the methods in window_manager) and basically that works great, but pop-up is not really a new window. When the pop-up is opened, you cannot anymore use the "main application" until you close the pop-up.

How can I open a new application in a new browser window?

Regards,

Pa

Accepted Solutions (1)

Accepted Solutions (1)

uday_gubbala2
Active Contributor
0 Kudos

Hi Pa,

You can proceed as shown below. You need to just get the URL of the component which you want to call from your component using the static method construct_wd_url of class cl_wd_utilities. You then just have to pass this URL to the create_external_window method of if_wd_window_manager. (This part can be done by using the code wizard itself.)

Regards,

Uday

METHOD onactioncall .
 
  DATA : lv_url TYPE string.
 
  CALL METHOD cl_wd_utilities=>construct_wd_url
    EXPORTING
      application_name = 'Z187442_ALV1'
    IMPORTING
      out_absolute_url = lv_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( ).
 
  CALL METHOD lo_window_manager->create_external_window
    EXPORTING
      url    = lv_url
    RECEIVING
      window = lo_window.
  lo_window->open( ).
ENDMETHOD.

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

How can i open multiple new browser windows by using create_external_window?

Currenlty i'm using a loop statement to pass the URLs into create_external_window but it failed to open multiple new browser windows.

It will only open one new browser with the last URL in the table.

DATA: l_window_manager TYPE REF TO if_wd_window_manager,

l_cmp_api TYPE REF TO if_wd_component,

l_window TYPE REF TO if_wd_window.

l_window_manager = lr_comp_api->get_window_manager( ).

LOOP itab into wa_itab.

CALL METHOD l_window_manager->create_external_window

EXPORTING

url = wa_itab-url

has_statusbar = abap_false

has_toolbar = abap_false

has_location = abap_false

RECEIVING

window = l_window

.

l_window->open( ).

ENDLOOP.

Regards,

Kevin

uday_gubbala2
Active Contributor
0 Kudos

Hi Kevin,

I just tried with your code & guess that this is happening coz the system does send out the server request after complete execution of the method call. Because of this create_external_window is only calling the last entry of your internal table in a new window. Will try to check if there's any workaround for the same..

Regards,

Uday

raja_narayanan2
Active Participant
0 Kudos

Hi....

like this you can call it in a new browser.......

DATA l_api_componentcontroller TYPE REF TO if_wd_component.

DATA l_appl TYPE REF TO if_wd_application.

l_api_componentcontroller = wd_comp_controller->wd_get_api( ).

l_appl = l_api_componentcontroller->get_application( ).

l_appl->open_help_center( ).

Hope this will help you...

Regards

Raja

Former Member
0 Kudos

hi,

just type the following code.

Type URL which u want to open instead 'http://www.google.com'

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 = 'http://www.google.com' "just type your URL here

RECEIVING

window = lo_window.

lo_window->open( ).

a new browser window will open.

Former Member
0 Kudos

Hi,

To call a other WDA in this WDA in an New Window or as a PopUp-

Try to use CALL METHOD lo_window_manager->CREATE_EXTERNAL_WINDOW .

Pls check out this link on the same-

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2064719b-8851-2b10-a399-b356d91c...

Regards

Lekha

Former Member
0 Kudos

Try this

IF_WD_WINDOW_MANAGER=>CREATE_EXTERNAL_WINDOW as follows:

DATA: l_window_manager TYPE REF TO if_wd_window_manager,
l_cmp_api TYPE REF TO if_wd_component,
l_window TYPE REF TO if_wd_window.

l_window_manager = lr_comp_api->get_window_manager( ).

" lr_comp_api is Type Ref To IF_WD_COMPONENT.

CALL METHOD l_window_manager->create_external_window
EXPORTING
url = lv_url
has_statusbar = abap_false
has_toolbar = abap_false
has_location = abap_false
RECEIVING
window = l_window
.

l_window->open( ).

Hope it will work.