cancel
Showing results for 
Search instead for 
Did you mean: 

calling browser/URL from the link on webpage

Phalani2
Participant
0 Kudos

Dear Experts,

My requirement is, I have a webdynpro component, I need to add a link on particular view which calls another webpage(either in a new window or in same window) if I click on that.

To fulfill my requirement I used CALL_BROWSER FM.

The problem here is am getting dump from the FM.

Dump text:

Error in the ABAP Application Program

The current ABAP program "CL_GUI_FRONTEND_SERVICES======CP" had to be

terminated because it has

come across a statement that unfortunately cannot be executed.

Am getting this error from cl_gui_frontend_services=>execute (inside CALL_BROWSER)

Please guide me how to proceed here (I guess I should not use CALL_BROWSER since already am in browser).

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Is there any specific requirement that you are using a function module to open a web page ? Otherwise you can just use the LinktoUrl UI element to open a web link.

Regards,

Trikanth Basetty

Answers (1)

Answers (1)

Former Member
0 Kudos

To open a URL in a separate window you can use the following code,

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.co.in/'
    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( ).

Hope it helps!

Regards,

Radhika.