cancel
Showing results for 
Search instead for 
Did you mean: 

Download file to desktop without any dialog.

Former Member
0 Kudos

Hello Experts,

I have a requirement wherein I need to download the data present in a context to a specific location of local machine. The user does no want to select the destination folder, so there would be no further action required from user after clicking the Download button.

I tried using class CL_GUI_FRONTEND_SERVICES but it is not compatible in WD framework. I also checked class CL_WD_RUNTIME_SERVICES but it gives a dialog to select the destination folder.

Please let me know your ideas and suggestions at the earliest.

Regards,

Amit

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

If you are on NetWeaver 7.0 Enhancement Package 1 or higher, you can use the new UI element ACFUpDownload to perform silent downloads:

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/47/b9157c878a2d67e10000000a42189c/frameset.htm

This UI element is designed for use with the content/cache server, but if you want to send the data directly from Web Dynpro I have a tutorial online for that:

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/109b9b52-bc00-2c10-8786-e4c5e96d7...

And Sample Source Code:

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/70645070-bb00-2c10-f086-f126721ac...

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Amit,

Use the below class and method.

cl_wd_runtime_services=>attach_file_to_response(

i_filename = 'filename.extension'

i_content = file_conetent

i_mime_type = '/Desktop').

Regards,

Simi A M

Former Member
0 Kudos

Hi Amit ,

you can also use the class CL_ABAP_ZIP for downloading the file to the desktop.

Regards

Kuldeep

gill367
Active Contributor
0 Kudos

I guess the only campatible methods are those which are available in CL_WD_RUNTIME_SERVICES class.

and i think there no method will download it directly to some folder.

and i guess it does make sense also.

in case of GUI, you are sure of soem location in GUI for downlaod.

but in case of Wd you are never sure that the specified location is existing there or not.

thanks

sarbjeet singh

Former Member
0 Kudos

HI

Use FM GUI_DOWNLOAD and if the data is huge you can use class CL_ABAP_ZIP class for zipping the data and then send it to desktop .

Regards

Kuldeep

Former Member
0 Kudos

Thanks for the reply. But the mentioned FM is also not compatible in WD.

Regards,

Amit