Professional Documents
Culture Documents
Solved - Re - Send Mail With XML Document Attached - PROGRAMA
Solved - Re - Send Mail With XML Document Attached - PROGRAMA
tables parameter
FM Source.
FUNCTION y_email_xml_atta.
https://community.sap.com/t5/application-development-discussions/send-mail-with-xml-document-attached/m-p/6231876#M1380732 1/4
27/4/24, 19:59 Solved: Re: Send Mail with XML document attached - SAP Community
CLEAR: xl_content .
IMPORTING
buffer = xl_content
EXCEPTIONS
failed = 1
OTHERS = 2
.
IF sy-subrc <> 0.
ENDIF.
REFRESH binary_content .
REFRESH text .
CLEAR result_content .
CONCATENATE
'Please find attached your XML doc.'
'Regards'
' Team<' INTO result_content .
https://community.sap.com/t5/application-development-discussions/send-mail-with-xml-document-attached/m-p/6231876#M1380732 2/4
27/4/24, 19:59 Solved: Re: Send Mail with XML document attached - SAP Community
EXPORTING
text = result_content
TABLES
ftext_tab = text.
TRY.
CLEAR send_request .
send_request = cl_bcs=>create_persistent( ).
CLEAR document .
document = cl_document_bcs=>create_document(
i_type = 'HTM'
i_text = text
i_length = conlengths
i_subject = subject ).
CLEAR sender .
sender = cl_cam_address_bcs=>create_internet_address( sender_id ).
CALL METHOD send_request->set_sender
EXPORTING
i_sender = sender.
CLEAR wa_rec .
recipient = cl_cam_address_bcs=>create_internet_address(
wa_rec ).
https://community.sap.com/t5/application-development-discussions/send-mail-with-xml-document-attached/m-p/6231876#M1380732 3/4
27/4/24, 19:59 Solved: Re: Send Mail with XML document attached - SAP Community
EXPORTING
i_requested_status = 'E'
i_status_mail = 'E'.
COMMIT WORK.
ENDTRY.
ELSE .
ENDFUNCTION.
https://community.sap.com/t5/application-development-discussions/send-mail-with-xml-document-attached/m-p/6231876#M1380732 4/4