*Set the print Parameters
PERFORM set_print_param USING ls_addr_key
CHANGING ls_control_param
ls_composer_param
ls_recipient
ls_sender
ent_retco.
FORM set_print_param USING is_addr_key LIKE addr_key
CHANGING cs_control_param TYPE ssfctrlop
cs_composer_param TYPE ssfcompop
cs_recipient TYPE swotobjid
cs_sender TYPE swotobjid
cf_retcode TYPE sy-subrc.
DATA: ls_itcpo TYPE itcpo.
DATA: lf_repid TYPE sy-repid.
DATA: lf_device TYPE tddevice.
DATA: ls_recipient TYPE swotobjid.
DATA: ls_sender TYPE swotobjid.
lf_repid = sy-repid.
CALL FUNCTION 'WFMC_PREPARE_SMART_FORM'
EXPORTING
pi_nast = nast
pi_addr_key = is_addr_key
pi_repid = lf_repid
IMPORTING
pe_returncode = cf_retcode
pe_itcpo = ls_itcpo
pe_device = lf_device
pe_recipient = cs_recipient
pe_sender = cs_sender.
IF cf_retcode = 0.
MOVE-CORRESPONDING ls_itcpo TO cs_composer_param.
* cs_composer_param-tdnoprint = 'X'. "Note 591576
cs_control_param-device = lf_device.
cs_control_param-no_dialog = 'X'.
cs_control_param-preview = xscreen.
cs_control_param-getotf = ls_itcpo-tdgetotf.
cs_control_param-langu = nast-spras.
ENDIF.
ENDFORM.
* if it is faxed, changed its title to PO number
IF ls_control_param-device = 'TELEFAX'.
ls_composer_param-tdtitle = l_doc-xekko-ebeln.
ENDIF.
* if it is mail, changed its title to PO number
IF ls_control_param-device = 'MAIL'.
ls_composer_param-tdtitle = l_doc-xekko-ebeln.
ENDIF.
*>>>>> Change of Parameters <<<<<<<<<<<<<<<<<<<<<<<
CALL FUNCTION lf_fm_name
EXPORTING
archive_index = toa_dara
archive_parameters = arc_params
control_parameters = ls_control_param
mail_recipient = ls_recipient "receiver mail id
mail_sender = ls_sender
output_options = ls_composer_param
is_ekko = l_doc-xekko
user_settings = ' ' "Disable User Printer
is_pekko = l_doc-xpekko
is_nast = l_nast
iv_from_mem = l_from_memory
iv_druvo = iv_druvo
iv_xfz = iv_xfz
TABLES
it_ekpo = l_doc-xekpo[]
it_ekpa = l_doc-xekpa[]
it_pekpo = l_doc-xpekpo[]
it_eket = l_doc-xeket[]
it_tkomv = l_doc-xtkomv[]
it_ekkn = l_doc-xekkn[]
it_ekek = l_doc-xekek[]
it_komk = l_xkomk[]
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
PERFORM set_print_param USING ls_addr_key
CHANGING ls_control_param
ls_composer_param
ls_recipient
ls_sender
ent_retco.
FORM set_print_param USING is_addr_key LIKE addr_key
CHANGING cs_control_param TYPE ssfctrlop
cs_composer_param TYPE ssfcompop
cs_recipient TYPE swotobjid
cs_sender TYPE swotobjid
cf_retcode TYPE sy-subrc.
DATA: ls_itcpo TYPE itcpo.
DATA: lf_repid TYPE sy-repid.
DATA: lf_device TYPE tddevice.
DATA: ls_recipient TYPE swotobjid.
DATA: ls_sender TYPE swotobjid.
lf_repid = sy-repid.
CALL FUNCTION 'WFMC_PREPARE_SMART_FORM'
EXPORTING
pi_nast = nast
pi_addr_key = is_addr_key
pi_repid = lf_repid
IMPORTING
pe_returncode = cf_retcode
pe_itcpo = ls_itcpo
pe_device = lf_device
pe_recipient = cs_recipient
pe_sender = cs_sender.
IF cf_retcode = 0.
MOVE-CORRESPONDING ls_itcpo TO cs_composer_param.
* cs_composer_param-tdnoprint = 'X'. "Note 591576
cs_control_param-device = lf_device.
cs_control_param-no_dialog = 'X'.
cs_control_param-preview = xscreen.
cs_control_param-getotf = ls_itcpo-tdgetotf.
cs_control_param-langu = nast-spras.
ENDIF.
ENDFORM.
* if it is faxed, changed its title to PO number
IF ls_control_param-device = 'TELEFAX'.
ls_composer_param-tdtitle = l_doc-xekko-ebeln.
ENDIF.
* if it is mail, changed its title to PO number
IF ls_control_param-device = 'MAIL'.
ls_composer_param-tdtitle = l_doc-xekko-ebeln.
ENDIF.
*>>>>> Change of Parameters <<<<<<<<<<<<<<<<<<<<<<<
CALL FUNCTION lf_fm_name
EXPORTING
archive_index = toa_dara
archive_parameters = arc_params
control_parameters = ls_control_param
mail_recipient = ls_recipient "receiver mail id
mail_sender = ls_sender
output_options = ls_composer_param
is_ekko = l_doc-xekko
user_settings = ' ' "Disable User Printer
is_pekko = l_doc-xpekko
is_nast = l_nast
iv_from_mem = l_from_memory
iv_druvo = iv_druvo
iv_xfz = iv_xfz
TABLES
it_ekpo = l_doc-xekpo[]
it_ekpa = l_doc-xekpa[]
it_pekpo = l_doc-xpekpo[]
it_eket = l_doc-xeket[]
it_tkomv = l_doc-xtkomv[]
it_ekkn = l_doc-xekkn[]
it_ekek = l_doc-xekek[]
it_komk = l_xkomk[]
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
No comments:
Post a Comment