1.

How Can I Make The Smartforms To Display A Print Preview By Default Without Displaying The Popup For Print Parameters?

Answer»

In the CALL FUNCTION of the Smartform Function Module (CALL FUNCTION fm_name ), SET the Output Options and Control PARAMETERS as mentioned below:

control_options-preview = 'X'. " PRINT Preview
control_options -no_open = 'X'. 
control_options -no_close = 'X'. 
control_options -no_dialog = 'X'. 
control_options -device = 'PRINTER'. 
output_options-TDDEST = 'PRINTER NAME'. "SPOOL: Output Device
output_options-TDNOPRINT = 'X'. "No printing from print preview
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = c_formname
IMPORTING
fm_name = lf_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
CALL FUNCTION LF_FM_NAME
EXPORTING
CONTROL_PARAMETERS = control_options
OUTPUT_OPTIONS = output_options
EXCEPTIONS 
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.

In the CALL FUNCTION of the Smartform Function Module (CALL FUNCTION fm_name ), set the Output Options and Control Parameters as mentioned below:

control_options-preview = 'X'. " Print Preview
control_options -no_open = 'X'. 
control_options -no_close = 'X'. 
control_options -no_dialog = 'X'. 
control_options -device = 'PRINTER'. 
output_options-TDDEST = 'PRINTER NAME'. "Spool: Output Device
output_options-TDNOPRINT = 'X'. "No printing from print preview
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = c_formname
IMPORTING
fm_name = lf_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
CALL FUNCTION LF_FM_NAME
EXPORTING
CONTROL_PARAMETERS = control_options
OUTPUT_OPTIONS = output_options
EXCEPTIONS 
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.



Discussion

No Comment Found