Application Development 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: 

Sending a response feed to external link using BSP application

Former Member
0 Kudos

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

2 REPLIES 2

Former Member
0 Kudos

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

Former Member
0 Kudos

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.