cancel
Showing results for 
Search instead for 
Did you mean: 

Calling https:// url from ABAP code IF_HTTP_CLIENT

Amey-Mogare
Contributor
0 Kudos

Hi,

Is call to https:// type URLs possible through ABAP code?

Can IF_HTTP_CLIENT be used in this case?

If no, what are the alternatives?

Please help.

Thanks and regards,

Amey

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

I have a requirement to send XML data from ECC to 3rd party URL which starts with HTTPS://.

Can any body tell me " How to achieve this ".

Please share me the information regarding this.

Thanks in advance.

Regards,

Namdev

Former Member
0 Kudos

Hi,

Am sending a mail to outlook trigered through woek flow. mail content contains a url address. i need to hide the url address and give my own text with hyperlink instead of the address. how to shorten the url.

Please help.....

Thanks and Regards,

Jenifer

0 Kudos

Hi Namdev,

Did you get any solution to send XML data from ECC to 3rd party URL which starts with HTTPS://?

I too have the same kind of requirement, can you please share the solution if you have achieved it?

Thanks in Adv..

Regards,

Nag

Pramanan
Active Participant
0 Kudos

Hi,

Did you find any solution. I am facing the same issue. Please share if you have any solution to achieve this.

i need solution to read file content using RFC destination approach.

Thanks,

Ramanan

Amey-Mogare
Contributor
0 Kudos

Resolved myself.


"STEP-1 : CREATE HTTP CLIENT
CALL METHOD CL_HTTP_CLIENT=>CREATE_BY_URL
    EXPORTING
      URL                = WL_URL
    IMPORTING
      CLIENT             = W_HTTP_CLIENT
    EXCEPTIONS
      ARGUMENT_NOT_FOUND = 1
      PLUGIN_NOT_ACTIVE  = 2
      INTERNAL_ERROR     = 3
      OTHERS             = 4
      .

  DATA: EMPTYBUFFER TYPE XSTRING.

      EMPTYBUFFER = ''.
  CALL METHOD W_HTTP_CLIENT->REQUEST->SET_DATA
        EXPORTING DATA = EMPTYBUFFER.

"STEP-2 :  AUTHENTICATE HTTP CLIENT
CALL METHOD W_HTTP_CLIENT->AUTHENTICATE
  EXPORTING
    USERNAME             = 'user'
    PASSWORD             = 'password'
    "LANGUAGE             = SY-LANGU
    .

CALL METHOD W_HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
     EXPORTING NAME  = '~request_method'
               VALUE = 'GET'
                .

 CALL METHOD W_HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
      EXPORTING NAME  = 'Content-Type'
                VALUE = 'text/xml; charset=utf-8'.

 CALL METHOD W_HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
      EXPORTING NAME  = 'Accept'
                VALUE = 'text/xml, text/html'.

 CONCATENATE WL_URL '#' INTO SOAP_ACTION.
 CALL METHOD W_HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
      EXPORTING NAME  = 'SOAPAction'
                VALUE = SOAP_ACTION.

"STEP-3 :  SEND HTTP REQUEST
  CALL METHOD W_HTTP_CLIENT->SEND
    EXCEPTIONS
      HTTP_COMMUNICATION_FAILURE = 1
      HTTP_INVALID_STATE         = 2.

*-----------------------------------------------------------------

"STEP-4 :  GET HTTP RESPONSE
    CALL METHOD W_HTTP_CLIENT->RECEIVE
      EXCEPTIONS
        HTTP_COMMUNICATION_FAILURE = 1
        HTTP_INVALID_STATE         = 2
        HTTP_PROCESSING_FAILED     = 3.

"STEP-5 : Read HTTP RETURN CODE
CALL METHOD W_HTTP_CLIENT->RESPONSE->GET_STATUS
    IMPORTING
      CODE = HTTP_STATUS_CODE
      REASON = STATUS_TEXT
      .
  WRITE: / 'HTTP_STATUS_CODE = ',
          HTTP_STATUS_CODE,
         / 'STATUS_TEXT = ',
         STATUS_TEXT
         .

"STEP-6 :  READ RESPONSE DATA
 CALL METHOD W_HTTP_CLIENT->RESPONSE->GET_CDATA
        RECEIVING DATA = W_RESULT .

Former Member
0 Kudos

Hi Amey,

I have a requirement to send an XML file from SAP to Third party URL starts with HTTPS://.

I would like to know, how can i achieve this task. Is your code will work for me also?

If yes please share the complete code. Also let me know is there any basis settings required for this task.

It is very urgent.. Thanks in Advance.

Regards,

Namdev