**============== Printing =========================
**& Spool: Output device.
select single spld
into lv_pdest
from usr01
where bname = sy-uname.
if lv_pdest is initial .
lv_pdest = 'LOCL'. "LOCL_TW
endif.
**& Control parameters.
gs_cp-no_open = 'X'.
gs_cp-no_close = 'X'.
gs_op-tddest = lv_pdest .
gs_op-tdimmed = 'X'.
gs_op-tddelete = 'X'.
gs_output-tddest = lv_pdest .
gs_output-tdimmed = 'X'.
gs_output-tddelete = 'X'.
gs_output-tdiexit = 'X'.
**-------------Open form.
call function 'SSF_OPEN'
exporting
user_settings = space
output_options = gs_output
control_parameters = gs_cp
importing
job_output_options = gs_op
exceptions
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
others = 5.
**-------------Get form. name.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'ZS_MM003'
importing
fm_name = gv_fnam
exceptions
no_form = 1
no_function_module = 2
others = 3.
**-------------Print data.
clear: lv_tabix.
loop at gt_out assigning .
**& Storage and Item text is not initial.
if -flag = 'X' and -itemtxt is not initial.
lv_lines = lv_lines + 2.
elseif -flag = 'X' or -itemtxt is not initial.
lv_lines = lv_lines + 1.
endif.
**& 換頁計數.
lv_lines = lv_lines + 1.
**& Append initial line.
if lv_lines >= lc_pagels.
lv_tabix = lv_tabix + 1.
insert initial line into gt_tab index lv_tabix.
clear:lv_lines, lv_tabix.
endif.
**& Move data.
move-corresponding to gt_tab.
append gt_tab.
clear: gt_tab.
lv_tabix = lv_tabix + 1.
**& Print data.
at end of ebeln.
****************Printing.
call function gv_fnam "'/1BCDWB/SF00000012'
exporting
control_parameters = gs_cp
zname = gv_name
importing
job_output_options = gs_option
tables
gt_tab = gt_tab
exceptions
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
others = 5.
clear: gt_tab, gt_tab[].
clear: lv_lines, lv_tabix.
endat.
endloop.
**----------------Close Form.
call function 'SSF_CLOSE'
exceptions
formatting_error = 1
internal_error = 2
send_error = 3
others = 4.
**-------------------------------------------------------
* call function 'ME_PRINT_PO'
* exporting
* ix_nast = l_nast
* ix_druvo = l_druvo
* doc = l_doc
* ix_screen = ent_screen
* ix_from_memory = l_from_memory
* ix_toa_dara = toa_dara
* ix_arc_params = arc_params
* ix_fonam = tnapr-fonam "HW 214570
* importing
* ex_retco = ent_retco.
**& End modify by TLY 20100305.
endform. "entry_neu
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/13547743/viewspace-630968/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/13547743/viewspace-630968/