Skip to Content
author's profile photo
Former Member

Problem with HTTP_GET

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.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • author's profile photo
    Former Member
    Posted on May 05, 2011 at 12:33 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Dec 02, 2009 at 04:45 AM

    Hi,

    Check executing RSHTTP20 program both in foreground and background.

    Is c_path referring to something on your frontend?

    -- Subramanian

    Add comment
    10|10000 characters needed characters exceeded