‎2008 Feb 20 8:59 AM
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.
‎2008 Feb 20 9:07 AM
AFAIK it should work in background as well. what do you get in response_header[] table . is the sy-subrc still 0
‎2008 Feb 20 9:30 AM
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.
‎2008 Feb 20 9:37 AM
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