cancel
Showing results for 
Search instead for 
Did you mean: 

smartform as pdf

Former Member
0 Kudos

Hi experts..

how can we covert smartform output as pdf to on clinet request...

here i had tryed with some examples ... but in my form am passing the values

frrom interface parameters but if we r declaring this its showing error.....

how can we resolvw this prob ...........

tanx in advance.............

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

hi Satya..

use the documentation on the following link..

https://wiki.sdn.sap.com/wiki/display/Snippets/ConvertSmartformtoPDFformat

regrads

nikita.

Former Member
0 Kudos

ls_control_param-getotf = c_x. " Chk this to get otf data

  • call smartform delivery note

call function lf_fm_name

exporting

archive_index = toa_dara

archive_parameters = arc_params

control_parameters = ls_control_param

  • mail_appl_obj =

mail_recipient = ls_recipient

mail_sender = ls_sender

output_options = ls_composer_param

user_settings = c_space

is_dlv_delnote = ls_dlv_delnote

is_nast = nast

importing

job_output_info = it_job_output_info "Smart Forms: Return value at end of form printing

exceptions formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

others = 5.

it_itcoo = it_job_output_info-otfdata[].

if it_itcoo[] is not initial.

call function 'CONVERT_OTF'

exporting

format = c_pdf

importing

bin_filesize = v_bin_filesize

tables

otf = it_itcoo

lines = it_tline

exceptions

err_max_linewidth = 1

err_format = 2

err_conv_not_possible = 3.

concatenate <filename> '.PDF' into v_file.

*Write the PDF file to above specified path in application server

open dataset v_file for output in binary mode.

loop at it_tline.

transfer it_tline to v_file.

"clear wa_tline.

endloop.

close dataset v_file.

Former Member
0 Kudos

c_par-preview = space.

c_par-getotf = 'X'.

out_opt-tddest = 'EPSON-COMMON'.

CALL FUNCTION fm_name

EXPORTING

control_parameters = c_par

output_options = out_opt

user_settings = space

vbeln = it_vbeln-vbeln

pdf = r2

rbiclear = c3

IMPORTING

job_output_info = opt

einv = einv.

i_otf = opt-otfdata.

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

format = 'PDF'

max_linewidth = 132

IMPORTING

bin_filesize = v_len_in

TABLES

otf = i_otf

lines = i_tline.

CONCATENATE file_path 'Invoice_E' lv_exnum '.PDF' INTO full_path.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

bin_filesize = v_len_in

filename = full_path

filetype = 'BIN'

IMPORTING

filelength = file_size

TABLES

data_tab = i_tline.

Former Member
0 Kudos

Hi,

Refer to this link...