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: 

trigger mail when we run f.27 tcode

Former Member
0 Kudos
734

hi abapers,

i have developed BTE  ZSAMPLE_PROCESS_00002310  for  triggering mail with attachement to customer now requirement has changed like if customer has 2 or more than mail id's when ever f.27 tcode execute mail will trigger to all mail id's( 2 or more).pl suggest me its bit urgent.

2 REPLIES 2

vijay_hariharan
Contributor
0 Kudos
523

Hi Balaji,

Which Function module are you using to send the email to the User. It should probably have an option to include multiple Recipients.

Also, just a polite reminder, please do not use words like Urgent as per Forum rules.

Check the below Thread, should help:

https://scn.sap.com/thread/1646148

Regards,

Vijay

0 Kudos
523

Hi Balaji,

Try this.....

** to group

loop maiid

    i_receivers-receiver = mailid

     i_receivers-rec_type = 'U'.

     APPEND i_receivers.

endloop



***cc* group


loop mailidcc

    i_receivers-receiver = mailidcc

     i_receivers-rec_type = 'U'.

     i_receivers-copy = 'X'.

     APPEND i_receivers.

endloop.

CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'

     EXPORTING

       document_data              = wa_mail_data

       put_in_outbox              = 'X'

       commit_work                = 'X'

     TABLES

       object_header              = objhead

       object_content             = objtxt

       receivers                  = i_receivers

     EXCEPTIONS

       too_many_receivers         = 1

       document_not_sent          = 2

       document_type_not_exist    = 3

       operation_no_authorization = 4

       parameter_error            = 5

       x_error                    = 6

       enqueue_error              = 7.


SUBMIT rsconn01 AND RETURN.