Skip to Content
0
Former Member
Jun 26, 2010 at 08:29 AM

Smartform NODIALOG , OTF issue

1526 Views

Hi Experts,

My requirement is to convert Smartform to PDF and download it in local drive. I wanted to suppress the Print option dialog, I have done the coding to suppress it but still the Print Option dialog opens and It asks for Print . If i give print Preview also, When i check the return parameter ( it_jobout1-otfdata[ ]) from Smartform function module , the OTF data is Empty. I have attached my code below. Please suggest me what i am missing to suppress the dialog and to get the OTF data in return ?

v_control_parameters-getotf = 'X'.

v_control_parameters-no_dialog = 'X'.

v_control_parameters-device = 'PRINTER'.

wa_compop-tddest = 'LOCL'.

*TO CALL THE FUNCION MODULE TO PRINT THE SMART FORMS

CALL FUNCTION v_fun_name

EXPORTING

control_param = v_control_parameters

output_options = wa_compop

  • user_settings = ' '

is_ekko = is_ekko

v_tot = v_tot

v_menge = v_menge

v_meins = v_meins

IMPORTING

job_output_info = it_jobout1

TABLES

it_tab1 = it_tab1

it_tab2 = it_tab2

it_tab3 = it_tab3

it_hedr = it_hedr

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

wa_conv_file = it_jobout1-otfdata[].

*TO CONVERT THE OTF DATA TO PDF

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

format = 'PDF'

max_linewidth = 132

IMPORTING

bin_filesize = l_file_size

TABLES

otf = wa_conv_file

lines = wa_dwld_file_format

EXCEPTIONS

err_max_linewidth = 1

err_format = 2

err_conv_not_possible = 3

err_bad_otf = 4

OTHERS = 5.

IF sy-subrc <> 0.

LOOP AT wa_dwld_file_format INTO wa_tline.

ASSIGN wa_tline TO <p> CASTING TYPE x.

CONCATENATE outputx <p> INTO outputx IN BYTE MODE.

ENDLOOP.

EXPORT outputx TO MEMORY ID id_itab.

ENDIF.