cancel
Showing results for 
Search instead for 
Did you mean: 

button to trigger action then call URL

Former Member
0 Kudos

Hi all,

Does anyone know if it is possible to create a web dynpro button which when pressed triggers an action. Within the method of this action i want to execute some ABAP code then call a website URL.

Is this possible and does anyone know what the syntax for the URL call would be.

Thanks in advance

Mart

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Mart

Use this piece of code in the onaction method of the button

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/'
  RECEIVING
    WINDOW         = lo_window.

lo_window->open( ).

Hope this helps u

Regards

Tamil

Former Member
0 Kudos

Thanks Tamil,

sorry for the delay, have been away for last couple of days,

that does the trick nicely

Regards

Mart

Former Member
0 Kudos

Hi Tamil,

Is it possible to display in the webdynpro application itself instead of calling the new wondow?

Thanks

Bryan

Former Member
0 Kudos

Hi Bryan,

You could call a web dynpro view which contains a UI element of type IFRAME, and within the attribute of the iframe element put the URL you want to display

Regards

Mart

david_fryda2
Participant
0 Kudos

Hi,

You can call a URL from the application itself by using EXIT PLUG.

Regards

Answers (1)

Answers (1)

abhimanyu_lagishetti7
Active Contributor
0 Kudos

you can use Exit Plug if you want to exit the application and move to new URL or if you want to come back to the same state of web dynpro application from the URL page in this case you have to edit the target application to resume the web dynpro applicaiton you have to use suspend and resume plugs

[Exit Plug|http://help.sap.com/saphelp_nw04s/helpdata/en/45/1bc575ba064574e10000000a114a6b/content.htm]

[Suspend and Resume Plugs|http://help.sap.com/SAPHELP_NW04S/helpdata/EN/45/19bf8c16f25d7ae10000000a11466f/content.htm]

Abhi