cancel
Showing results for 
Search instead for 
Did you mean: 

Opening an external URL from the Web UI

Former Member
0 Kudos

Hello,

I want to use the Web UI in order to open an external URL.

I know it can be done easily using JavaScript, but the URL is generated from one of the page controller methods, and I want to open it directly from there.

I know that there's the Window Manager in the Component Controller, that can open popup windows, but none of it's methods receive an external URL.

So how can I open an external URL from the Web UI methods?

Thanks,

Udi.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Udi,

Yes you can implement javascript call in the button.

How to do that :

Redefine METHOD if_bsp_wd_toolbar_callback~get_buttons.

ls_button-text = 'xxxx'.

lv_javascript = 'javascript:window.open("'.

CONCATENATE lv_javascript lv_url INTO lv_javascript.

CONCATENATE lv_javascript '","","resizable=yes,width=1025,height=500,scrollbars=yes,location=no,menubar=no,toolbar=no,location=no,directories=yes,dependent=yes,status=no")' INTO lv_javascript.

ls_button-on_client_click = lv_javascript.

ls_button-page_id = me->component_id.

lls_button-enabled = abap_true.

APPEND ls_button TO rt_buttons.

Hope it's help,

Lina

Former Member
0 Kudos

Hi,

You can use Transaction Launcher to open external URL.

Please find the link to configure TL http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/f0da6d63-8485-2c10-dab6-bb202e209455

Regards

Vinod

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

you can use the Trnsaction launcher with OP.

in the window you create an OP_X

with the code

data: lv_navigation type ref to if_crm_ui_navigation_service.

lv_navigation = cl_crm_ui_navigation_service=>get_instance( me ).

lv_navigation->navigate( iv_link_id = 'ZTO_X' ). "runtime you create the TO_X nevigation"

in your implamentation class of the view you add a preotected method OP_TO_X with the code

data:

lr_window type ref to cl_bsp_wd_window.

lr_window = me->view_manager->get_window_controller( ).

lr_window->call_outbound_plug( iv_outbound_plug = 'TO_X'

iv_data_collection = iv_data_collection ).

and you call to that method from the EVENT_HANDLER you want.

Amit.

Former Member
0 Kudos

Thank you for replying.

Lina, your solution is fine, but the only problem is that the URL is generated from the button's onClick event, and the JS code executes before that.

I'll check deeper into the Transaction Launcher.

Thank you both.