cancel
Showing results for 
Search instead for 
Did you mean: 

Disable dialog box in smartforms

Former Member
0 Kudos

DATA: wa_ctrlop TYPE ssfctrlop,

wa_outopt TYPE ssfcompop.

This is the code i'm using to generate SF. i want to generate PDF using this SF. so i don't want to display the dialogbox for "print". This is urgent.

wa_ctrlop-getotf = 'X'.

wa_ctrlop-no_dialog = 'X'.

wa_ctrlop-preview = 'X'.

wa_outopt-tdnoprev = 'X'.

                                          • Invoking SF *********************

CALL FUNCTION form_name

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

control_parameters = wa_ctrlop

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

output_options = wa_outopt

user_settings = 'X'

mydate = p_date

reason = p_rea

IMPORTING

  • DOCUMENT_OUTPUT_INFO =

job_output_info = t_otfdata

  • JOB_OUTPUT_OPTIONS =

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5

.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

If you want to avoid the printer dialogue window do follow the below procedure:

DATA : device TYPE ssfctrlop,

ws_form_fname TYPE rs38l_fnam.

INITIALIZATION .

device-no_dialog = 'X'.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'Smartform Name'

IMPORTING

fm_name = ws_form_fname.

CALL FUNCTION ws_form_fname

EXPORTING

control_parameters = device

IMPORTING

job_output_info = ls_output_info

TABLES

i_final_ap = i_final_ap.

You will need to set the field DEVICE to PRINTER in structure CONTROL_PARAMETERS, as well as filling the print parameter in OUTPUT_OPTIONS.

Define a structure ls_output_info of type SSFCRESCL, and then pass it.

I believe even this is not required, just the structure device needs to be modified with the value 'X' ..along with the value for the device as printer (device-device = 'PRINTER').

Regards,

Narendra.

Former Member
0 Kudos

this is the modified code. but still the dialog box comes.

DATA: wa_ctrlop TYPE ssfctrlop,

wa_outopt TYPE ssfcompop,

t_otfdata TYPE ssfcrescl.

wa_ctrlop-getotf = 'X'.

wa_ctrlop-no_dialog = 'X'.

wa_ctrlop-preview = 'X'.

wa_ctrlop-preview = 'PRINTER'.

wa_outopt-tdnoprev = 'X'.

wa_outopt-print = 'X'.

CALL FUNCTION form_name

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

control_parameters = wa_ctrlop

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

output_options = wa_outopt

user_settings = 'X'

mydate = p_date

reason = p_rea

IMPORTING

  • DOCUMENT_OUTPUT_INFO =

job_output_info = t_otfdata

  • JOB_OUTPUT_OPTIONS =

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5

Former Member
0 Kudos

Hi,

Set wa_ctrlop-device = 'PRINTER'.

Regards,

Narendra.

Reward points if helpful!!

Former Member
0 Kudos

hi

i added this line also.

wa_ctrlop-device = 'PRINTER'.

in the dialog box, "print preview" option is inactive. but dialog box is there.

pls help me ... very urgent.