cancel
Showing results for 
Search instead for 
Did you mean: 

Canu00B4t call url from Web Dynpro ABAP

Former Member
0 Kudos

Hi all!!

I have to execute an url from a Web Dynpro ABAP.

Initially, I have used the FM 'CALL_BROWSER', but I got an error, I think because a Web Dynpro is an external application and is not recognized the Operating System where is running my application.

Alternatively, I have user the method 'cl_gui_frontend_services=>execute', but I get the error message 'Access via 'NULL' object reference not possible.'

Somebody knows where is the error, or give me another way to call the url, please?

Helpful answers will be rewarded.

Thanks and regards,

Manuel Míguez.

Accepted Solutions (1)

Accepted Solutions (1)

rainer_liebisch
Contributor
0 Kudos

Hello Miguez,

you can use the method CREATE_EXTERNAL_WINDOW of the interface IF_WD_WINDOW_MANAGER to open an external browser window.

Regards,

Rainer

Former Member
0 Kudos

Hi Rainer,

I´m trying to execute the method but I get the error message 'Access via 'NULL' object reference not possible'.

This the call I have done.

DATA: lv_url TYPE string.

data: wa_window type ref to IF_WD_WINDOW.

data: if_window type ref to IF_WD_WINDOW_MANAGER.

CALL METHOD if_window->create_external_window

EXPORTING

url = lv_url

receiving

window = wa_window

Can you see something wrong?

raja_thangamani
Active Contributor
0 Kudos

Try this code:


DATA: api_component  TYPE REF TO if_wd_component,
        window_manager TYPE REF TO if_wd_window_manager,
        window TYPE REF TO if_wd_window.

  api_component = wd_comp_controller->wd_get_api( ).
  window_manager = api_component->get_window_manager( ).
  window = window_manager->create_external_window(
                 url = 'http://www.google.com'
                 modal = abap_false ).

  window->open( ).

Raja T

Former Member
0 Kudos

I have tried the code, but I get an opened browser with the Web Dynpro Application URL concatenated to my url.

This is the funcionality of the method?

Thanks and regards,

Manuel Míguez.

raja_thangamani
Active Contributor
0 Kudos

no. I tried & working fine. its opening<i> google.com</i> is separate window without concatenating any URL.

Post your code here.

Raja T

Message was edited by:

Raja Thangamani

Former Member
0 Kudos

I got the url:

http://capgemecc.capgemini.es:8000/sap/bc/webdynpro/sap/zne_link/myURL

I can´t see anything wrong in the code.

METHOD onactionlink .

DATA: lv_url TYPE string.

data: wa_window type ref to IF_WD_WINDOW.

data: if_window type ref to IF_WD_WINDOW_MANAGER.

DATA lo_nd_parametros TYPE REF TO if_wd_context_node.

DATA lo_el_parametros TYPE REF TO if_wd_context_element.

DATA ls_parametros TYPE wd_this->element_parametros.

  • navigate from <CONTEXT> to <PARAMETROS> via lead selection

lo_nd_parametros = wd_context->get_child_node( name = wd_this->wdctx_parametros ).

  • get element via lead selection

lo_el_parametros = lo_nd_parametros->get_element( ).

  • get all declared attributes

lo_el_parametros->get_static_attributes(

IMPORTING

static_attributes = ls_parametros ).

lv_url = ls_parametros-url.

DATA: api_component TYPE REF TO if_wd_component,

window_manager TYPE REF TO if_wd_window_manager,

window TYPE REF TO if_wd_window.

api_component = wd_comp_controller->wd_get_api( ).

window_manager = api_component->get_window_manager( ).

window = window_manager->create_external_window(

url = lv_url

modal = abap_false ).

window->open( ).

ENDMETHOD.

raja_thangamani
Active Contributor
0 Kudos

Debug & check the value of variable "ls_parametros-url.

". create_external_window will not concatenate anything as per my knowledge..

I think your main problem is solved, calling the URL.

Raja T

Former Member
0 Kudos

Yes, it runs ok.

The problem was I was introducing the url without 'http://'.

If you don´t add 'http://' to the url, I think the method interprets the url like a window of the Web Dynpro.

Thanks and regards,

Manuel Míguez.

sap_cohort
Active Contributor
0 Kudos

Hi, Could someone explain in detail, line by line, what the below code does? (including "TYPE REF")

I'm an abapper and it's all greek to me. (Code works great though!)

DATA: API_COMPONENT TYPE REF TO IF_WD_COMPONENT.

DATA: WINDOW_MANAGER TYPE REF TO IF_WD_WINDOW_MANAGER.

DATA: WINDOW TYPE REF TO IF_WD_WINDOW.

API_COMPONENT = WD_COMP_CONTROLLER->WD_GET_API( ).

WINDOW_MANAGER = API_COMPONENT->GET_WINDOW_MANAGER( ).

WINDOW = WINDOW_MANAGER->CREATE_EXTERNAL_WINDOW( URL = BP_URL MODAL = ABAP_FALSE ).

WINDOW->OPEN( ).

Former Member
0 Kudos

Hi Raja,

          I have written code to call the standard transaction in wddoinit method of view since i need the transaction to be opened as soon as the screen opens. but i am getting 'Access via 'NULL' object reference not possible' . Its throwing error at

   CALL METHOD LO_WINDOW_MANAGER->CREATE_EXTERNAL_WINDOW.

Can you please suggest me on this.

Thanks

Answers (1)

Answers (1)

raja_thangamani
Active Contributor
0 Kudos

you cant use class 'cl_gui_frontend_services=>execute' to call URL in WDA. you need to use FM 'CALL_BROWSER'. What error message did you get when you use FM?

Raja T

Former Member
0 Kudos

The error is the generic error 'Error during the send of data'.

I´ll try to explain you the error.

Debugging I can see that on the FM 'WS_QUERY' inside on the FM 'CALL_BROWSER', it must to be retireved the parameter window_system (WN32), but I get the value '??'.

I think Web Dynpro ABAP can´t run an url.

What do you think, Raja?