Skip to Content
author's profile photo Former Member
Former Member

File download or open functionality on Button click

I need to open the file from the directory mounted on the server, ot download it to my local PC on click of a button. There is a control LinkToURL in ABAP Wd which does the same functionality. But I need this functionality on button clicl event. Is it possible to trigger the same event (which is triggered on click of LinkToURL control ) on button click event?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 21, 2008 at 09:35 AM

    Hi

    Insted of link to URL , please use FileUpload / FileDownload UI elements.

    Thanks

    Vishal Kapoor

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 21, 2008 at 10:55 AM

    Hi,

    I dont want to use the fileDownlaod control. I just want to use the functionlaity of FileDownload control without using the control. Is there any way to trigger the same event (as triggered by FileDownload control on click of it) on click of a button?

    Thanks and regards,

    Anand

    Add a comment
    10|10000 characters needed characters exceeded

    • Hello Idhaya,

      it's for Web Dynpro ABAP. Got SAP access today, so here's the code snippet:

        cl_wd_runtime_services=>attach_file_to_response(
          i_filename  = your_filename
          i_content   = your_content_as_xstring
          i_mime_type = 'text/plain' "or what you need
          i_in_new_window = abap_false 
          i_inplace       = abap_false ).
      

      Feel free to experiment with parameters i_in_new_window and i_inplace to adopt them to your needs.

      Best regards,

      Thomas

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.