‎2018 Nov 15 2:05 PM
Hi Experts,
I have created a program to send some emails, everything is good working but SAP sending 4 email to tow receiver instead of 2 emails to tow receiver.
The second tow email which must not be created or sent are showed below with an extra comment ' cannot be sent'...
The first two emails are totally correct...
my code to send the data is like below if you need more coding please just tell me ...
LOOP AT lt_member INTO ls_member.
lv_address_name = ls_member-address.
lv_copy = ls_member-sndcp.
IF lv_address_name IS NOT INITIAL.
lo_recipient = cl_cam_address_bcs=>create_internet_address( lv_address_name ).
ENDIF.
IF lo_recipient IS NOT INITIAL.
lo_bcs->add_recipient( EXPORTING
i_recipient = lo_recipient
i_express = 'X'
i_copy = ls_member-sndcp
i_blind_copy = ls_member-sndbc ).
ENDIF.
ENDLOOP.
TRY .
DATA result TYPE os_boolean.
lo_bcs->send(
EXPORTING
i_with_error_screen = 'X'
RECEIVING
result = result ).
COMMIT WORK.
CATCH cx_send_req_bcs .
result = abap_false.
ENDTRY.
Your advice to solve this issue will be appreciated
Best Regards
Jenie

‎2018 Nov 15 2:53 PM
Can you check what is in your lt_member? Not 4 records by accident?
‎2018 Nov 15 3:04 PM
Hi , sure there just two, I think something must be initialized because I found out now that the second Emails are coming from the last process I mean the
previous execution of the program
Regards
‎2018 Nov 15 3:14 PM
jennifer1988 Check if you are not using same instance of lo_bcs in multiple runs.
‎2018 Nov 15 3:30 PM
Dear Jennifer
I think this is the status emails, did you set mail-system group in so16?
Best regards
JozsefH
‎2018 Nov 16 10:49 AM
Hi Jozsef,
thansk for your Input , my SO16 look like below:

Regards
Jenie
‎2018 Nov 19 3:25 PM
Dear Jennifer
for me this emails look like a status mails. could you please check it via sbwp if you send email to a non valied emailaddress
Best regards
JozsefH