on 08-28-2007 9:30 AM
Dear colleagues,
in a 6.20 system I would like to check user input in an URL field. I would like to check if the given input is a valid URL.
I'm looking for an ABAP function modul call or an ABAP method with an importing parameter for the URL and return either a variable or exception in case the URL is not a valid one.
Example for what I'm looking for is:
If the user enters : 'http://www.wetteronline.de' is to be a valid URL
there the user enters as URL 'http://www.wttonl.de' results in an HTTP 500 Error and therefore would return from the function modul or method, that it is an invalid URL.
Any suggestion how to program this check are welcome.
Best regards and thanks
hans-Ludwig
what you could do use cl_http_client class and send a dummy http request to the site to see whether its available or not.
check out the following program for sample code
RSWF_TEST_HTTP
Regards
Raja
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raja,
thank you for the hint to the report RSWF_TEST_HTTP:
I checked it out. Unfortunetaly I got in both cases (valid and invalid URL) the same answer from the report:
HTTP-Receive: RC=400 ICM_HTTP_CONNECTION_FAILED
So I do not have here a differentiation to distinct the two types of URL.
Is there another option, or do you know how to customize the system, that it would give in the case of the correct URL NOT an error message?
(I checked the report in 3 systems (6.20, 6.40, 6.40).
Thanks and regards Hans-Ludwig
do you connect to internet via proxy server? can you check the valid url in browser to see whether you are able to access them
if you connecting to internet thru proxy server, then you have to mainting proxy server/authentication details from transaction SICF->client->proxy settings.
Message was edited by:
Durairaj Athavan Raja
If I enter in the browser: http://www.wetteronline.de
I get the expected result, and it works fine.
If I enter the same URL (cut and paste) into the input field of the report I get the error message.
as i said before this required only if you are connecting to internet via proxy and the url you are trying to reach is on internet.
SICF GOTO->HTTP client proxy settings
in global settings tab
check the check box "proxy setting is active"
and in the "HTTP log" tab
enter proxy host name e.g proxy.sap.com....
enter the proxy server port (generally 80)
if required you need to enter
proxy server authentication (uid/pwd)
Regards
Raja
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.