cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with HTTP_GET

Former Member
0 Kudos

Hi All,

I am fetching the exchange rate data from Web using FM HTTP_GET.

CALL FUNCTION 'HTTP_GET'

EXPORTING

absolute_uri = c_path

rfc_destination = 'SAPHTTP'

TABLES

response_entity_body = it_body

response_headers = it_header

EXCEPTIONS

connect_failed = 1

timeout = 2

internal_error = 3

tcpip_error = 4

data_error = 5

system_failure = 6

communication_failure = 7

OTHERS = 8.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

This works fine in foreground.

But when i schedule in background job,its gives error saying 'error in opening rfc destination'.

I tried using rfc destination 'SAPHTTPA',but it gives error saying 'Document does not contain any data'.

Pls. let me know any suggestions to resolve this.

Thanks,

Supriya.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi All,

When running HTTP_GET (or any program or FM using it) in background you need to:

1) Use SAPHTTPA as RFC_Destination (make sure SAPHTTPA starts on App Server in SM59 TCP/IP Connection)

2) Obtain the IP Address of the URL you are using in ABSOLUTE_URI (using ping)

3) Add this IP and Hostname to the Host File of the Server the SAP Instance is running on for ex>

10.30.192.16 www.fuba.com

Former Member
0 Kudos

Hi,

Check executing RSHTTP20 program both in foreground and background.

Is c_path referring to something on your frontend?

-- Subramanian

Former Member
0 Kudos

c_path is refrerring to weblink from where I am fetching the data.

I have checked RSHTTP20. It works fine in foreground with SAPHTTP.

But gives the same error for SAPHTTA in foreground as well as background.

Thanks,

Supriya.

Former Member
0 Kudos

Hi friends, I am facing the same problem when using HTTP_GET in Background running

Please guide me to silve this problem

Thanks,

ganesh