2007 Sep 27 5:07 AM
Hi,
I am sending mails with multiple attachments, My requirement is some of the users with one attachment and some other users multiple attachments (Please check it_receipent table below mentioned) Here attachments are added before the Loop at it_receipent table, in that case how will i delete a added attachment?
Any info how to do this.
try.
document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = it_content[]
i_subject = subject ).
if not attach_name1 is initial.
call method document->add_attachment
exporting
i_attachment_type = attach_ext1
i_attachment_subject = attach_name1
i_att_content_text = it_attach1[].
endif.
if not attach_name2 is initial.
call method document->add_attachment
exporting
i_attachment_type = attach_ext2
i_attachment_subject = attach_name2
i_att_content_text = it_attach2[].
endif.
call method send_request->set_document( document ).
sender = cl_sapuser_bcs=>create( sy-uname ).
call method send_request->set_sender
exporting
i_sender = sender.
loop at it_recipient.
translate it_recipient-smtp_addr to lower case.
recipient = cl_cam_address_bcs=>create_internet_address(
it_recipient-smtp_addr ).
call method send_request->add_recipient
exporting
i_recipient = recipient
i_express = ' '
i_copy = ' '
i_blind_copy = ' '
i_no_forward = ' '.
endloop.
move : 'E' to v_request_status.
v_status = v_request_status.
call method send_request->set_status_attributes
exporting
i_requested_status = v_request_status
i_status_mail = v_status.
send_request->set_send_immediately( 'X' ).
send_request->send( ).
commit work.
catch cx_document_bcs into bcs_exception.
endtry.
a®
Hi,
I am sending mails with multiple attachments, My requirement is some of the users with one attachment and some other users multiple attachments (Please check it_receipent table below mentioned) Here attachments are added before the Loop at it_receipent table, in that case how will i delete a added attachment?
Any info how to do this.
try.
document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = it_content[]
i_subject = subject ).
if not attach_name1 is initial.
call method document->add_attachment
exporting
i_attachment_type = attach_ext1
i_attachment_subject = attach_name1
i_att_content_text = it_attach1[].
endif.
if not attach_name2 is initial.
call method document->add_attachment
exporting
i_attachment_type = attach_ext2
i_attachment_subject = attach_name2
i_att_content_text = it_attach2[].
endif.
call method send_request->set_document( document ).
sender = cl_sapuser_bcs=>create( sy-uname ).
call method send_request->set_sender
exporting
i_sender = sender.
loop at it_recipient.
translate it_recipient-smtp_addr to lower case.
recipient = cl_cam_address_bcs=>create_internet_address(
it_recipient-smtp_addr ).
call method send_request->add_recipient
exporting
i_recipient = recipient
i_express = ' '
i_copy = ' '
i_blind_copy = ' '
i_no_forward = ' '.
endloop.
move : 'E' to v_request_status.
v_status = v_request_status.
call method send_request->set_status_attributes
exporting
i_requested_status = v_request_status
i_status_mail = v_status.
send_request->set_send_immediately( 'X' ).
send_request->send( ).
commit work.
catch cx_document_bcs into bcs_exception.
endtry.
a®
2007 Sep 27 2:48 PM
2007 Sep 27 3:18 PM
2008 Oct 01 7:24 PM
Hi a@s
What the method you have found ?
can you please post it for deletion ?
Thanks in advance
Krupali
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |