
DATA: lr_api TYPE REF TO if_mr_api,
lv_pdf_cont TYPE xstring,
lv_pdf_url TYPE string VALUE '/SAP/PUBLIC/TEST/flyer.pdf'.
* Get PDF xstring from MIME repository
lr_api = cl_mime_repository_api=>get_api( ).
lr_api->get( EXPORTING i_url = lv_pdf_url
IMPORTING e_content = lv_pdf_cont ).
Call Function module 'CV120_DOC_CHECKOUT' to fetch PDF contents at return table ptx_drao. Can refer to this.
DATA: pdf_content TYPE solix_tab,
document TYPE REF TO cl_document_bcs,
lp_pdf_size TYPE so_obj_len,
* Create document.
document = cl_document_bcs=>create_document(
i_type = 'HTM'
i_text = it_message[] "Body of e-mail
i_subject = lv_subject ).
...
lp_pdf_size = xstrlen( lv_pdf_cont ).
pdf_content = cl_document_bcs=>xstring_to_solix(
ip_xstring = lv_pdf_cont ).
lv_att_subject = 'Flyer File'.
document->add_attachment( i_attachment_type = 'PDF'
i_attachment_subject = lv_att_subject
i_attachment_size = lp_pdf_size
i_att_content_hex = pdf_content ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
3 | |
2 | |
2 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 |