2006 Oct 11 7:08 AM
Hi Friends,
I have a requirement where i need to check whether a perticular http service is running or not. For that i need a some code to call http url from abap and it should not open the browser. If that perticular url is not found or time out then i should know that in program...
Is there any way to do that..
2006 Oct 11 9:02 AM
2006 Oct 11 10:22 AM
Hi,
I have gone through the link. And i have pasted it in Abap program.One problem got solved(No Broeser).But still i am missing something in that code.I am not getting any exception even the url is invalid. I wonder how can i differentiate the valid URL and invalid URL in the Abap code.
Ex: Valid URL:-- http://www.google.com
Invalid URL:- http://172.25.1.118/index.html --> Here the Server is not running so i will get Page can't be displayed error if i open it in Browser...
I hope u understood my requirement... If not please let me know i will explain it in more detail....
2006 Oct 11 10:30 AM
you would get the error for invalid url in this portion of the code
http_client->response->get_status(
IMPORTING
code = code
reason = err_string
).
what do you get for code and err_string when its a valid url and when its not?
Regards
Raja
2006 Oct 11 10:33 AM
and also in the linked code
if code is initial .
CLEAR result .
result = http_client->response->get_cdata( ).
endif .
comment if code is initial check and just have
CLEAR result .
result = http_client->response->get_cdata( ).
what do you get in result in case of invalid url and in case of valid url
Regards
Raja
2006 Oct 11 11:15 AM
Hi Raja,
Here sending the results for both Valid & Invalid URLs
Valid URL: code = 404
response = not found
result = ' ' (Nothing is there)
Invalid URL: Same as Above....
I thought that in send step itself we will get exception if it is invalid URL. Is it so ??????
2006 Oct 11 11:38 AM
not after the send step.
so you are saying for both valid and invalid url you are getting 404 error.
right?
when you normally call a internet site from browser, do you have to provide proxy authentication? or any other authentication?
Regards
Raja
2006 Oct 11 11:42 AM
Hi Raja,
We don't need to provide any authentication. Any how here i atried to use intranet sites also. but i get the same response for both valid and invalid intranet links....
2006 Oct 11 11:55 AM
surprising, it works for me very well.
which version of R/3 are yu using?
Regards
Raja
2006 Oct 11 12:00 PM
Hi Raja,
Even it doesn't work for me..
It is giving same error for me also..
Please throw some light on it..
cheers,
Simha.
2006 Oct 11 12:50 PM
for this to work ICM (internet communication manager) should have been configured and running.
can you do the following .
go to transaction SICF and expand the tree
defaults_host->sap->public and right click on the node ping and click test. it should open the browser and what do you see in the browser?
Regards
Raja
2006 Oct 11 1:16 PM
Hi Raja,
I tried to do the same u said. But when i right click on ping i can't find test. Is there any other way to test ....
2006 Oct 11 1:19 PM
just run the following url (after changing the values for host,etc) from browser
http://<abaphost>.<domain>.com:<port>/sap/public/ping
to get the values for http://<abaphost>.<domain>.com:<port>; just go to transaction se80 and choose bsp application option and choose any existing bsp application and then doubl click on a page. on the right side click on the attributes tab and at the end you can find the url
Regards
Raja