cancel
Showing results for 
Search instead for 
Did you mean: 

error-page with browser check?

daniel_humberg
Contributor
0 Kudos

I am trying to add an error-page to my BSP-application.

is there a way to check which browser (and version) the user uses?

i would like to show a error page for all users that don't use IE..

Accepted Solutions (1)

Accepted Solutions (1)

Ulli_Hoffmann
Contributor
0 Kudos

Hi Daniel,

in event handler or controller try

CALL METHOD request->GET_USER_AGENT

IMPORTING

user_agent_type = user_agent_type

user_agent_version = user_agent_version.

Also see cl_bsp_login_application->check_browser for a coding example.

regards,

Ulli

daniel_humberg
Contributor
0 Kudos

thanks, the example gives me everything I need except for one additonal thing:

How can I obtain the information that is normally shown on the default-error page, i.e. the error-number or the error text?

Ulli_Hoffmann
Contributor
0 Kudos

Hi Daniel,

I'm not really sure if I understand what your problem is.

What do you mean with "normally shown .."?

Brian has once written a weblog about messages handling(/people/mark.finnern/blog/2003/09/16/bsp-in-depth-message-statement-handling). If this isn't what your looking for, then give a little example, what you'd expect to display.

regards,

Ulli

daniel_humberg
Contributor
0 Kudos

sorry, my question was really not very clear.

i am thinking about the error-title (e.g. 500 SAP Internal Error), the error description (e.g. "Dies ist eine Fehlermeldung") and the termination-reason (e.g. "ABORT_MESSAGE_STATE").

Ulli_Hoffmann
Contributor
0 Kudos

Hi Daniel,

I wouldn't recommend to manipulate http status codes in cases where you want to give feedback to the user regarding supported browser versions and types. Either you leave it completely to the server (I suppose WebAS gives some messages in case htmlb/xhtmlb etc. isn't supported) or you render your self-defined error page with a meaningful message.

regards,

Ulli

daniel_humberg
Contributor
0 Kudos

no, if you access a htmlb-page with another browser (e.g. mozilla), a shortdump is being generated and a "standard" http500 page is shown.

my plan was to add a try/catch somewhere on my startpage, catch that error, show an error-page if the error occurs, check in the error-page if the user really uses a different browser and show the "normal" error page otherwise.

would you recommend that?

Former Member
0 Kudos

Might be more work than you need.

In your login mask you can do a simple JavaScript check for the browser type and redirect as needed for a browser that doesn't work and to the login for one that does.

You can also give them a link to proceed to the login anyway as some browser/people hide the actual browser type they use or they use a browser that gives a strange type but is IE compliment and would work anyway.

Ulli_Hoffmann
Contributor
0 Kudos

Hi Daniel,

please check out thread

and especially Brian's comments for configuring an error page in SICF.

regards,

Ulli

Answers (0)