cancel
Showing results for 
Search instead for 
Did you mean: 

Download of pdf to our local system by using classes in webdynpro abap

Former Member
0 Kudos

hi,

I createa an application ,in that i converted Smartform to Pdf.I want to download the generated pdf to our local system by using "cl_wd_runtime_services" because we cant directly use FM GUI_DOWNLOAD directly.So can any one please tell me the process.

Accepted Solutions (1)

Accepted Solutions (1)

Yashpal
Active Contributor
0 Kudos

Hi ,

see the below code..

call function 'CONVERT_OTF'

exporting

format = 'PDF'

importing

bin_filesize = pdf_size

bin_file = LV_PDF

tables

otf = lt_otfdata[]

lines = l_dummy

exceptions

err_max_linewidth = 1

err_format = 2

err_conv_not_possible = 3

others = 4.

if sy-subrc <> 0.

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

lv_string = filename

cl_wd_runtime_services=>attach_file_to_response(

i_filename = LV_STRING

i_content = lv_pdf

i_mime_type = 'pdf/application'

i_in_new_window = abap_false

i_inplace = abap_false ).

this will open a popup same as when u download some file...

Regards

Yash

Former Member
0 Kudos

Hi Yashpal,

First of all i want to thank you for solving my problem.It is generating to PDF and iam able to save in my local system.But if my application run in other system then it is showing an run time error like " Please maintain an output device in your user master data". Can you please resolve this error.

Answers (2)

Answers (2)

Former Member
0 Kudos

showing run time error

Yashpal
Active Contributor
0 Kudos

Hi ,

go to tx . su01 , enter the system user name u are logged in and in the tab default enter the output device name like LOCL or which u r using ...

Regards

Yash

Former Member
0 Kudos

Hi Yashpal,

Is there any alternate method for this issue because we dont have the acess of su01.

Yashpal
Active Contributor
0 Kudos

while calling the fm

call function 'FP_JOB_OPEN'

changing

ie_outputparams = fp_outputparams

in paramter fp_outputparams type sfpoutputparams ,

pass the attribute value dest = your output device name , like LOCL or...

it might work try it..

Regards

Yash

abhimanyu_lagishetti7
Active Contributor
0 Kudos

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0de1eb8-0b98-2910-7996-8a3c2fcf...

This will help you

The last statement in the Link is this

elem_pdf->set_attribute(

exporting

name = `SOURCE`

value = pdf_data ).

instead of showing the InteractiveForm UI, place FileDownload UI element and bind the data property to the SOURCE attribute.

Abhi

Edited by: Abhimanyu Lagishetti on Jun 18, 2008 11:25 AM

Edited by: Abhimanyu Lagishetti on Jun 18, 2008 11:28 AM