cancel
Showing results for 
Search instead for 
Did you mean: 

Configure Web Browser for Java GUI on Linux

benoit-schmid
Contributor
0 Kudos

Hello,

We have a few Java GUI using Mac and Linux.

With the same browser config on the Mac and Linux, I have a different behaviour.

On linux, instead of opening a browser with http://correctUrl, it open firefox,

but it passes file:///myHomeDir/http://coorectUrl.

Would you know how I should configure the Sap Gui so that it stops appending this file HomeDir?

Thanks in advance for your answer.

Accepted Solutions (0)

Answers (3)

Answers (3)

benoit-schmid
Contributor
0 Kudos

As the thread continues in call to sap, I close it.

Thanks for your answers

benoit-schmid
Contributor
0 Kudos

Hello,

For your information, we are using the ws_execute method of the cl_gui_frontend_services for this transaction.

Thanks in advance for your help.

RMW
Advisor
Advisor
0 Kudos

Hello Benoît,

you might want to use function call_browser, but for your problem, it would not make a difference.

The two unquoted spaces in the URL are causing the problem.

Best regards

Rolf-Martin

benoit-schmid
Contributor
0 Kudos

Hello,

Have you understand why the Mac version of the Sap Gui behaves "correctly"?

Thanks in advance for your answer.

RMW
Advisor
Advisor
0 Kudos

Hello Benoît,

the reason why this is working on Mac, is that there the parameter for the URL forwarded to the browser "as is", while on Linux, by default it needs to be parsed to set the value for %u parameter in the call to invoke the browser.

See Preferences, Desktop, Applications, Web Browser and compare between Linux and Mac.

As a workaround, you can explicitly set a browser without any parameters. Most browsers do the quoting in case it is missing.

Best regards

Rolf-Martin

benoit-schmid
Contributor
0 Kudos

Hello Rolf,

> you might want to use function call_browser, but for your problem, it would not make a difference.

What is the advantage of the call_browser method instead of the execute one?

Thanks in advance for your answer.

RMW
Advisor
Advisor
0 Kudos

Hello Benoît,

once the execeute method is used correctly for showing a URL in the browser, there is no difference to call_browser, both calls then result in the execution of the same code on client side.

However the execute call comes with a long list of parameters and can be easily used in a wrong way, resulting in depenencies from certain browsers, their location or client platform.

call_browser mainly takes the URL and feeds the execute call appropriately, all the rest is done on client side using the default browser or the one defined in the preferences of SAP GUI in the apprioriate way of the client platform used.

Best regards

Rolf-Martin

benoit-schmid
Contributor
0 Kudos

> As a workaround, you can explicitly set a browser without any parameters. Most browsers do the quoting in case it is missing.

Hello Rolf,

I have tested whithout the %u. The workaround works.

What are the side effects of not setting the %u?

Basically are there things that are not going to work now?

Is your fix going to be included in 720 version 8?

For my information, how have you implemented the fix?

Is it a url quotation?

Thanks in advance for your answer.

Former Member
0 Kudos

Hello Benoît,

To answer your second question first: The fix should end up in the next service release. It will not make it into 7.20rev7, but 7.20rev8 should definitely have it.

Your questions 1 and 3 need some background knowledge about "What is it I actually do when I configure a browser".

The SAP GUI for Java needs to have an application at hand to open URLs.

The default for the Gui is to ask the desktop environment for this application.

Usually all desktop environments maintain something like this.

Since the most desktop environments are XDG compliant they usually answer to this question

with something being a XDG compliant desktop file.

(You can find the specification here:

)

For us this means we have to be able to expand the "Exec" key to obtain an actual command line (fragment) we can then use to find and start an appropriate application.

The desktop entry specification supports several commonly used macros to expand for the "Exec" key the most important are:


%f: one single file name
%F: all given file names (for instance when a list of files is dragged onto an application)
%u: one single URL
%U: all given URLs in a list.

This allows to specify where in the command line a file or URL argument should appear.

So KDE usually specifies:


d024679@ls3567 ~ $ xdg-mime query default text/html
kfmclient_html.desktop
d024679@ls3567 ~ $ grep Exec /usr/share/applications/kde4/kfmclient_html.desktop
Exec=kfmclient openURL %u text/html

The expansion would look like:


kfmclient openURL http:... text/html

For expanding the %u to a URL we convert the parameter sent to us in CALL_BROWSER

(or equivalent in the document parameter of EXECUTE) to an java.net.URI which will

fail if the URI is not valid.

Since the URL you have sent us was not a valid URL exactly this has happened. and since the

parameter from execute could be a file name or an URL we try our best to convert it to File.

This works well if the code deciding if got an URL or a File and the affected

code here trying to convert the %u to an URL agree upon what is an acceptable URL.

For correcting this problem we split the URL apart and try to encode the parts then construct an URI, if this fails we got something not interpretable as an URL.

The work around Rolf-Martin Woersinger told you works by not using the KDE default application but to provide your own command to open an URL.

Essentially what happens now depends on the command line you provide.

If you just use something like:

firefox

or

konqueror

or even

xdg-open

we just happily append the parameter string to the given command (provided we can resolve it on the PATH) and then hope the given application can act properly on the given URL.

with kind regards

Michael Barth

(SAP GUI for Java Development)

benoit-schmid
Contributor
0 Kudos

Hello,

Thanks for your answers.

Unfortunately I still have two problems with the java gui.

1. I sent you a trace where the document viewer hangs (whether on linux

or Mac.).

This is in a standard sap transaction.

It works with the windows gui.

I send you a trace for that.

2. Concerning the original post, with execute method, it launches the web

browser but the sap gui hangs waiting forever after starting the browser.

Thanks in advance for your answer.

RMW
Advisor
Advisor
0 Kudos

Hello Benoît,

unfortunately there is not enough context to tell anything.

In case you want us to investigate this, please generate a trace file while reproducing the issue like described in note 683960, create an official bug report on component BC-FES-JAV and attach the trace file.

In addition to the default trace-keys, please also activate DESKTOP and INFO.

Best regards

Rolf-Martin

benoit-schmid
Contributor
0 Kudos

Hello,

Ok, I have opened the call 1020588.

Thanks for your help.

RMW
Advisor
Advisor
0 Kudos

Hello Benoît,

thanks for the message and the trace file.

The URL to be opened includes spaces which are not quoted like it should in URLs.

We are investigating if we can make the client code able to handle this nicely or if we depend on the backend to send a valid URL.Further progress will be handled in the message.

Best regards

Rolf-Martin

benoit-schmid
Contributor
0 Kudos

Hello,

For your information, to help you investigate, it works without problem in the Java Gui on Mac.

Regards,

RMW
Advisor
Advisor
0 Kudos

Hi again,

it would be interesting if the very same URL is used when testing on the Mac.

If you don't mind, create a tracefile there also and attach it to the message.

Best regards

Rolf-Martin

benoit-schmid
Contributor
0 Kudos

Hello,

I have provided the trace for Mac.

See you,