经多次研究和测试,终于可以正常发送所有附件,且可实际中文字符的正常显示。
关键代码,请参看红色字体部分:
*&---------------------------------------------------------------------*
*& Form SEND_EMAIL_WITH_ATTACHMENT
*&---------------------------------------------------------------------*
FORM SEND_EMAIL_WITH_ATTACHMENT .
data: binary_content type solix_tab.
data: xl_content type xstring .
constants:
con_tab type c value cl_abap_char_utilities=>horizontal_tab,
con_cret type c value cl_abap_char_utilities=>cr_lf.
data: xlcontent type xstring,
conlength type i,
conlengths type so_obj_len,
result_content type string,
wa_string type string, "This holds all of your data
wa_str_temp type string,
dummy type string.
data: send_request type ref to cl_bcs.
data: text type bcsy_text.
data: document type ref to cl_document_bcs.
data: sender type ref to if_sender_bcs.
data: recipient type ref