Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Smartforms -Changed Default Printer still SPOOL has Default

Former Member
0 Likes
531

Hi,

I am trying to Change network printer while setting up a background job for smartform output.When I go to SP02 and try to print It still takes Default Printer.

Attached is the code in Driver program.Let me know if I am doing wrong.

Note: I tested it with other Programs it works fine.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = p_form

IMPORTING

fm_name = fm_name

EXCEPTIONS

no_form = 1

no_function_module = 2

OTHERS = 3.

IF sy-subrc <> 0.

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

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

ENDIF.

ls_composer_param-tdnewid = 'X'.

LOOP AT t_header INTO wa_header.

REFRESH item_itab.

LOOP AT t_item WHERE kunrg = wa_header-kunnr.

APPEND t_item TO item_itab.

ENDLOOP.

sort item_itab by fkdat.

CALL FUNCTION fm_name

EXPORTING

archive_index = toa_dara

archive_index_tab = arc_ind_tab

archive_parameters = arc_params

control_parameters = ls_control_param

mail_appl_obj = ls_recipient

mail_recipient = ls_recipient

mail_sender = ls_sender

output_options = ls_composer_param

user_settings = space

wa_itab = wa_header

IMPORTING

document_output_info = document_output_info

job_output_info = job_output_info

job_output_options = job_output_options

TABLES

wa_dep = item_itab

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4.

IF sy-subrc <> 0.

WRITE: / 'ERROR in passing vars to the smartforms '.

ENDIF.

ls_composer_param-tdnewid = space.

ls_control_param-no_dialog = 'X'.

ENDLOOP.

Regards

Prasad

3 REPLIES 3
Read only

Former Member
0 Likes
432

hi vara,

control parameters shub be assigned as..

<b>ctrl_param-preview = space.

out_option-tddest = 'LP01'. " relevant printer name

ctrl_param-no_dialog = 'X'.</b>

call function fm_name

exporting

<b>control_parameters = ctrl_param

output_options = out_option

user_settings = space</b>

tables

Read only

Former Member
0 Likes
432

Vara,

Try this.

ls_control_param-getotf = ' '.

ls_control_param-preview = SPACE.

ls_control_param-device = 'PRINTER'.

ls_composer_param-tdimmed = 'X'.

ls_composer_param-tddest = 'LOCL'.

<b> ls_composer_param-rqposname = imp_printer_name.</b>

ls_composer_param-no_dialog = 'X'.

Thanks,

Sandeep

Message was edited by: Sandeep Pulavarty

Read only

0 Likes
432

Hi,

I don't want to hard code my Printer name.

I just want to change it while executing this Job in backgorund.

As some times users may change their Printer names frequently.

Regards

Vara

Message was edited by: Vara K