Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

E-mails cannot be sent

former_member586174
Participant
0 Kudos

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

6 REPLIES 6

former_member259807
Active Participant

Can you check what is in your lt_member? Not 4 records by accident?

0 Kudos

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

0 Kudos

jennifer1988 Check if you are not using same instance of lo_bcs in multiple runs.

-- Tomas --

jozsef_hegyi
Active Participant

Dear Jennifer

I think this is the status emails, did you set mail-system group in so16?

Best regards

JozsefH

0 Kudos

Hi Jozsef,

thansk for your Input , my SO16 look like below:

Regards

Jenie

jozsef_hegyi
Active Participant
0 Kudos

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