2021 Nov 10 9:38 AM
I use the below code to loop through an itab and group by customer code. Then for each customer I send a Email.
LOOP AT gt_lott INTO DATA(wa) GROUP BY wa-customer_id .
LOOP AT GROUP wa ASSIGNING FIELD-SYMBOL(<members>).
create mail content...
ENDLOOP.
send_request = cl_bcs=>create_persistent( ).
mailsubject = 'CM Report'.
"document
document = cl_document_bcs=>create_document(
i_type = 'HTM'
i_text = it_contents
i_subject = mailsubject ).
send_request->set_document( document ).
sender = cl_cam_address_bcs=>create_internet_address( 'xxx.COM' ).
send_request->set_sender( sender ).
recipient_to = cl_cam_address_bcs=>create_internet_address( 'xxx.com' ).
send_request->add_recipient( i_recipient = recipient_to ).
CALL METHOD send_request->send(
EXPORTING
i_with_error_screen = 'X'
RECEIVING
result = lv_sent_to_all ).
COMMIT WORK.
ENDLOOP.
After I run the code, I can see multiple emails were created in Tcode SCOT. But they are in Status 672,
I can manually send them but I wonder what cause this issue? Is this my code problem or some setting error in SCOT? Thx.
I use the below code to loop through an itab and group by customer code. Then for each customer I send a Email.
LOOP AT gt_lott INTO DATA(wa) GROUP BY wa-customer_id .
LOOP AT GROUP wa ASSIGNING FIELD-SYMBOL(<members>).
create mail content...
ENDLOOP.
send_request = cl_bcs=>create_persistent( ).
mailsubject = 'CM Report'.
"document
document = cl_document_bcs=>create_document(
i_type = 'HTM'
i_text = it_contents
i_subject = mailsubject ).
send_request->set_document( document ).
sender = cl_cam_address_bcs=>create_internet_address( 'xxx.COM' ).
send_request->set_sender( sender ).
recipient_to = cl_cam_address_bcs=>create_internet_address( 'xxx.com' ).
send_request->add_recipient( i_recipient = recipient_to ).
CALL METHOD send_request->send(
EXPORTING
i_with_error_screen = 'X'
RECEIVING
result = lv_sent_to_all ).
COMMIT WORK.
ENDLOOP.
After I run the code, I can see multiple emails were created in Tcode SCOT. But they are in Status 672,
I can manually send them but I wonder what cause this issue? Is this my code problem or some setting error in SCOT? Thx.
2021 Nov 10 11:39 AM
Hello
If the message says 'Wait for Communication Service' - please use this to search the forum. There should be a lot of threads with responses to this. Should be something related to SCOT settings and RSCONN01 job scheduling. Please check
2021 Nov 10 2:58 PM
vijay.hariharan this is an answer, you should convert it to answer (button action)