cancel
Showing results for 
Search instead for 
Did you mean: 

Filedownload function in WebDynpro

Former Member
0 Kudos

Hello,

How can i download a file on to the C drive which i have as a PDF ( or a smartform ) or in the form of an internal table when running a method of my assistant class of the webdynpro. I dont need to display the table to the users. Just a direct download.

I tried using gui_download function module from one of the methods of the class but it gives me a dump. Can you please let me know.

Thanks,

Amina

Accepted Solutions (1)

Accepted Solutions (1)

abhimanyu_lagishetti7
Active Contributor
0 Kudos

place a LinkToAction UI Element in the View and in Event Handler code as follows

LV_FILENAME = 'RebateRequest.pdf'.

LV_CTYPE = 'pdf'.

CL_WD_RUNTIME_SERVICES=>ATTACH_FILE_TO_RESPONSE(

EXPORTING I_FILENAME = LV_FILENAME

I_CONTENT = LV_CONTENT

I_MIME_TYPE = LV_CTYPE

I_IN_NEW_WINDOW = ABAP_TRUE ).

where LV_CONTENT is XSTRING, convert your internal table to XSTRING.

Abhi

Answers (2)

Answers (2)

uday_gubbala2
Active Contributor
0 Kudos

Hi Amina,

Try go through this [thread |;where I have explained about the file download functionality in WebDynpro ABAP. You can download your file as an XLS/TXT/DOC file using this approach.

Regards,

Uday

Former Member
0 Kudos