Skip to Content
0
Nov 15, 2018 at 02:05 PM

E-mails cannot be sent

111 Views

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

Attachments

test.png (7.1 kB)