cancel
Showing results for 
Search instead for 
Did you mean: 

Go to a URL in webdynpro

Former Member
0 Kudos

Hi, I have a table with information of my clients and one of de column has a url, i have done that when make a click on the URL go to the Method ONCLICK and then i want to put de code, I have this

CALL FUNCTION 'GUI_RUN'

EXPORTING

command ='IEXPLORE.EXE'

PARAMETER = <l_value>.

  • CD =

  • IMPORTING

  • RETURNCODE = .

<l_value> has the content of the cell when i make a click, and if I debbug that has my url, but the aplication doesn't do anything or the function doesn't do it.

If I put this in a commun report open the the Internet Explorer and go to the Url that i wrote, but in the webDynpro I CANT DO IT WORKS.

Can Anybody help me???

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Andres,

The mentioned table column editor should be made as LinkToUrl and bind the TEXT property of this LinkToUrl element to context node attribute containing the URL and in the Onaction property of this element you first get the URL and then get the window manager and call its create_external_window() method this would open URL in a new window.See the sample code below:

lr_weblink_node = context_element->get_child_node( name = wd_this->wdctx_weblink ).

lr_weblink_elem = lr_weblink_node->get_element( ).

CALL METHOD lr_weblink_elem->get_attribute

EXPORTING

name = 'WEBLINK'

IMPORTING

value = lv_weblink

.

if not lv_weblink is initial.

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_cmp_api = wd_this->wd_get_api( ).

l_window_manager = l_cmp_api->get_window_manager( ).

CALL METHOD l_window_manager->create_external_window

EXPORTING

url = iv_url

  • title =

  • 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_TRUEk

RECEIVING

window = l_window

.

l_window->open( ).

endif.

I hopw this answers your question

Thanks

Aditya

Answers (2)

Answers (2)

Former Member
0 Kudos

As far as I know function module GUI_RUN only works in a SAPGUI environment. with a report you are in SAPGUI. With a WebDynpro application you are in the browser and this does not know SAPGUI. follow the hints of Matthias and then it should work - by the way the much better and flexible way, because what would your function help a user who only has firefox or opera as browser and not MSIE?

As a rule of thumb: Always avoid browser-/product-specific features in a web envirnonment.

Regards,

Volker

Former Member
0 Kudos

Hi Andres,

if I understand you right, you want a link to an URL, when the user clicks on this link the URL should be openend (in a new browser window), right? You can do that with the UI element "LinToURL", that you can add to the table column.

Just fill the "text" property as you like, the "reference" property to the target (URL), of course you can set the text to the URL too. If you want to open the URL in a new browser window, you can set "_blank" as the "target" property.

Best regards, Matthias