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