cancel
Showing results for 
Search instead for 
Did you mean: 

Execute URL without using any URL Link UI element

anand_nidamanuru
Active Participant
0 Kudos

Hi,

I have a requirement in which, my weddynpro component has to execute a URL at runtime from webdynpro code. Below are my requirements

1) The url is a "mailto:" url, so that it opens a default mail client like outlook

2) It should not open any new IE window

3) There will be no URL UI elements on the browser page, this should be done at runtime from the code.

Please let me know if there is any class/method to achieve the same.

Thanks in advance,

Anand

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hmmm interesting one. How hack questions.

The user shouldnt press on a MAILTO: link on a page. Why not?

That is one click too many ?

Most people refer to this as a virus when OUTLOOK launches and they did nothing.

Expect good virus programs to catch it.

Something like this:

use the attach_to_response method

cl_wd_runtime_services=>attach_file_to_response

The object should be of type extension .vbs (visual basic script)

Or another scripting language you prefer.

The script should launch mailto:

Their Outlook client with fire up like good little beast it is. (assuming no virus scanning etc)

OR

Have a view with a link with URL content "mailto:xxxxxx" like most people.

Question:

Does someone really want you to launch OUTLOOK from WDA with no user interaction?

Why is one click not acceptable ?

TRY THIS:

Create a file with extension .URL

Try open it on windows.... What did it do?

try create a file with name mailto:xxxxxx

The attempt to get IE to launch outlook or use a mimetype should be locked down.

Scripting is possible.

thats why most virus scanner tools block vbs extensions.

happy hacking

Phil.

anand_nidamanuru
Active Participant
0 Kudos

Hi Phil,

Thanks for your reply.

I dont deny that it would make a pretty little virus

But my requirement is, suppose the user has pressed a button, so that it does some processing and displays and outlook email window.

The user is aware that pressing this button will display a window to me. I am actually not aware if the user is fine with pressing a link or not. I have to yet get this cleared.

But what intrigued me most is how to execute an URL, how to acheive the same functionality as clicking on URL. We have Client, Link, URL classes in webdynpro. But no methods in these classes, I could figure out, would achieve this.

Again, is there any other way to achieve this apart from writing a script file, as I dont think, this is possible in our application.

Thanks,

Anand

anand_nidamanuru
Active Participant
0 Kudos

This issue has been resolved.

I am able open a mail using default Email client by clicking on a button.

In the button action, I created a mail URL and stored it in a string.

Then using the window manager created an external window as shown below

********

window_handle = lr_window_manager->create_external_window ( exporting url = url_string )

********

Now there is method SET_CLOSE_IN_ANY_CASE for IF_WD_WINDOW interface, that sets a flag, which forces the window to close in any case when the next action for the window is executed.

********

window_handle ->set_close_in_any_case( EXPORTING close_in_any_case = abap_true ).

window_handle ->open( ).

********

Now as the external window opens using URL, which happens to be a mail URL, it tries to open default mail client like Outlook or lotus notes and immediately the external window closes (this can not be observed by the user).

anand_nidamanuru
Active Participant
0 Kudos

In the above mentioned example

The mail URL is just a string like

url_string = 'mailto:anand@example.com?subject=Hi'