cancel
Showing results for 
Search instead for 
Did you mean: 

change output device in smartform when using gui_diwnload

koolspy_ultimate
Active Contributor
0 Kudos

can any one please tell me how to change the output device for gui_download into pdf for a smartform.

(i want the setting to be done in my report -driver program , not in sap application tool bar settings)

kindly please suggest me,

thanks in advance,

koolspy.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I give you an example

DATA: ls_control_param TYPE ssfctrlop.

DATA: ls_composer_param TYPE ssfcompop.

  • Parametros por defecto para la generación de la orden de spool.

ls_composer_param-tddataset = 'PDF'.

ls_composer_param-tdsuffix1 = 'FACT.'.

ls_composer_param-tdsuffix2 = nast-OBJKY.

ls_composer_param-TDDEST = 'LP02'.

  • output_options-tdprinter = 'PRINTER'.

ls_composer_param-tdnewid = 'X'.

ls_composer_param-tddelete = 'X'.

ls_composer_param-tdfinal = ' '.

ls_composer_param-tdlifetime = 8.

ls_control_param-no_dialog = 'X'.

ls_control_param-preview = ' '.

ls_composer_param-tdimmed = ' '.

ls_control_param-getotf = 'X'.

  • call smartform invoice

CALL FUNCTION lf_fm_name

EXPORTING

archive_index = toa_dara

archive_parameters = arc_params

control_parameters = ls_control_param

mail_recipient = ls_recipient

mail_sender = ls_sender

output_options = ls_composer_param

user_settings = space

is_bil_invoice = ls_bil_invoice

is_nast = nast

is_repeat = repeat

is_vbdkr = is_vbdkr

IMPORTING

job_output_info = job_output_info

document_output_info = document_output_info

job_output_options = job_output_options

TABLES

gt_vbdpr = gt_vbdpr

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5.

    • Convertimos el fichero OTF a PDF

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

format = 'PDF'

  • MAX_LINEWIDTH = 132

  • ARCHIVE_INDEX = ' '

  • COPYNUMBER = 0

  • ASCII_BIDI_VIS2LOG = ' '

  • PDF_DELETE_OTFTAB = ' '

IMPORTING

bin_filesize = file_size

  • BIN_FILE =

TABLES

otf = job_output_info-otfdata

lines = lt_pdf

EXCEPTIONS

err_max_linewidth = 1

err_format = 2

err_conv_not_possible = 3

err_bad_otf = 4

OTHERS = 5

.

Hope it helps.

koolspy_ultimate
Active Contributor
0 Kudos

any new updates?

Answers (3)

Answers (3)

koolspy_ultimate
Active Contributor
0 Kudos

answered

Former Member
0 Kudos

Hey,

it is not clear from your question what you want. If what you want is to download an smartform to a pdf, set in the smartform function module call the parameter control_parameters-otf to u2018Xu2019 and the function will give you back the OTF in the structure job_output_info-otfdata. Later on, you could transform this OTF to a pdf by function CONVERT_OTF with the parameter format = 'PDF' and the table OTF = the otf table (job_output_info-otfdata) and the table lines the pdf file.

Then you just have to download the pdf file, in table lines with for example the function gui_download.

hope it helps.

Venkat_Sesha
Advisor
Advisor
0 Kudos

Hi,

First of all you need to assign the output type to the Smartform.

then you can change, issuing the output based on the o/p type from the menu header.

If this does not solve your question. Please explain more about your issue/requirement.

Thanks,

Bhargav