Skip to Content
author's profile photo Former Member
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 a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    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 a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    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 a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.