Code: Alles auswählen.
data: it_customers type table of scustom,
wa_customer like line of it_customers,
wf_fm_name type funcname,
wa_docparams type sfpdocparams,
wa_outputparams type sfpoutputparams,
it_form_output type fpformoutput.
data: wa_z05knadr type z05knadr.
start-of-selection.
try.
call function 'FP_FUNCTION_MODULE_NAME'
exporting
i_name = 'Z05_BESTELLUNG'
importing
e_funcname = wf_fm_name.
endtry.
"set outputparams.
wa_outputparams-nodialog = 'X'.
wa_outputparams-preview = 'X'.
wa_outputparams-dest = 'LP01'.
* "open print job"
call function 'FP_JOB_OPEN'
changing
ie_outputparams = wa_outputparams
exceptions
* CANCEL = 1
* USAGE_ERROR = 2
* SYSTEM_ERROR = 3
* INTERNAL_ERROR = 4
others = 5.
if sy-subrc <> 0.
endif.
wa_docparams-langu = sy-langu.
wa_docparams-fillable = 'X'.
wa_docparams-dynamic = 'X'.
" get data
select single * from z05knadr into wa_z05knadr.
"create form
call function wf_fm_name
exporting
/1bcdwb/docparams = wa_docparams
wa_z05knadr = wa_z05knadr
importing
/1bcdwb/formoutput = it_form_output.
call function 'FP_JOB_CLOSE'.
Code: Alles auswählen.
* ----- PDF-Teil der Mail erzeugen und verpacken ----- *
* loop atg_pdf_data_tab into l_line.
* l_line_cont-line = l_line.
* append l_line_cont to l_pdf_tab.
* endloop.
* tab_lines = lines( l_pdf_tab ).
*
* t_packing_list-transf_bin = 'X'.
* t_packing_list-head_start = 1.
* t_packing_list-head_num = 1.
* t_packing_list-body_start = 1.
* t_packing_list-body_num = tab_lines.
* t_packing_list-doc_type = 'PDF'.
* t_packing_list-obj_name = 'ANLAGE'.
* t_packing_list-doc_size = tab_lines * 255.
* t_packing_list-obj_descr = attachment_name.
* append t_packing_list.