Application Development and Automation 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: 
Read only

Send mail to multiple users

shekhar_439
Explorer
0 Likes
2,247

Send E-mails to more than one customer e-mail address at the same time with attachment PDF.

1 ACCEPTED SOLUTION
Read only

ThorstenHoefer
Active Contributor
2,166

Hi,

please check https://codezentrale.de/tag/add_attachment/

you can call o_send_request->add_recipient multiple times.

6 REPLIES 6
Read only

ThorstenHoefer
Active Contributor
2,167

Hi,

please check https://codezentrale.de/tag/add_attachment/

you can call o_send_request->add_recipient multiple times.

Read only

0 Likes
2,166

thanks..................................

Read only

0 Likes
2,166

Any Other Way to do

Read only

2,166

shekhar_439 Why do you ask "Any Other Way to do"? Don't you think caling "add_recipient multiple times" is very simple?

Read only

Eduardo-CE
Active Participant
0 Likes
2,166

Hello,

DATA: l_document   TYPE REF TO cl_document_bcs,
        w_document   TYPE REF TO cl_bcs,
        gv_emailt    TYPE adr6-smtp_addr,
        gv_emailf    TYPE adr6-smtp_addr,
        gr_recipient TYPE REF TO if_recipient_bcs,
        sender       TYPE REF TO cl_cam_address_bcs.
		
		 CREATE OBJECT l_document.
      l_document = cl_document_bcs=>create_document(
          i_type       = 'HTM'
          i_subject    = v_subject
          i_length     = v_length
          i_language   = sy-langu
          i_importance = '1'
          i_text       = it_mailtxt ).
		
		 w_document = cl_bcs=>create_persistent( ).
      CALL METHOD w_document->set_document( l_document ).
	  
	  LOOP AT it_emails INTO wa_emails.
          v_user = wa_emails-sysid.

          CALL FUNCTION 'BAPI_USER_GET_DETAIL'
            EXPORTING
              username = v_user
            IMPORTING
              address  = wa_addr
            TABLES
              return   = it_return.

          gv_emailt = wa_addr-e_mail.

          gr_recipient = cl_cam_address_bcs=>create_internet_address( gv_emailt ).

          CALL METHOD w_document->add_recipient
            EXPORTING
              i_recipient = gr_recipient
              i_express   = 'X'.

          FREE: wa_emails, gv_emailt, v_user.
        ENDLOOP.
		
		CALL METHOD w_document->send(
        EXPORTING
          i_with_error_screen = 'X'
        RECEIVING
          result              = l_result ).
Read only

0 Likes
2,166

can one vendor send same time multi customer with attach pdf