cancel
Showing results for 
Search instead for 
Did you mean: 

CLM - Open Webpage via script

Former Member
0 Kudos

Hi experts,

for a customer request we have to write a toolbar script which opens a specific web page.

Usual java libraries seem not to work in SAP Sourcing.

This is the script which works fine in eclipse

URI uriToken;

try {

uriToken = new URI(urlToken);

Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null;

if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) {

desktop.browse(uriToken);

}

} catch (Exception e1) {

throw doc.createApplicationException("", e.toString());

}

But the page is not opened when calling the script in sourcing.

Does anyone have experiences with this topic?

Thanks in advance and regards,

Özlem

Accepted Solutions (1)

Accepted Solutions (1)

former_member190023
Contributor
0 Kudos

Hello Özlem,

Problem is that the requirement itself is not valid from the perspective of Java architecture. The Desktop class is designed to be a link between native and java apps on a host system.

Your code will work in eclipse because both host and client are the same machine; and will not work in a java web app running on a central server. The actual code will **try** to open a browser on the SAP Sourcing server.

Given the fact that all of the SAP Sourcing scripts are executed server-side, I believe that there is no possibility of opening a new browser or tab on the client from a script context.

One alternative solution would be to create an URL extension field and generate/save the link there, instructing the users to click on the link after generation.

Regards,

Bogdan Toma

Former Member
0 Kudos

Hello Bogdan,

thanks for your reply.

Ok I got it. It sounds really like there is no solution.

Thanks also for the alternative solution. If there is no other possibility we are going to do it that way.

Regards,

Özlem

Answers (0)