将SMSARTFORMS 以PDF的方式用邮件…
有时候不需要打印smartforms,而是以pdf格式发邮件发过去,下面是部分代码
"控制变量
DATA
DATA:
DATA
DATA
*--------------------------------------------------------------------*
"转OTF
DATA:
DATA: g_len_in TYPE i, "OTF 文件大小(邮件附件大小)
g_lines_txt TYPE i, "邮件文本行数
g_lines_bin TYPE i. "邮件附件行数
DATA: g_benfile TYPE xstring. "二进制格式的邮件
DATA: g_object(50) TYPE c. "邮件主题
DATA pdf_name TYPE string. "附件名称
DATA: gt_objpack LIKE TABLE OF sopcklsti1 WITH HEADER LINE, "邮件内容 正文+附件
gt_objtxt LIKE TABLE OF solisti1 WITH HEADER LINE, "正文内容
gt_objbin LIKE TABLE OF solisti1 WITH HEADER LINE, "附件内容
gt_reclist LIKE TABLE OF somlreci1 WITH HEADER LINE, "收件人
wa_doc_chng TYPE sodocchgi1. "邮件属性
DATA:
DATA:
DATA
DATA:
*--------------------------------------------------------------------*
"选择屏幕
PARAMETERS:
p_email TYPE so_recname OBLIGATORY DEFAULT 'LIUMENG@…….com'.
"选择屏幕
PARAMETERS:
*--------------------------------------------------------------------*
START-OF-SELECTION.
CLEAR: job_output_options,
job_output_info,
g_len_in,
g_lines_txt,
g_lines_bin,
g_benfile.
CLEAR : gt_otf[], gt_pdf_line[],gt_record[].
START-OF-SELECTION.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZLM_SMTFM'
IMPORTING
fm_name = fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
CHECK: sy-subrc = 0.
CALL FUNCTION fm_name
EXPORTING
control_parameters = control_parameters
output_options = l_output_options "默认打印选项设置传输
* user_settings = 'X' "是否从用户主记录中获取信息
i_acct_head = l_acct_head
IMPORTING
job_output_info = job_output_info
job_output_options = job_output_options
TABLES
it_acct_item = lt_acct_item
EXCEPTIONS
formatting_error = 1
*