Skip to Content
author's profile photo Former Member
Former Member

Function module HTTP_POST in Background

Hi all,

I am using function module HTTP_POST to get xml from web. My object is working perfectly fine when I execute it in foreground (online) but the same when executed as a background job is not returning me anything.

Questions:

1. Is it possible to use this function module in a background job?

2. What can be errors in this case?

3. Solution please....

Points guranteed for the solution or helpful replies.

My code for reference:

CALL FUNCTION 'HTTP_POST'

EXPORTING

ABSOLUTE_URI = urlstring

REQUEST_ENTITY_BODY_LENGTH = reqlen

RFC_DESTINATION = 'SAPHTTP'

  • PROXY =

  • PROXY_USER =

  • PROXY_PASSWORD =

  • USER =

  • PASSWORD =

  • BLANKSTOCRLF =

  • IMPORTING

  • STATUS_CODE =

  • STATUS_TEXT =

  • RESPONSE_ENTITY_BODY_LENGTH =

TABLES

REQUEST_ENTITY_BODY = xmldoc[]

RESPONSE_ENTITY_BODY = response_body[]

RESPONSE_HEADERS = response_header[]

REQUEST_HEADERS = request_header[]

EXCEPTIONS

CONNECT_FAILED = 1

TIMEOUT = 2

INTERNAL_ERROR = 3

TCPIP_ERROR = 4

SYSTEM_FAILURE = 5

COMMUNICATION_FAILURE = 6

OTHERS = 7.

Thanks- Ags.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jan 19, 2008 at 04:56 AM

    Hi Agasti,

    Use class CL_HTTP_CLIENT. there is a method SET_HEADER_FIELD , u can use POST in that.

    It will be something like below:

    data: client type ref to if_http_client.

    ur code to call the webservice API (method CREATE or CREATE_BY_URL

    CALL METHOD client->request->set_header_field

    EXPORTING

    name = '~request_method'

    value = 'POST'.

    It will work.

    cheers,

    Hema.

    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.