Skip to Content
avatar image
Former Member

Sending a response feed to external link using BSP application

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Jun 24, 2010 at 11:30 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 09, 2010 at 05: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.

    Add comment
    10|10000 characters needed characters exceeded