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: 

Send email when create invoice to multiple recipients

Former Member
0 Kudos

Hi all.

In my system, when an invoice is created with transaction VF01, a mail is sent to the client. But sometimes, a client has got some mails address in mater data, and I need the mail was send to all mails address for a client, and now the mail is only send to mail address marked by default in XD03. Can anybody help me? I have looked for an answer in this fórum but I don't understand this answer.

Thanks a lot.

Marta.

1 ACCEPTED SOLUTION

former_member182379
Contributor
0 Kudos

Hi,

As you are sending the email to one default user ID of custome rmaster, means you already have the code to select the email address from ADR6 table, from the where cluse remove the FLGDEFAULT an select all the email address maintain for that customer then while adding the receviers email ID, LOOP at ADR6 internal and append in the receiver table, as single email ID already working fine then there should not be any problem to send it to multiple IDs you just need to add the other email ID. You can post your code of receiver email ID, so it can be explain directly in the code.

Regards,

Zafar

11 REPLIES 11

Former Member
0 Kudos

Have a look at:

http://scn.sap.com/docs/DOC-41410

I'll be glad to discuss it with you here.

Neal

venkateswaran_k
Active Contributor
0 Kudos

Hi

You said it is now sending to default email address...

Currently how it is implemented... i.e.  where you have written the code to send email to customer.  In any User Exit or Enhancement? 

Regards,

Venkat

0 Kudos

Hello.

I have a Z program and a Z message type, copy of RVADIN01. I have read in other answers, the mail address are got in function 'CONVERT_COMM_TYPE_DATA', in parameter 'LVS_RECIPIENT', WHEN c_comm_smtp, but I don't know how insert here more of one mail address.

Could you help me?

Thanks a lot.

Marta.

0 Kudos

HI,

I did this issue like that.

1) I got the customer/vendor adrnr field value from lfa1/kna1 table.

2) get smtp_addr from adr6 into an internal table against adrnr of customer/vendor.

3) Pass mail addr to receipt address list. with in Loop .... Endloop.

ex:

LOOP AT it_adr6 INTO wa_adr6.

     i_reclist-receiver = wa_adr6-smtp_addr. 

     i_reclist-rec_type = 'U'.

     i_reclist-com_type = 'INT'.

     i_reclist-notif_del = 'X'.

     i_reclist-notif_ndel = 'X'.

     i_reclist-express = 'X'.

     APPEND i_reclist.

     CLEAR: i_reclist, wa_adr6-smtp_addr.

     ENDLOOP.

your mail forwarded to all the mail address mentioned in adr6 against particular customer.

Regards,

Ravi Pratap Singh

0 Kudos

Hi Ravi.

Thanks a lot. But I have an answer: do you have used this code in a standard program or in a Z program? I have function module 'CONVERT_COMM_TYPE_DATA' where customer mail is got, and I don't know how add your code in this function.

0 Kudos

You create one char variable and concatenate all the email addresses separated by ';'  (semicolon)

0 Kudos

Hi Marta,

If you are saying that your problem is solved, please mark some answer as a correct answer.  Write your own, if one doesn't exist and mark it.  That way folks will know where you stand on this one.

If you are however still searching, could you put a break point at the beginning of FM sbcoms_send_request_create and run your invoice to reprint  (option 5).  Let me know if it stops there!

Neal

0 Kudos

HI,

I had created complete new Z program of sending main and attached to the code in to the user exit at the time of 'save'. it works completely fine.

I am using SO_NEW_DOCUMENT_ATT_SEND_API1 function module in my program.

Regards,

Ravi Pratap Singh

Former Member
0 Kudos

I tried my best to do this before. Only solution, I could get to is by creating a group email for the customers in outlook by taking help of admins. Some cases customers themselves gave us group email addresses.

former_member182379
Contributor
0 Kudos

Hi,

As you are sending the email to one default user ID of custome rmaster, means you already have the code to select the email address from ADR6 table, from the where cluse remove the FLGDEFAULT an select all the email address maintain for that customer then while adding the receviers email ID, LOOP at ADR6 internal and append in the receiver table, as single email ID already working fine then there should not be any problem to send it to multiple IDs you just need to add the other email ID. You can post your code of receiver email ID, so it can be explain directly in the code.

Regards,

Zafar

Former Member
0 Kudos

Hi all.

Thanks a lot for your answers. I can't know if your proposal work fine yet because I can't change or debugging the program, but I will try and I will write in this post the right option.

Thanks.

Marta.