Skip to Content

SAP-ABAP -Accessing URL in SAP -HTTP Commulication Failure

Hi,

I am facing issue while accessing URL in SAP.I have created report which is accessing the URL .

I am having one demo server where i can access URL and gets the data from site properly and on my client Server when i am trying to access URL ..It's giving HTTP Communication Failure Error.

Code Below :-

CALL METHOD CL_HTTP_CLIENT=>CREATE_BY_URL

EXPORTING

URL = 'http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml'

IMPORTING

CLIENT = HTTP_CLIENT.

IF SY-SUBRC = 0.

HTTP_CLIENT->SEND( ).

CALL METHOD HTTP_CLIENT->RECEIVE

EXCEPTIONS

HTTP_COMMUNICATION_FAILURE = 1

HTTP_INVALID_STATE = 2

HTTP_PROCESSING_FAILED = 3.

IF SY-SUBRC = 0.

MESSAGE 'Processing failed !' TYPE 'S' DISPLAY LIKE 'E'.

ENDIF.

Do we need to do setting and yes then What setting we need to do?

Kindly Suggest the same.

Thanks

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Jul 16, 2015 at 06:44 AM

    Hi,

    Maybe you can use report RSHTML01 to test if the URL can be accessed.

    If yes, you can copy the coding in the report.

    Thanks.

    Jim

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 30, 2015 at 03:47 PM

    Sorted Out issue .I Have done analysis of both system and i found that one field is translated_path was missing in other server.

    So i have done enhancment in CL_HTTP_Client Class.

    Add comment
    10|10000 characters needed characters exceeded