cancel
Showing results for 
Search instead for 
Did you mean: 

RE Invoice to Multiple Email Id's

Former Member
0 Kudos

Hi All,

Is it possible to send RE Invoice to multiple e mails id's of the same customer.E mail id's are maintained in the customer master.

In standard we can send to only one Id .

Anyone having idea?

Thanks,

Ebin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

We found solution for it.

Following code in BadI BADI_RECP_SF-CHANGE_DOC_LIST to send mail with invoice to multiple mail id's of the same customer

FIELD-SYMBOLS : <WA_DOC_LIST> TYPE ANY,

                   <DYN_FIELD>   TYPE ANY,

                   <LT_DOC_LIST> TYPE TABLE.

   DATA : LV_ADDRNUMBER TYPE AD_ADDRNUM,

          LT_ADR6       TYPE TABLE OF ADR6,

          WA_ADR6       TYPE ADR6,

          LV_LINE       TYPE REF TO DATA.

   UNASSIGN <LT_DOC_LIST>.

   CASE IS_OPTIONS-TDDEST.

     WHEN 'MAIL'.

       LOOP AT CT_DOC_LIST ASSIGNING <WA_DOC_LIST>.

         IF <LT_DOC_LIST> IS NOT ASSIGNED.

           CREATE DATA LV_LINE LIKE TABLE OF <WA_DOC_LIST>.

           ASSIGN LV_LINE->* TO <LT_DOC_LIST>.

           <LT_DOC_LIST> = CT_DOC_LIST.

         ENDIF.

         CLEAR : LV_ADDRNUMBER.

         REFRESH : LT_ADR6[].

         ASSIGN COMPONENT 'PARTNER' OF STRUCTURE <WA_DOC_LIST> TO <DYN_FIELD>.

         IF SY-SUBRC = 0.

           SELECT SINGLE ADDRNUMBER

             FROM BUT020

             INTO LV_ADDRNUMBER

            WHERE PARTNER = <DYN_FIELD>.

           IF LV_ADDRNUMBER IS NOT INITIAL.

             SELECT *

               FROM ADR6

               INTO TABLE LT_ADR6

              WHERE ADDRNUMBER = LV_ADDRNUMBER

                AND FLGDEFAULT = ''

                AND HOME_FLAG = ''.

           ENDIF.

           LOOP AT LT_ADR6 INTO WA_ADR6.

             ASSIGN COMPONENT 'XMAILORFAXNO' OF STRUCTURE <WA_DOC_LIST> TO <DYN_FIELD>.

             IF SY-SUBRC = 0.

               <DYN_FIELD> = WA_ADR6-SMTP_ADDR.

               APPEND <WA_DOC_LIST> TO <LT_DOC_LIST>.

             ENDIF.

           ENDLOOP.

         ENDIF.

       ENDLOOP.

       IF <LT_DOC_LIST> IS ASSIGNED.

         CT_DOC_LIST = <LT_DOC_LIST>.

       ENDIF.

   ENDCASE.


Thanks,

Ebin

Answers (1)

Answers (1)

rajnikant_verma
Explorer
0 Kudos

Hi Ebin,

How r u?

In standard it is nor possible to send one invoice on multiple email id. You need to customize a program for it and i have done almost same thing at one of my client.

            Logic can be...apart from the standard filed you need to customized one more extra filed in customer master data and you can save all the email id's details in that filed only on which you want to send invoice.

               Program should be in such way that apart from standard filled it should picked all the email id  details from customized filled and send the invoice details on those id also.

Thanks

Rajnikant Verma

Former Member
0 Kudos

Hi Rajnikant,

Thanks for the reply.We can save multiple id's in customer master (under communication tab) itself without creating custom field.

I am looking for a an Enhancement point where we can write code to fetch additional e mail id's and send email.

Thanks,

Ebin

krishna_k19
Contributor
0 Kudos

Hi Joseph ,

    In NACE transaction please check whether they maintained custom program or standard one.

If it is standard one then check the query of the ADR6 table how they are fetching.

In customer table take the address id and check it in ADR6 table you will get the multiple mail id's and then , you might be using the 'so*send*mail' FM to send mails here you have to mention the Recipients table data (from adr6 mail id's).

thanks,

Krishna