Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Function module HTTP_POST in Background

Former Member
0 Likes
566

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?

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,

Srilakshmi.

3 REPLIES 3
Read only

athavanraja
Active Contributor
0 Likes
472

AFAIK it should work in background as well. what do you get in response_header[] table . is the sy-subrc still 0

Read only

0 Likes
472

Hi Raj,

So according to your understanding background processign is also possible with the same FM (HTTP_POST).

So is there any special thing which we need to pass into the interface of the FM for taking care the background processing scenario.

According to my understanding in the Response header we will get details from the linked webpage(URL which we pass in the FM). In my report i want to process that linked details coming thru Response header.

Thanks,

Srilakshmi.

Read only

0 Likes
472

what i asked was did Response header returns anything when the fm is called?

I havent used HTTP_POST for a backgorund option. however i am using cl_http_client for getting some RSS feeds, which is running as a background job without any problem.

If interested, i can help you cl_http_client coding