05-09-2013 8:59 AM
Hi all,
I'm facing a problem when sending a email with CL_BCS class.
which is for each email i send through this class will automatically generate a delivery email. So i want to remove this delivery notification mail...
I went through the discussions but i couldn't found the solution...
please let me know the solution..
Thanx,
Pathum.
05-09-2013 9:13 AM
Method set_status_attributes with parameters
i_status_mail - determines action according to status of mail
i_requested_status - request confirmation
Both use:
N = Never
E = Only if errors
D = if transferred
R = if read
A = always
I use cl_send_request_bcs=>no_status which is 'N', for both.
05-09-2013 9:13 AM
Hi Pathum,
Please check the below document composed by me.
This document will be helpful in using CL_BCS.
Pass the same parameters as it was mentioned in the document.
http://wiki.sdn.sap.com/wiki/display/ABAP/Send+Emails+with+Attachments+of+any+Format
Hope this solves your problem.
05-09-2013 9:13 AM
Method set_status_attributes with parameters
i_status_mail - determines action according to status of mail
i_requested_status - request confirmation
Both use:
N = Never
E = Only if errors
D = if transferred
R = if read
A = always
I use cl_send_request_bcs=>no_status which is 'N', for both.
05-09-2013 9:55 AM
05-09-2013 9:46 AM
Copy your program snippet here please, with the part where you are using those methods. It can be helpful for us.
05-22-2013 10:27 AM
here is my coding and it works, but i have no attachment in this case:
data:
lt_objtxt type table of solisti1
,ls_objtxt type solisti1
.
data:
lo_send_request type ref to cl_bcs
,lo_document type ref to cl_document_bcs
,lo_bcs_exception type ref to cx_bcs
,lo_recipient type ref to if_recipient_bcs
,ls_rec type SOOS1
,sent_to_all type os_boolean
.
*** Mail-Text-Inhalt erstellen
ls_objtxt = 'Textzeile 1:'.
append ls_objtxt to lt_objtxt.
...
try.
*** Sendrequest erzeugen
lo_send_request = cl_bcs=>create_persistent( ).
*** Dokument (Mailtext) erzeugen
call method cl_document_bcs=>create_document
exporting
i_type = 'RAW'
i_subject = lbl_s141 " Title für die Mail
i_text = lt_objtxt
receiving
result = lo_document.
*** Die Mail an den Sendrequest hängen
call method lo_send_request->set_document( lo_document ).
ls_rec-recesc = 'U'.
ls_rec-recextnam = p_rec.
TRY.
CALL METHOD cl_send_request_bcs=>create_recipient_from_soos1
EXPORTING
i_soos1 = ls_rec
RECEIVING
result = lo_recipient.
CATCH cx_send_req_bcs .
ENDTRY.
try.
call method lo_send_request->set_status_attributes
exporting
i_requested_status = 'N'
i_status_mail = 'N'.
catch cx_send_req_bcs .
endtry.
*** ---------- send document ---------------------------------------
call method lo_send_request->send(
exporting
i_with_error_screen = 'X'
receiving
result = sent_to_all ).
if sent_to_all = 'X'.
write text-003.
endif.
commit work.
* -----------------------------------------------------------
* Ausnahmebehandlung
* -----------------------------------------------------------
catch cx_bcs into lo_bcs_exception.
write: text-001.
write: text-002, lo_bcs_exception->error_type.
exit.
endtry.
**************************************************
Thank you.