cancel
Showing results for 
Search instead for 
Did you mean: 

default output device for smartform

Former Member
0 Kudos

Hi all

how can we assign a default output device to a smart form so that the every time we execute a smartform it doesnt ask for a output device?

thanks in advance....

Accepted Solutions (1)

Accepted Solutions (1)

former_member195383
Active Contributor
0 Kudos

Hi

First see what your default out put device is.

That you can see in SU3>Default>OutputDevice.

Suppose it is set as 'PRINTER' .

Then in ur print program you have to write the logic as below.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = 'Z_smartform

IMPORTING

FM_NAME = WF_FUNCMODULENAME

EXCEPTIONS

NO_FORM = 1

NO_FUNCTION_MODULE = 2

OTHERS = 3.

CLEAR: WA_CONTROL_PARAMETERS.

WA_CONTROL_PARAMETERS-GETOTF = 'X'.

WA_CONTROL_PARAMETERS-LANGU = 'E'.

WA_CONTROL_PARAMETERS-DEVICE = 'PRINTER'.

.

CALL FUNCTION WF_FUNCMODULENAME

EXPORTING

CONTROL_PARAMETERS = WA_CONTROL_PARAMETERS "Control Params

OUTPUT_OPTIONS = WA_OUTPUT_OPT "Output Options

WF_CARRID = WF_CARRID

WF_CONNID = WF_CONNID

WF_FLDATE = WF_FLDATE

IMPORTING

DOCUMENT_OUTPUT_INFO = WA_DOCUMENT_OUTPUT_INFO

JOB_OUTPUT_INFO = WA_JOB_OUTPUT_INFO

JOB_OUTPUT_OPTIONS = WA_JOB_OUTPUT_OPTIONS

EXCEPTIONS

FORMATTING_ERROR = 1

INTERNAL_ERROR = 2

SEND_ERROR = 3

USER_CANCELED = 4

OTHERS = 5.

Answers (4)

Answers (4)

Former Member
0 Kudos

hi

try this

data : p_form type tdsfname,

wk_form type rs38l_fnam,

control type ssfctrlop,

options type ssfcompop.

start-of-selection.

p_form = <formname>.

call function 'SSF_FUNCTION_MODULE_NAME'

importing

formname = p_form

exporting

fm = wk_form

control-preview = 'X'.

control-no_open = 'X'.

control-no_close = 'X'.

options-tddest = 'PrinterName'. ---> sets the default printer name

call function 'SSF_OPEN'

importing

control_parameters = control

output_options = options

loop

call function wk_form

endloop.

call function 'SSF_CLOSE'.

call function 'SSF_READ_ERRORS'.

Regards

Former Member
0 Kudos

Hi,

Go to System--->User Profile -


>Own Data ---> In Defaults Tab -> Spool Control-> give u r O/P Device

amit_khare
Active Contributor
0 Kudos

In the CALL UNCTION of smartform FM, set output options parameter to set the printer name.The O/p options isof the type SSFCOMPPOP which has the field TDDEST. Set TDDEST field to ur default printer

~As in forum

PS - Search forum before posting query.

Former Member
0 Kudos

Hi,

Populate CONTROL_PARAMETERS and pass to samrtfrom FM

DEVICE = SY-PDEST

NO_DIALOG = 'X'