2009 Sep 26 3:59 AM
Dear Experts,
I have used below program to send mail.but i don't know how to cancel return receip and blank attachemnt email test.txt.
Could you please tell me how to do?
Looking forward to your reply
Many thanks.
Best regards,
Merry
Dear Experts,
I have used below program to send mail.but i don't know how to cancel return receip and blank attachemnt email test.txt.
Could you please tell me how to do?
Looking forward to your reply
Many thanks.
Best regards,
Merry
2009 Sep 26 5:10 AM
Try this way , Check the block of code between START and END
FORM send_document.
DATA: send_request TYPE REF TO cl_bcs.
DATA: recipient TYPE REF TO if_recipient_bcs.
DATA: bcs_exception TYPE REF TO cx_bcs.
DATA: sent_to_all TYPE os_boolean.
DATA: sender TYPE REF TO cl_sapuser_bcs.
TRY.
send_request = cl_bcs=>create_persistent( ).
* add document to send request
CALL METHOD send_request->set_document( go_document ).
recipient = cl_cam_address_bcs=>create_internet_address(
p_email ).
* add recipient with its respective attributes to send request
CALL METHOD send_request->add_recipient
EXPORTING
i_recipient = recipient
i_express = 'X'.
" <<<<---------<<<<<< Start
move : 'N' to v_request_status. " N = No status get returned
v_status = v_request_status.
call method send_request->set_status_attributes
exporting
i_requested_status = v_request_status
i_status_mail = v_status.
" <<<<---------<<<<<< End
* send document
CALL METHOD send_request->send(
EXPORTING
i_with_error_screen = 'X'
RECEIVING
result = sent_to_all ).
IF sent_to_all = 'X'.
WRITE 'Document Sent Successfully'(003).
ENDIF.
COMMIT WORK.
CATCH cx_bcs INTO bcs_exception.
WRITE: 'Error Occurred.'(001).
WRITE: 'Error Type:'(002), bcs_exception->error_type.
EXIT.
ENDTRY.
WAIT UP TO 2 SECONDS.
SUBMIT rsconn01 WITH mode = 'INT'
* WITH output = 'X'
AND RETURN.
ENDFORM. "send_document
a®
2009 Sep 26 7:49 AM
Dear a®s ,
Thanks for you good method,i have used your method i can cancel return receipt now.
But I have below question:
1、Why i can receive two attached files , i only select one attached file ,there is blank file,how can i delete this attachment .
Looking forward to your reply
Best Regards,
Merry
2009 Sep 26 8:07 AM
Check this
try.
go_document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = text[]
i_subject = subject ).
if not g_attachments[] is initial.
call method go_document->add_attachment
exporting
i_attachment_type = attach_ext1 "Fill the Att extension
i_attachment_subject = attach_name1 " Attah Name
i_att_content_text = g_attachments[].
endif.
a®
2009 Sep 28 2:58 AM