Application Development and Automation 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: 
Read only

http data from report

Former Member
0 Likes
417

I would like to create a very simple report that

1) takes as input the url of a web site

2) open an http connection to the site taking its html

3) print the html as proof of hit

I want to do it the SAP server and not the GUI with fm like call_browser. What I have to do exactly if I want my sap server open an http connection to an external url.

Thanks in advance

Gabriele

2 REPLIES 2
Read only

Former Member
0 Likes
383

i have the same problem too,

i wanna open a connection with an external link to test if the server is correctly configured to go outside

anyone can help?

Read only

Former Member
0 Likes
383

solved:

wf_string = 'http://www.google.com'.
  CALL METHOD cl_http_client=>create_by_url
    EXPORTING
      url                = wf_string
    IMPORTING
      client             = http_client
    EXCEPTIONS
      argument_not_found = 1
      plugin_not_active  = 2
      internal_error     = 3
      OTHERS             = 4.

  CALL METHOD http_client->send
    EXCEPTIONS
      http_communication_failure = 1
      http_invalid_state         = 2.

  CALL METHOD http_client->receive
    EXCEPTIONS
      http_communication_failure = 1
      http_invalid_state         = 2
      http_processing_failed     = 3.
  CLEAR result .
  result = http_client->response->get_cdata( ).