Mail Example For Smartform Attachment
Mail Example For Smartform Attachment
FORM send_mail .
****send mail
IF send_m IS NOT INITIAL.
DATA send_request TYPE REF TO cl_bcs.
DATA document TYPE REF TO cl_document_bcs.
DATA: size TYPE so_obj_len,
it_contents TYPE STANDARD TABLE OF solisti1,
document = cl_document_bcs=>create_document(
i_type = 'HTM'
i_text = it_contents
i_subject = doc_data ).
send_request->set_document( document ).
receiver_to = '[email protected]'.
receiver_cc = '[email protected]'.
IF receiver_to IS NOT INITIAL .
recipient = cl_cam_address_bcs=>create_internet_address( receiver_to ).
send_request->add_recipient( i_recipient = recipient ).
ENDIF.
IF receiver_cc IS NOT INITIAL .
recipient1 = cl_cam_address_bcs=>create_internet_address( receiver_cc ).
send_request->add_recipient( i_recipient = recipient1
i_copy = ' ' ).
ENDIF.
COMMIT WORK.
MESSAGE 'Mail has been sent successfully' TYPE 'I'.
ENDIF.