06-22-2010 6:04 PM
Hi All,
I have a BSP application which will fetch the data from a support central to SAP when a request is submitted from the support central. I'm using a method IF_HTTP_REQUEST~get_cdata( ) for ths purpose. This will give all the required information in XML fromat, which I'm prusing and using for processing the data.
Now after processing a return messages need to be send to a external link. I need to send the return messages in the XML format. How to post data in to external link in XML format.
Thanks in advance
Sabu
06-24-2010 12:30 PM
Hi All,
May I know the relevant method or function module which will POST a xml file to a URL from BSP application in SAP. My requiremnt is to post the xml file to a URL which should trigger a workflow. If I can post the file correctly to the URL, it will take care of all workflow related activities.
I'm struggling in posting the xml file to the URL. I was trying to find a method in classes like IF_HTTP_CLIENT, IF_HTTP_REQUEST, IF_HTTP_RESPONSE etc. But not helping in any ways. If any one can send the code related to similar requirement will be helpful
Thanks in Advance,
Sabu
12-09-2010 5:42 PM
Found solution myself.
Created a RFC destination thru SM59 of the link to which the XML need to be posted.
Then used method CL_HTTP_CLIENT=>CREATE_BY_DESTINATION and below code.
CALL METHOD lo_client->REQUEST->SET_HEADER_FIELD
EXPORTING
NAME = 'Content-Type'
VALUE = 'text/xml'.
CALL METHOD lo_client->REQUEST->SET_CDATA
EXPORTING
DATA = result
OFFSET = 0
LENGTH = length.
CALL METHOD lo_client->SEND
EXPORTING
timeout =
EXCEPTIONS
HTTP_COMMUNICATION_FAILURE = 1
HTTP_INVALID_STATE = 2
HTTP_PROCESSING_FAILED = 3
OTHERS = 4.