Invoice by e-mail to multiple mail ids

Hi,
I have a requirement to send the sales invoice by e-mail to multiple mail id's.
Mail ids will be maintained in the customer master record --> General Data -- > Contact Person TAB.
Please help me inconfiguring this scenario in detail.
Thanks
Parveen

Hi
In our system we are sending the same invoice by e-mail to two partners. In the customer master we have maintained one e-mail adress on the adress screen and we have maintained another e-mail adress in a contact person. The contact person is assigned to partner role Z0.
In the access sequence for the invoice print we have the same key combination twice, the first one without the exclusive flag. This means we can create master data for the same customer twice using partner role RE and Z0 and the invoice is then send to the two adresses.
/Torben

Similar Messages

  • How to send mail to multiple mail address using mail pkg?

    Hi All,
    How to send a mail to multiple mail addresses using Mail package. I tried by giving multiple mail addresses separated by semicolon(as well as comma) to the To field of the Mail Package structure, it gives Invalid Address error in Message Monitoring. But if i give a single mail address it works. How to address multiple email addresses.
    Regards,
    Sundar

    HI,
    With semicolon for mulitple email ids it worked for me (long back). Anyway cross check with this aprt of SAP help-
    http://help.sap.com/saphelp_nw04/helpdata/en/6b/4493404f673028e10000000a1550b0/content.htm
    Regards,
    Moorthy

  • How can I forward a mail to multiple mail accounts that I have in a group without having to add them one by one?

    How can I forward a mail to multiple mail accounts that I have in a group without having to add them one by one?

    I don't think that you can. Yahoo's basic email features do not include mail forwarding.

  • Mail Adapter - Multiple mail ID and multiple mail servers config.

    Hi All
    I am doing BPM synch scenario in which i get the response from SAP box and send the response via email adapter. I am using mail.xsd and doing mail config. in message mapping. However in the TO field i am able to give only one email ID. If i give multiple email ID's mail is not received. I tried comma and semi-colon as separator. Still not working? I have two questions in configuring TO option:
    1) How to send to multiple id's? I am using Lotus Notes.
    2)How to send to multiple mail servers? I have to send to Lotus Notes id's and outlook express id's also simultaneously.
    Thanks for your help in advance
    Warm Regards
    Samuel

    Hi,
    Please find here with some observations about it,
    1) How to send to multiple id's? I am using Lotus Notes.
    If you have specified an IMAP server under URL, the message is saved in the specified folder but is not sent to the receiver specified under To.
    Then even if Under To, you had specified the e-mail address that will receive the message would be separated with a semicolon. It will not work.
    Please verify about it .
    The below link will also help you to verify if there is anything missing
    Mail Adapter (XI) - how to implement dynamic mail address
    /people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
    BPM:Single Sender and Multiple Receivers based on synchronous
    exchange(switch) part-1
    /people/prasadbabu.nemalikanti3/blog/2006/03/10/bpmsingle-sender-and-multiple-receivers-based-on-synchronous-exchangeswitch-part-1
    Generic Message Interface in SAP Exchange Infrastructure Email Integration Scenarios
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00d5a235-4803-2a10-f682-889d67c69975
    (If your using Alert Framework then)
    If you want to send it to multiple email addresses and all email addresses are user of XI then you can define "Role" and attach that role to everyuser and make this role as receipent of alert .
    Thanks
    Swarup
    Thanks
    Swarup

  • Mail: Consolidate multiple mail folders

    I have been using macs for as long as I can remember. I used to use Eudora and eventually migrated to OS X Mail and imported my data. Needless to say I have a lot of emails now. The problem is sometime last year I had an issue with OS X Mail and made a couple backups of my mail folder data (poorly planned). Now I have two or three copies of mail folders which do not contain a full set of data.
    Does anyone have suggestions on how to consolidate the multiple OS X Mail data sets into a single set? I don't care about the folder structures I have. I just want to ensure I have a full set of received and sent mail with as few duplicates as possible.
    I tried importing all folders into a fresh 10.9 Mavericks install using Mail but for whatever reason (5 days later...) it almost doubled the size of the original folders. Normally, I wouldn't care as I had a 1 TB disk in my MBP. But I just got a new Haswell MBP with just a 256 GB drive. Space is at a premium.
    I searched the internet and even the discussions here without much luck. There was reference to an AppleScript that would highlight duplicates but that tool doesn't seem to be working any longer.
    Thank you,
    Jonathan

    Thanks for replying. Sorry, I didn't explain what I did clearly enough. I literally made copies in the Finder of my ~/Library/Mail folder... so I have three folders of roughly 20 GB (yes, 20 GB!!) each at different stages of completeness. I could MAYBE just use one but I'm not comfortable doing that quite yet if there is a different solution. When I imported, Mail took 5 days and the new ~/Library/Mail folder is 145 GB. I haven't a clue what it did to inflate it so much.
    I'm probably a crazy hoarder (ok, definitely) but when I have emails back to 1996 or something it's hard to not at least try for full population.
    I tried Mail Store Home (suggested by Steve Gibson @ GRC.com) and it was great. It pulled in a ton of emails (into proprietary database IIRC) and I exported to EML. But OS X Mail imports in a fashion that creates a zillion folders. Also not helpful.
    I'm also dealing with 201,000 emails, manual anything isn't ideal... I'm absolutely a hoarder.

  • JAVA mail API multiple mail address

    Need some help please... I have a file I include in my form info.jsp that has this line
    String apprteam [] = {"[email protected] [email protected]"};
    then in my form.jsp
    <input type="hidden" name="to" id="to" value="<%=apprteam%>">
    then on my mail page I get those parameters
    String to [] = request.getParameterValues("to");
    Properties props = System.getProperties();
    props.put("mail.host",host);
    Session mailSession = Session.getDefaultInstance(props,null);
    Message msg = new MimeMessage(mailSession);
    msg.setFrom(new InternetAddress(from));
    int toCount = to.length;
    InternetAddress[] toAddrs = new InternetAddress[toCount];
    for(int i = 0; i < toCount; ++i) {
    out.print(toAddrs);
    toAddrs[i] = new InternetAddress(to[i]);
    I tried adding the out.print to see if I could see the emails, but when the page compiles I receive the below .......
    javax.mail.internet.AddressException: Missing ']' in string ``[Ljava.lang.String;@144569b'' at position 27
    I've been over it several times, obviously I'm not referencing the array correctly, but I don't see whats wrong.... anyone have any ideas?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    value="<%=apprteam%>">It looks to me like that calls the toString() method of apprteam and uses the result as the value. And since apprteam is an array of strings, its toString() method returns something like "[Ljava.lang.String;@144569b". No doubt you were expecting it to return something more user-friendly, like the contents of the elements of the array concatenated together somehow.
    And why are you using an array that contains only one String? If you had used a String instead of an array of Strings, the problem wouldn't arise.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Sputility send mail send multiple mails while page freshing in sharepoint web part

    hi ,
    I am using sputility send mail method to send emails I have configure every thing . when page refreshing I am getting duplicate mail
    Srinivas

    You can solve that by storing the fact that you've already sent the mail in session state, or client side using sessionstorage (https://code.google.com/p/sessionstorage/)
    Kind regards,
    Margriet Bruggeman
    Lois & Clark IT Services
    web site: http://www.loisandclark.eu
    blog: http://www.sharepointdragons.com

  • Receiver Mail adapter with multiple mail ids

    Hi Experts,
    I am doing File to Mail scenario.
    I am generating mail package structure using Java mapping.
    Email is not going to multiple mail ids mentioned in To field.
    I tried with , and ; but for both it is behaving strange:
    When using ,(coma)
    in case of multiple receivers:
    only last mail id will receive mail in Inbox
    when using ;(semicolon)
    Every email id person will receive mail but with same name listed under To: that is last mail id.
    For example:
    To: abc.at.test.com,xyzat.est.com,def.at.est.com
    Then only def.at.test.com will receive mail
    In case of semicolon(;):
    Every mail id will receive mail in Inbox, that is abc.at.test.com,xyz.at.test.com,def.at.test.com
    will get mail in their respective mail box, but all mails will have same TO field: def.at.test.com
    I hope it is cleared.
    If you want I can send outlook mail headers from outlook.
    Best Regards,
    Divyesh

    Hi Divyesh
    Refer the below thread. The same problem was being solved.
    Mail Adapter - Multiple mail ID and multiple mail servers config.
    Here is the Summery:
    WRONG: receiver1@server1;receiver2@server2;
    CORRECT: receiver1@server1;receiver2@server2
    Regards,
    Madan Agrawal

  • Sending Mail to Multiple To addresses

    Hi!
    I want to know how to send mail to multiple mail addresses.
    Thanks!

    Hi sowmiya,
    This code would do the stuff u wanted
    import java.util.Properties;
    import javax.mail.*;
    import javax.mail.internet.*;
    public class MailExample {
    public static void main (String args[]) throws Exception {
    String host = "";
              String from = "[email protected]";
              //String to = "karthik@";
              String conf_email="[email protected]";
              String temp_pwd="tererere";
              String recipients = "[email protected],[email protected]";
              // Get system properties
              Properties props = System.getProperties();
              // Setup mail server
              props.put("mail.smtp.host", host);
              // Get session
              Session sessionobj = Session.getDefaultInstance(props, null);
              // Define message
              MimeMessage message = new MimeMessage(sessionobj);
              // Set the from address
              message.setFrom(new InternetAddress(from));
              // Set the to address for a single recipient
              // message.addRecipient(Message.RecipientType.TO,new InternetAddress("[email protected]"));
              message.setRecipients(Message.RecipientType.TO,InternetAddress.parse(recipients, false));
              // Set the subject
              message.setSubject("test");
              // Set the content
              message.setText("test");
              // Send message
         Transport.send(message);

  • Sending mail to multiple mailid from apex

    Hi,
    I need to send mail to multiple users from apex which is taken from a database table column. Is it possible to use LOV to send mail to multiple mail id? I tried with using collection but unable to reach it.
    APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY_B(
    p_collection_name => List_of_mailid,
    p_query => select column from table where cond='Y');
    any ideas.... thanks in advance.

    What you need to do is, build a string with the multiple e-mail addresses, and then when you want to send mail See this oldie but goodie thread:
    Have mutiple email addresses in Apex Email functionality
    Thank you,
    Tony Miller
    Dallas, TX

  • How to delete multiple mail ids in one customer using LSMW ?

    Suppose in one customer having multiple mail ids. I wants to delete those multiple mail ids from one customer how I can do this using LSMW.
    Experts please help me out this problem.

    Dear Venu,
    LSMW or BDC will only add / append data.
    Write a program:
    list of Address number of the customer from KNA1.
    delete all entries from ADR6 for those customer numbers.
    Regards,
    Mani

  • Sending mail to multiple dynamic mail ids

    Hi Everyone,
    I have one query regarding sending mail to multiple table entry mail IDs. This table data I am getting from custom BO method vie multiline container element.
    Now my problem is I am getting Multiple mail IDs to workflow container from BO but  dont know how to send mails to those IDs and binding required for Send Mail step.
    Thanks.

    Hello,
    Please search before posting questions.
    Please google 'sap workflow send mail to multiple recipients' and you will find many responses.
    Let us know if there are any problems.
    regards
    Rick Bakker

  • Invoice output triggered once but sending multiple mails from the output

    Hello Experts,
    Need your help with a tricky issue in our system.
    We have an output type defined to send invoice output as email. Lately we have an issue with this.
    If we trigger the output in foreground it works fine. But when we create the invoices from batchjob it is triggering multiple emails for the same invoice. When we check the output in invoice it was triggered only once. Even in NAST also we have only one entry for these invoices. This issue is happening randomly not for all the invoices created through batch.
    To nailed down the issue we have added code to update the application log in the output program. It wil update the application log in SLG1 transaction when ever the output program was called. Surprisingly even for the cases where the mail triggered multiple times we have only one entry in the log. It means even though the mail sent multiple times, it is calling the output porgam only once.
    We are not able to replicate this issue even after mulitple trails.
    Please suggest how we can find the root cause for this issue. All the ideas are welcome.
    Thanks,
    Srini

    Hi
    The problem could be in SO_DOCUMENT_SEND_API1 or in the program called to send the mail
    SO_DOCUMENT_SEND_API1 places the mail in SOST (how many messages you can see there?)
    If you see only one message the problem could be in the program to send the mail
    Max

  • Sending mail with multiple attachment

    hi.
    i want to send mail with multiple attachment.
    i m succeed in sending multiple attachment but the second pdf is not open.
    its given error like "This file is damaged and could not be open.
    pls check my code. and
    give the solution....
    point should be assured...........
    hope all u r understand my problem..
    & tell me where is i m missing something.
    REPORT  YSDPASALE1_MAIL LINE-SIZE 110.
    data : year_month(6) type c.
    data : from_date like sy-datum,to_date like sy-datum.
    INITIALIZATION.
    year_month = sy-datum+0(6).
    CONCATENATE year_month '01' into from_date.
    to_date = sy-datum.
    ranges : temp for mkpf-budat.
    temp-low = from_date.
    temp-high = to_date.
    append temp to temp.
    DATA: P_JOBCNT LIKE TBTCJOB-JOBCOUNT,
           jobname like TBTCJOB-JOBNAME,
           L_RELEASE(1) TYPE c.
    CONSTANTS : l_c_device(4)    VALUE 'LOCL'.
    DATA : t type i value 0.
    DATA : p_email1 like somlreci1-receiver,
            p_sender LIKE somlreci1-receiver.
    Data Declaration
    DATA: gd_recsize TYPE i,gd_recsize1 TYPE i.
    Spool IDs
    TYPES: BEGIN OF t_tbtcp.
            INCLUDE STRUCTURE tbtcp.
    TYPES: END OF t_tbtcp.
    DATA: it_tbtcp TYPE STANDARD TABLE OF t_tbtcp INITIAL SIZE 0,
          wa_tbtcp TYPE t_tbtcp.
    Job Runtime Parameters
    DATA: gd_eventid LIKE tbtcm-eventid,
          gd_eventparm LIKE tbtcm-eventparm,
          gd_external_program_active LIKE tbtcm-xpgactive,
          gd_jobcount LIKE tbtcm-jobcount,
          gd_jobname LIKE tbtcm-jobname,
          gd_stepcount LIKE tbtcm-stepcount,
          gd_error    TYPE sy-subrc,
          gd_reciever TYPE sy-subrc.
    DATA:  w_recsize TYPE i.
    DATA: gd_subject  LIKE sodocchgi1-obj_descr,
          it_mess_bod LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          it_mess_att1 LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          it_mess_att2 LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          gd_sender_type     LIKE soextreci1-adr_typ,
          gd_attachment_desc TYPE so_obj_nam,
          gd_attachment_desc1 TYPE so_obj_nam,
          gd_attachment_name TYPE so_obj_des,
          gd_mtitle LIKE sodocchgi1-obj_descr.
    Spool to PDF conversions
    DATA: gd_spool_nr LIKE tsp01-rqident,
          gd_destination LIKE rlgrap-filename,
          gd_bytecount LIKE tst01-dsize,
          gd_buffer TYPE string.
    CONSTANTS: c_dev LIKE  sy-sysid VALUE 'DEV',
               c_no(1)     TYPE c   VALUE ' ',
               c_device(4) TYPE c   VALUE 'LOCL'.
    Binary store for PDF
    DATA: BEGIN OF it_pdf_output OCCURS 0.
            INCLUDE STRUCTURE tline.
    DATA: END OF it_pdf_output.
    DATA: BEGIN OF mailstr OCCURS 0,
            p_email like somlreci1-receiver,
          END OF mailstr.
    DATA: mailtab like STANDARD TABLE OF mailstr WITH HEADER LINE.
    DATA: ypp18tab like STANDARD TABLE OF mailstr WITH HEADER LINE,
          ymis008tab like STANDARD TABLE OF mailstr WITH HEADER LINE,
          ysd15tab like STANDARD TABLE OF mailstr WITH HEADER LINE,
          ymis10tab like STANDARD TABLE OF mailstr WITH HEADER LINE.
    SUBMIT YSDPASALE1 with bdt in temp
                           to sap-spool
                          with line-size = '255'
                           with KEEP_IN_SPOOL = 'X'
                           with IMMEDIATELY = ' '
                           WITHOUT SPOOL DYNPRO
                           AND RETURN
       NEW-PAGE PRINT ON
       DESTINATION l_c_device
       IMMEDIATELY ' '
       KEEP IN SPOOL 'X'
       NEW LIST IDENTIFICATION 'X'
       NO DIALOG.
       new-page print off.
      IF sy-batch EQ 'X'.
        PERFORM get_job_details.
        PERFORM obtain_spool_id.
        PERFORM convert_spool_to_pdf.
        select yemail as p_email into CORRESPONDING FIELDS OF TABLE ymis008tab
          from ymail
          where ytcode = 'YMIS008'.
    ELSE.
       SKIP.
       WRITE:/ 'Program must be executed in background in-order for spool & mail sending',
               'request to be created.'.
      ENDIF.
    wait up to 3 seconds.
      submit YSD_MONTHLY_SALES
                                USING SELECTION-SET 'MAIL'
                                to sap-spool
                               with KEEP_IN_SPOOL = 'X'
                               with IMMEDIATELY = ' ' "SPACE
                               WITHOUT SPOOL DYNPRO
                               AND RETURN
       NEW-PAGE PRINT ON
       DESTINATION l_c_device
       IMMEDIATELY ' '
       KEEP IN SPOOL 'X'
       NEW LIST IDENTIFICATION 'X'
       NO DIALOG.
       new-page print off.
        IF sy-batch EQ 'X'.
        gd_attachment_desc1  = 'YMIS10'.
        gd_mtitle = 'Monthly Sales Report'.
        PERFORM get_job_details.
        PERFORM obtain_spool_id.
        PERFORM convert_spool_to_pdf1.
       loop at it_mess_att.
        move it_mess_att1 to it_mess_att.
        APPEND it_mess_att.
       endloop.
       APPEND LINES OF it_mess_att1 to it_mess_att.
       free it_mess_att1.
        it_mess_att[] = it_mess_att1[].
        insert LINES OF it_mess_att1 into it_mess_att.
        APPEND LINES OF it_mess_att2 to it_mess_att .
         insert LINES OF it_mess_att1 into it_mess_att.
         insert LINES OF it_mess_att2 into it_mess_att.
       loop at ymis008tab into mailstr.
         p_email1 = mailstr-p_email.
          p_email1 = '[email protected]'.
           PERFORM process_email.
       endloop.
           clear mailstr.
          wait up to 5 seconds.
          SUBMIT rsconn01 WITH mode   = 'INT'
                          WITH output = 'X'
                          AND RETURN.
      ELSE.
        SKIP.
      ENDIF.
          FORM obtain_spool_id                                          *
    FORM obtain_spool_id.
      CHECK NOT ( gd_jobname IS INITIAL ).
      CHECK NOT ( gd_jobcount IS INITIAL ).
      SELECT * FROM  tbtcp
                     INTO TABLE it_tbtcp
                     WHERE      jobname     = gd_jobname
                     AND        jobcount    = gd_jobcount
                     AND        stepcount   = gd_stepcount
                     AND        listident   <> '0000000000'
                     ORDER BY   jobname
                                jobcount
                                stepcount.
      READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
      IF sy-subrc = 0.
        message s004(zdd) with gd_spool_nr.
        gd_spool_nr = wa_tbtcp-listident.
        MESSAGE s004(zdd) WITH gd_spool_nr.
      ELSE.
        MESSAGE s005(zdd).
      ENDIF.
    ENDFORM.
          FORM get_job_details                                          *
    FORM get_job_details.
    Get current job details
      CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
           IMPORTING
                eventid                 = gd_eventid
                eventparm               = gd_eventparm
                external_program_active = gd_external_program_active
                jobcount                = gd_jobcount
                jobname                 = gd_jobname
                stepcount               = gd_stepcount
           EXCEPTIONS
                no_runtime_info         = 1
                OTHERS                  = 2.
    ENDFORM.
          FORM convert_spool_to_pdf                                     *
    FORM convert_spool_to_pdf.
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
           EXPORTING
                src_spoolid              = gd_spool_nr
                no_dialog                = c_no
                dst_device               = c_device
           IMPORTING
                pdf_bytecount            = gd_bytecount
           TABLES
                pdf                      = it_pdf_output
           EXCEPTIONS
                err_no_abap_spooljob     = 1
                err_no_spooljob          = 2
                err_no_permission        = 3
                err_conv_not_possible    = 4
                err_bad_destdevice       = 5
                user_cancelled           = 6
                err_spoolerror           = 7
                err_temseerror           = 8
                err_btcjob_open_failed   = 9
                err_btcjob_submit_failed = 10
                err_btcjob_close_failed  = 11
                OTHERS                   = 12.
      CHECK sy-subrc = 0.
    Transfer the 132-long strings to 255-long strings
      LOOP AT it_pdf_output.
        TRANSLATE it_pdf_output USING ' ~'.
        CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
      ENDLOOP.
      TRANSLATE gd_buffer USING '~ '.
      DO.
        it_mess_att = gd_buffer.
        APPEND it_mess_att.
        SHIFT gd_buffer LEFT BY 255 PLACES.
        IF gd_buffer IS INITIAL.
          EXIT.
        ENDIF.
      ENDDO.
    ENDFORM.
    FORM convert_spool_to_pdf1.
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
           EXPORTING
                src_spoolid              = gd_spool_nr
                no_dialog                = c_no
                dst_device               = c_device
           IMPORTING
                pdf_bytecount            = gd_bytecount
           TABLES
                pdf                      = it_pdf_output
           EXCEPTIONS
                err_no_abap_spooljob     = 1
                err_no_spooljob          = 2
                err_no_permission        = 3
                err_conv_not_possible    = 4
                err_bad_destdevice       = 5
                user_cancelled           = 6
                err_spoolerror           = 7
                err_temseerror           = 8
                err_btcjob_open_failed   = 9
                err_btcjob_submit_failed = 10
                err_btcjob_close_failed  = 11
                OTHERS                   = 12.
      CHECK sy-subrc = 0.
    Transfer the 132-long strings to 255-long strings
      LOOP AT it_pdf_output.
        TRANSLATE it_pdf_output USING ' ~'.
        CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
      ENDLOOP.
      TRANSLATE gd_buffer USING '~ '.
      DO.
        it_mess_att1 = gd_buffer.
        APPEND it_mess_att1.
        SHIFT gd_buffer LEFT BY 255 PLACES.
        IF gd_buffer IS INITIAL.
          EXIT.
        ENDIF.
      ENDDO.
    ENDFORM.
          FORM process_email                                            *
    FORM process_email.
      DESCRIBE TABLE it_mess_att LINES gd_recsize.
      DESCRIBE TABLE it_mess_att1 LINES gd_recsize1.
      CHECK gd_recsize > 0 or gd_recsize1 > 0.
      PERFORM send_email." USING p_email1.
    perform send_email using p_email2.
    ENDFORM.
          FORM send_email                                               *
    -->  p_email                                                       *
    FORM send_email." USING p_email.
    CHECK NOT ( p_email IS INITIAL ).
      REFRESH it_mess_bod.
    Default subject matter
      gd_subject         = 'Subject'.
      gd_attachment_desc = gd_attachment_desc1 .
    gd_attachment_desc = 'YPP18 - Daily Highlights'.
    CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
      it_mess_bod        = 'Dear Sir,'.
      APPEND it_mess_bod.
    it_mess_bod        = ' '.
    APPEND it_mess_bod.
      it_mess_bod        = ' '.
      APPEND it_mess_bod.
      it_mess_bod        = 'kindly find the attached document'.
      APPEND it_mess_bod.
    it_mess_bod        = ' '.
    APPEND it_mess_bod.
    it_mess_bod        = 'Do not reply on this mail, It is generated from SAP'.
    APPEND it_mess_bod.
    it_mess_bod        = ' '.
    APPEND it_mess_bod.
      it_mess_bod        = ' '.
      APPEND it_mess_bod.
      it_mess_bod        = 'Regards,'.
      APPEND it_mess_bod.
      it_mess_bod        = 'Arpit Shah'.
      APPEND it_mess_bod.
    If no sender specified - default blank
      IF p_sender EQ space.
        gd_sender_type  = space.
      ELSE.
        gd_sender_type  = 'INT'.
      ENDIF.
    Send file by email as .xls speadsheet
      PERFORM send_file_as_email_attachment
                                   tables it_mess_bod
                                          it_mess_att
                                          it_mess_att1
                                    using "p_email
                                          gd_mtitle
                                         'Testing mail generated from SAP'
                                         'Daily Highlights Abstract Report - YPP18'
                                          'PDF'
                                          gd_attachment_name
                                          gd_attachment_desc
                                          p_sender
                                          gd_sender_type
                                 changing gd_error
                                          gd_reciever.
    ENDFORM.
    *&      Form  SEND_FILE_AS_EMAIL_ATTACHMENT
          Send email
    FORM send_file_as_email_attachment tables it_message
                                              it_attach
                                              it_attach1
                                        using "p_email
                                              p_mtitle
                                              p_format
                                              p_filename
                                              p_attdescription
                                              p_sender_address
                                              p_sender_addres_type
                                     changing p_error
                                              p_reciever.
      DATA: ld_error    TYPE sy-subrc,
            ld_reciever TYPE sy-subrc,
            ld_mtitle LIKE sodocchgi1-obj_descr,
            ld_email LIKE  somlreci1-receiver,
            ld_format TYPE  so_obj_tp ,
            ld_attdescription TYPE  so_obj_nam ,
            ld_attfilename TYPE  so_obj_des ,
            ld_sender_address LIKE  soextreci1-receiver,
            ld_sender_address_type LIKE  soextreci1-adr_typ,
            ld_receiver LIKE  sy-subrc.
    data:   t_packing_list like sopcklsti1 occurs 0 with header line,
            t_contents like solisti1 occurs 0 with header line,
            t_receivers like somlreci1 occurs 0 with header line,
            t_attachment like solisti1 occurs 0 with header line,
            t_object_header like solisti1 occurs 0 with header line,
            w_cnt type i,
            w_sent_all(1) type c,
            w_doc_data like sodocchgi1,w_doc_data1 like sodocchgi1.
    ld_email   = p_email.
      ld_mtitle = p_mtitle.
      ld_format              = p_format.
      ld_attdescription      = p_attdescription.
      ld_attfilename         = p_filename.
      ld_sender_address      = p_sender_address.
      ld_sender_address_type = p_sender_addres_type.
    Fill the document data.
      w_doc_data-doc_size = 1.
    Populate the subject/generic message attributes
      w_doc_data-obj_langu = sy-langu.
      w_doc_data-obj_name  = 'SAPRPT'.
      w_doc_data-obj_descr = ld_mtitle .
      w_doc_data-sensitivty = 'F'.
    Fill the document data and get size of attachment
      CLEAR w_doc_data.
      READ TABLE it_attach INDEX w_cnt.
      w_doc_data-doc_size =
         ( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
      w_doc_data1-doc_size =
         ( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
      w_doc_data-obj_langu  = sy-langu.
      w_doc_data-obj_name   = 'SAPRPT'.
      w_doc_data-obj_descr  = ld_mtitle.
      w_doc_data-sensitivty = 'F'.
      CLEAR t_attachment.
      REFRESH t_attachment.
      t_attachment[] = it_attach[].
    For 2nd Attachments
    * Fill the document data and get size of attachment
      CLEAR w_doc_data.
      READ TABLE it_attach1 INDEX w_cnt.
      w_doc_data-doc_size = w_doc_data1-doc_size +
         ( w_cnt - 1 ) * 255 + STRLEN( it_attach1 ).
      w_doc_data-obj_langu  = sy-langu.
      w_doc_data-obj_name   = 'SAPRPT'.
      w_doc_data-obj_descr  = ld_mtitle.
      w_doc_data-sensitivty = 'F'.
      CLEAR t_attachment.
      REFRESH t_attachment.
    APPEND LINES OF it_attach1 to t_attachment.
      t_attachment[] = it_attach1[].
    APPEND LINES OF it_attach1 to t_attachment.
    Describe the body of the message
      CLEAR t_packing_list.
      REFRESH t_packing_list.
      t_packing_list-transf_bin = space.
      t_packing_list-head_start = 1.
      t_packing_list-head_num = 0.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE it_message LINES t_packing_list-body_num.
      t_packing_list-doc_type = 'RAW'.
      APPEND t_packing_list.
    Create attachment notification
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num   = 0.
      t_packing_list-body_start = 1.
    DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
    DESCRIBE TABLE it_mess_att LINES t_packing_list-body_num.
      DESCRIBE TABLE it_attach LINES t_packing_list-body_num.
      t_packing_list-doc_type   =  ld_format.
      t_packing_list-obj_descr  =  'YMIS008'."ld_attdescription.
      t_packing_list-obj_name   =  'YMIS008'."ld_attfilename.
      t_packing_list-doc_size   =  t_packing_list-body_num * 255.
      APPEND t_packing_list.
      clear t_packing_list.
    for 2 attachments
      data : a type i,b type i.
       a = t_packing_list-body_num.
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num   = 0.
      t_packing_list-body_start = a + 1. "1
    DESCRIBE TABLE it_mess_att1 LINES t_packing_list-body_num.
      DESCRIBE TABLE it_attach1 LINES t_packing_list-body_num.
      t_packing_list-doc_type   =  ld_format.
      t_packing_list-obj_descr  =  'YMIS10'."ld_attdescription.
      t_packing_list-obj_name   =  'YMIS10'."ld_attfilename.
      t_packing_list-doc_size   =  t_packing_list-body_num * 255.
      APPEND t_packing_list.
    a = t_packing_list-body_num.
    clear t_packing_list.
    * Create attachment notification
    t_packing_list-transf_bin = 'X'.
    t_packing_list-head_start = 1.
    t_packing_list-head_num   = 1.
    t_packing_list-body_start = a + 1.
    t_packing_list-body_num = t_packing_list-body_num + 1.
    DESCRIBE TABLE it_mess_att1 LINES t_packing_list-body_num.
    t_packing_list-body_num = a + t_packing_list-body_num .
    t_packing_list-doc_type   =  ld_format.
    t_packing_list-obj_descr  =  'YMIS10'."ld_attdescription.
    t_packing_list-obj_name   =  'YMIS10'."ld_attfilename.
    t_packing_list-doc_size   =  t_packing_list-body_num * 255.
    APPEND t_packing_list.
    Add the recipients email address
      CLEAR t_receivers.
      REFRESH t_receivers.
    loop at ymis008tab into mailstr.
      t_receivers-receiver = mailstr-p_email.  "ld_email.
      t_receivers-receiver = p_email1.
      t_receivers-rec_type = 'U'.
      t_receivers-com_type = 'INT'.
      t_receivers-notif_del = 'X'. "X   "Read Acknoledgement
      t_receivers-notif_ndel = 'X'.
      APPEND t_receivers.
    endloop.
       CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
           EXPORTING
                document_data              = w_doc_data
                put_in_outbox              = 'X'
                sender_address             = ld_sender_address
                sender_address_type        = ld_sender_address_type
                commit_work                = 'X'
           IMPORTING
                sent_to_all                = w_sent_all
           TABLES
                packing_list               = t_packing_list
                contents_bin               = t_attachment
                contents_txt               = it_message
                receivers                  = t_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
                OTHERS                     = 8.
    Populate zerror return code
      ld_error = sy-subrc.
    Populate zreceiver return code
      LOOP AT t_receivers.
        ld_receiver = t_receivers-retrn_code.
      ENDLOOP.
    ENDFORM.
    Rgds.
    Arpit

    Hi Arpit,
    Take a look at the documentation of FM 'SO_DOCUMENT_SEND_API1' for parameter PACKING_LIST. I think you should set t_packing_list-head_num to a different value than 0 for the second attachment.
    Regards,
    John.

  • Billing Documents with multiple mailing address

    Experts,
    What are all the standard options to generate SD billing documents with multiple mailing addresses. Billing document contents will be same but they will addressed to different mailing addresses.
    Have you come across this situation and implemented? Please let me know you expert advide.
    Thanks much,
    Nagarajan

    I assume that
    multiple mailing addresses
    are fixed.
    So, to print a hardcopies of invoice with multiple mailing addresses.
    You can have Z table in the system with all the mailing addresses, say,
    Bill-to Party
    Sr No
    Address
    100023
    01
    Chennai Address
    100023
    02
    Mumbai Address
    100023
    03
    Noida Address
    Then write a logic in your print program to call the Z Table with address while printing the output.
    You can take assistance of ABAPer in your team for this.
    Regards
    JP

Maybe you are looking for

  • Database Adapter: NVARCHAR2 datatype in stored procedure

    Hi, when I try to define partner link as database adapter - call stored procedure with datatype NVARCHAR2, I'm getting following error: Error while writing wsdl file ..... Exception: WSDLException: faultCode=OTHER_ERROR: Database type is either not s

  • No import from audio cd

    itunes - latest version 7.1.1 - freezes on import of audio files from cd, does not matter whether original new cd's or self burned. have to exit with force quit, when I then try to copy an audio file from the cd via drag-and-drop to the computer, I r

  • PO approval notification not received by user

    Hi, There are 2 POs pending for approval from user. The PO status shows 'In Process'. The user is not receiving any notifications for approving the POs. Can someone let me know the root cause and the resolution. Regards, Radhika.

  • Exception while commiting Tx Currently there are 3 such requests

    Hi, I have a service ( ejb session ) exported to etx. Randomically the client tha invoke this receive the follow exception i work on weblgoic server 8.1 sp6 can anyone help me? thnks for help Error invoking VMOperation in OperationNode 'call_server'.

  • I-tunes loading never stops

    I recently updated my i-tunes music player to the latest version but when i wanted to open it nothing showed up??? I checked in my taskmanager if it was loading and yes there it was, but after having the computer on for more then 5hours it never stop