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

Problems with web.

SantiMoreno
Participant
0 Likes
345

Hi everybody.

I'm trying to download a file which is set in a web site via a hyperlink which leads to a dialog for downloading/open that file.

Does any of you know how:

- simulate that process from ABAP for getting the file?

- view the entire source code from a page?

I prefer a response to this second question because in the web site I can already find the documentation stored in the file.

Thanks for your helping, fellows.

1 ACCEPTED SOLUTION
Read only

athavanraja
Active Contributor
0 Likes
311

you can use HTTP_GET function module or cl_http_client class for this.

Regards

Raja

2 REPLIES 2
Read only

athavanraja
Active Contributor
0 Likes
312

you can use HTTP_GET function module or cl_http_client class for this.

Regards

Raja

Read only

0 Likes
311

sample code sample using the cl_http_client

call method cl_http_client=>create_by_url
    exporting
      url                = wf_string = "variable holding the url"
    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( ).
  refresh result_tab .
  split result at cl_abap_char_utilities=>cr_lf into table result_tab .
  loop at result_tab into r_str.
    write:/ r_str .
  endloop .

Regards

Raja