Issue with multiple attachments in email program

Hi All,
i need one program which sends 3 excel sheets as an atatchments. in these attachments data should be separated by tab. i am not able to find suitable program for the requirement anybody can send me the code .
thanks,
maheedhar

hi,
Refer to this link...
send mail with multiple excel attachments
Cancatenate  fields of internal table CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB  to get the tab position between the fields.

Similar Messages

  • Sending email with multiple attachments

    Hi forum,
    I am able to send email with a single attachment using maildemo.sql from: http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/Utl_Smtp_Sample.html
    But now I am trying to send email with more than 1 attachment and it does not work. My code that calls the above mentioned package is as follows:
    <code>
    PROCEDURE send (
    psender VARCHAR2,
    precipients VARCHAR2,
    pcc VARCHAR2,
    pbcc VARCHAR2,
    psubject VARCHAR2,
    pmessage VARCHAR2,
    pnumattach NUMBER) -- The number of attachments that need to be sent
    IS
    p_blob BLOB;
    p_filename VARCHAR2(200);
    p_filetype VARCHAR2(200);
    p_currSeq NUMBER;
    conn utl_smtp.CONNECTION;
    i NUMBER;
    j NUMBER;
    len NUMBER;
    BEGIN
    IF pnumattach > 1
    THEN
    conn := SEND_EMAIL_HELPER.begin_mail(
              sender => psender,
              recipients => precipients,
              subject => psubject,
              mime_type => send_email_helper.MULTIPART_MIME_TYPE);
    j := 0;
    SELECT seq_attach_transact_id.CURRVAL INTO p_currSeq FROM dual; -- seq_attach_transact_id is a primary key that identifies every single attachment in the table
    WHILE (j < pnumattach) LOOP
    p_currSeq := p_currSeq - j;
    SELECT blob_content INTO p_blob FROM wwdoc_document WHERE transaction_id = p_currSeq;
    SELECT name INTO p_filename FROM wwdoc_document WHERE transaction_id = p_currSeq;
    SELECT mime_type INTO p_filetype FROM wwdoc_document WHERE transaction_id = p_currSeq;
    SEND_EMAIL_HELPER.begin_attachment(
    conn => conn,
    mime_type => p_filetype,
    inline => TRUE,
    filename => p_filename,
    transfer_enc => 'base64');
    -- split the Base64 encoded attachment into multiple lines
    i := 1;
    len := DBMS_LOB.getLength(p_blob);
    WHILE (i < len) LOOP
    IF(i + SEND_EMAIL_HELPER.MAX_BASE64_LINE_WIDTH < len)THEN
    UTL_SMTP.Write_Raw_Data (conn,
    UTL_ENCODE.Base64_Encode(
    DBMS_LOB.SUBSTR(p_blob, SEND_EMAIL_HELPER.MAX_BASE64_LINE_WIDTH, i)));
    ELSE
    UTL_SMTP.Write_Raw_Data (conn,
    UTL_ENCODE.Base64_Encode(
    DBMS_LOB.SUBSTR(p_blob, (len - i)+1, i)));
    END IF;
    UTL_SMTP.Write_Data(conn, UTL_TCP.CRLF);
    i := i + SEND_EMAIL_HELPER.MAX_BASE64_LINE_WIDTH;
    END LOOP;
    SEND_EMAIL_HELPER.end_attachment(conn => conn);
    END LOOP;
    SEND_EMAIL_HELPER.attach_text(
    conn => conn,
    data => pmessage,
    mime_type => 'text/html');
    SEND_EMAIL_HELPER.end_mail( conn => conn );
    ELSE
    utl_mail.send(psender,precipients,pcc,pbcc,psubject,pmessage);
    END IF;
    END send;
    </code>
    Can anyone please tell me where am i going wrong.
    Message was edited by:
    Monk

    The easiest is to send an e-mail with multiple attachments to yourself and then view the message in raw to see how it is formatted - how the boundaries work. what the boundary headers are, etc.
    Then you use that as a template for your PL/SQL code to generate a MIME body for an e-mail that has multiple attachments.
    To debug.. have your PL/SQL code send sample e-mails with multiple attachment to your account, view it in raw format and compare that to the original format you've based your template on.
    And none of this is really a PL/SQL issue.. it is all about formatting a valid MIME message for an e-mail.

  • Since I've installed Mountain Lion, I am having lock up issues with multiple programs. MS Outlook has crashed and I've lost all my folders. HELP?

    Since I've installed Mountain Lion, I am having lock up issues with multiple programs. MS Outlook has crashed and I've lost all my folders. HELP?

    okay I've finally been able to get tor and all the other programs to work according to my plan the only thing that's still making problems is that iptables doesn't work as I want it to, when I start chromium without proxy settings privoxy doesn't seem to forward the information to polipo.. do I need to add another rule to iptables.rules in order for the program to know it has to reroute the information again or how can I get this to work? and is there any way to run rtorrent with proxy support?
    anyway, problem 2 and 3 are still to be solved.
    and does anybody know where i can get a good dansguardian blacklist that was not designed for 6 year old children and for which I don't need to subscribe? I'm still getting these partypoker popups -.-
    //e: with iptables it's the same thing as described in the first post. https works, http doesnt. I get the output "Invalid header received from client." on http sites. still no idea why though.. (and the https-version of torcheck.xenubite says i'm tor unprotected while starting the browser with iptables)
    Last edited by deF291 (2011-04-23 16:16:31)

  • Send email with multiple attachments using MS outlook

    Hi,
    Is it possible to send an email with multiple attachments using MS outlook. (Using activex)
    Regards,
    Neha

    nehrnul wrote:
    Hey thanks for the reply. I'll try that way also.
    but currently my requirement is to send email using MS Outlook. And I found 1 solution using invoke node
    Regards,
    Neha
    That' "requirement" sounds like it was written by someone who is trying to drive the design of the application.  Without knowing your personal situation it's hard for me to say, but if I had to guess I would say the real requirement is to send an email with multiple attachements, and the person giving that requirement thought sending it through Outlook would be the best way.  You should get clairification on what the real intend of that requirement is.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • Problem with Multiple attachments

    I am starting to have real issues receiving multiple attachments from a client.
    In the Inbox, it will say in the brief description how many there are ... but then when I go to the email, it only shows as having one attachment, but that 1 attachment is repeated a number of times (the number of attachments there should be).
    Here's an screenshot showing the issue:
    I have re-built the inboix a few times, and this doesn't solve the issue, has anyone else come accross this?
    All of the attachments are there in Webmail, but not in Mail.  If the client sends them through as a compressed Zip file then it's ok.
    Any suggestions will be gratefully recieved.
    Thanks
    Simon

    Hi Sig,
    They know how to send attachments, they have been doing it perfectly for the past few years.  This seems tohave started over the past 3 weeks or so.

  • We run an iMac 3.4 GHz I7 for our church worship service; we haven't upgraded to Mavericks because we heard about issues with multiple screens crashing.  Has this issue been resolved?  Thank you!

    We run an iMac 3.4 GHz I7 in our church worship service; we have front screens and a stage display monitor ; we haven't upgraded to Mavericks because we heard about issues with multiple screens crashing.  Has this issue been resolved?  Now that we are 2 upgrades behind, I'm getting little concerned.  Thank you!

    Oh, well that was a whole other kettle of fish:
    Oh the G4 I attempted to install iLife '08 before Lepoard was available. About the only thing that installed cleanly was iPhoto. I ended up reinstalling everything back to iLife '06, and then upgrading back to the current stable version of the iLife '06 version. I didn't attempt a reinstall until after I upgraded to Leopard.
    When I did reinstall, I made a iLife '06 folder, copied all iLife apps into it, and upgraded. Seemed to work, except for the part where iMovie gets left behind and iDVD is only mostly functional.
    When I installed on the other 2 machines, it was after installing Leopard and all upgrades. On those 2 machines, I didn't bother with the copy, I just moved everything to the iLife '06 folder I created, and did a fresh install.
    I didn't have to do anything with the iPhoto Libraries, that I can recall.
    I always do an upgrade, never an archive and install. I've never had a problem with this back to 10.1 or 10.2.

  • Sending mail with multiple attachments

    hi.I wrote a code to send mail.but i need to send mail with multiple attachments.here is the code i wrote.what should i do to send the mail with multiple attachments.if i run this code iam able to send mails but not attachments.please help me
    <%@ page import="javax.mail.*,javax.mail.internet.*,java.util.Date,java.io.*,java.net.InetAddress,java.sql.*,java.util.Properties,java.net.*,javax.sql.*,javax.activation.*,java.util.*,java.text.*" %>
    <%@ page import="java.io.*,java.sql.*,java.net.*,java.util.*,java.text.*" %>
    <%
         String Attachfiles1="";
         String Attachfiles2="";
    String Attachfiles3="";
    if("Send".equalsIgnoreCase("send"))
              try
         String subject="",from="",url = null,to="";
         String mailhost = "our local host";
         Properties props = System.getProperties();
         String msg_txt="";
         String strStatus="";
    // byte[] bin=.....;
    //Adds Attechment:
    Multipart multipart = new MimeMultipart();
    BodyPart messageBodyPart = new MimeBodyPart();
    messageBodyPart.setText("Here are my attachments");
    multipart.addBodyPart(messageBodyPart);
    messageBodyPart = new MimeBodyPart();
    //first attachment
    DataSource source = new FileDataSource("C:\\img1.jpg");
    messageBodyPart.setDataHandler(new DataHandler(source));
    messageBodyPart.setFileName("C:\\Telnor1.jpg");
    multipart.addBodyPart(messageBodyPart);
    //Second attachment
    DataSource source2 = new FileDataSource("C:\\img2.jpg");
    messageBodyPart.setDataHandler(new DataHandler(source2));
    messageBodyPart.setFileName("C:\\Telnor2.jpg");
    multipart.addBodyPart(messageBodyPart);
    //etc...
    message.setContent(multipart);
    Transport.send( message );
    String mailer = "MyMailerProgram";
    to=request.getParameter("to");
    from=request.getParameter("from");
    subject=request.getParameter("subject");
    msg_txt=request.getParameter("message");
    props.put("mail.smtp.host", mailhost);
    Session mailsession = Session.getDefaultInstance(props, null);
    Message message = new MimeMessage(mailsession);
    message.setFrom(new InternetAddress(from));
    message.setRecipients(Message.RecipientType.TO,InternetAddress.parse(to, false));
    message.setSubject(subject);
    message.setHeader("X-Mailer", mailer);
    message.setSentDate(new Date());
    message.setText(msg_txt);
    BodyPart messageBodyPart = new MimeBodyPart();
    BodyPart messageBodyPart2 = new MimeBodyPart();
    Multipart multipart = new MimeMultipart(); // to add many part to your messge
    messageBodyPart = new MimeBodyPart();
    javax.activation.DataSource source = new javax.activation.FileDataSource("path of the file");
    messageBodyPart.setDataHandler(new DataHandler(source));
    messageBodyPart.setFileName("file_name");
    messageBodyPart2.setText("message"); // set the txt message
    multipart.addBodyPart(messageBodyPart);
    multipart.addBodyPart(messageBodyPart2);
    Transport.send(message);
    out.println("Message Sent");
    catch (Exception e)
    e.printStackTrace();
    if("Attachfiles".equalsIgnoreCase("attachfiles"))
    Attachfiles1=request.getParameter("fieldname1");
    Attachfiles2=request.getParameter("fieldname2");
    Attachfiles3=request.getParameter("fieldname3");
    %>
    <html>
    <body>
    <div class="frame">
         <form action="Composemail.jsp" method="post">
              <b>SelectPosition:</b> <select name="cars" >
    <option value="ABAP">ABAP
    <option value="saab">Saab
    <option value="fiat">Fiat
    <option value="audi">Audi
    </select><br><br>
    <table border="1" cellpadding="2" cellspacing="2">
    <tr><th>Name</th>
    <th>EmailId</th>
    <th>ContactNumber</th>
    <th>Position</th>
    </tr>
    <tr>
    <td>
    </td>
    </tr>
    </table><br>
    <b>SelectUser :</b><select name="cars">
    <option value="Administrator">Administrator
    <option value="saab">Saab
    <option value="fiat">Fiat
    <option value="audi">Audi
    </select>
    <br>
    <b>To :</b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" name="to" size="72"><br>
    <b>From :</b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" name="from" size="72"><br>
    <b>Subject :</b>&nbsp&nbsp&nbsp<input type="text" name="subject" size="72"><br>
    <%=Attachfiles1%><br><%=Attachfiles2%><br><%=Attachfiles3%><br><br>
    <b>Message:</b><br>
    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<textarea rows="10" cols="50" name="message">
    </textarea> <br><br>
    <b>AttachedFile:</b>&nbsp<input type="file" name="fieldname1" value="filename" size="50"><br><br>
    <b>AttachedFile:</b>&nbsp<input type="file" name="fieldname2" value="filename" size="50"><br><br>
    <b>AttachedFile:</b>&nbsp<input type="file" name="fieldname3" value="filename" size="50"><br><br>
    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="submit" name="attachfiles" value="Attachfiles">
    <center>
    <input type="submit" name="send" value="Send" >
    </center>
    </form>
    </div>
    </body>
    </html>

    Create a separate MimeBodyPart object for each attachment, rather than reusing
    the same one over and over.

  • Sending mail with multiple attachments in jsp

    hi .I wrote a code to send a mail in jsp.but now i need to send mails with multiple attachments.how can i send mail with multiple attachment.

    Create a separate MimeBodyPart object for each attachment, rather than reusing
    the same one over and over.

  • However, we've had issues with other legacy systems and programs for outlook

    I have a user who when she logs into her workstation and tries to access her outlook folders she is denied access. If she removes and then adds them back they work. Only one other person on our network had this problem which I initially thought was connectivity
    related. I replaced their cat five cable and that seemed to solve their problem. I tried this with this user and it cleared up for about a week but happened again today. Any thoughts or experience with this. Outlook doesnt support archives in a network share
    so I cant turn to them. It uses a login batch script to load mapped drives according to department. This all predates me so I did not build them. However, we've had issues with other legacy systems and programs so it is highly possible that this could be an
    issue.

    Will:Hi! Hi!
    I use Firefox and it is now No. 1 on my choice of browsers. I agree it doesn't like the "for IE only" coded sites but then IE is now a non issue as it is dead in the water! So Safari is now really bloated and getting slower by the version. Firefox is quick, good to look at with numerous skins, and what is more has become the browser of choice for web developers on both platforms because it sticks to the WWC3 code. Camino is just another flavour of Netscape which seems to be a bloat AOL IE wannabee product. Do yourself a favour and download Firefox. Give it a few spins around the block and I'm sure you will agree. As for the sites it declines to accept because of bad code, then I would suggest a strong letter of protest to the webmaster! For too long IE has been flouting the rules and trying to be the only game in town. Take some affirmative action and let the webmasters know there are other browsers available to users. If you are still not a believer then check this out:
    http://www.pcworld.com/reviews/article/0,aid,118959,00.asp
    May the force be with you!

  • Having issues with sending attachments via iMail to PC users

    Having issues with sending attachments via iMail to PC users. Either they do not see all the attachments or the attachment comes across blank. Is there any suggested ways to resolve this?

    You can also use Dropbox. 2GB free. Put files in the Public folder and you can send them links of the files instead.
    You can use my referral link http://db.tt/MXNpy62 to create an account.

  • SPEL in Extended VO - Issue with Multiple Rows

    Hi,
    I have extended a seeded VO by adding a new attribute *'Course_Flag'* with attribute type 'Boolean' and Query Column type 'VARCHAR2' and i wa successfully able to personalize and view the data of the new attribute *'Course_Flag'* in the page as ('true' / 'false') aacording to the query where clause.
    Now after adding a new image with SPEL property as *${oa.LearnerCatalogCoursesVO.Course_Flag}* it will have an issue with multiple items.
    I mean the SPEL will take the first row value 'true' / 'false' and will be corrected rendered according to the value of the first row and ignore other rows values.
    Example: if the *'Course_Flag'* value of the first row is 'true' then all the images will be rendered and if the *'Course_Flag'* value of the first row is 'false' then all the images will be NOT rendered.
    Please advise if I've missed any step.
    Thanks in advance to all.
    Regards....Ashraf

    Dear Kali,
    I have added a new function to the seeded VO SQL +('XXARMS_TRG_EVALUATION_PKG.XX_COURSE_GOT_EVAL')+,
    SQL Statment :-
    select av.activity_version_id, avtl.version_name, av.language_id, av.start_date,
    av.end_date, av.version_code, i.category_usage_id, upper(avtl.version_name) AS SORTVERSIONNAME,
    XXARMS_TRG_EVALUATION_PKG.XX_COURSE_GOT_EVAL(i.category_usage_id, av.activity_version_id) Course_Flag from
    ota_act_cat_inclusions i, ota_activity_versions av, ota_activity_versions_tl avtl
    where i.category_usage_id = :1 and i.activity_version_id = av.activity_version_id and
    nvl(av.end_date, sysdate + 1) >= trunc(sysdate) and
    av.business_group_id = ota_general.get_business_group_id and av.activity_version_id = avtl.activity_version_id and
    avtl.language = userenv('LANG') and
    ota_learner_access_util.learner_has_access_to_course(:2,:3,avtl.activity_version_id) = 'Y'
    And it is retriving the correct data for each row and i did not write any code in the RowImpl.
    Thanks for your help in advance.
    Regards...Ashraf

  • Issue with 3 attachments in an email

    Hi All,
    Anybody can send me the program which generates 3 excel sheets as an attachment. i wrote one program which geberates .txt files as an atatchmetns.
    thanks,
    maheedhar

    hi,
    following is the code which uses both formats PDF and CSV OR XLS.
    *&  Report  Z_SEND_JOB.                                                &*
    *& Title            : Send spool lists with PDF / CSV attachments.     &*
    *& Program name     : Z_SEND_JOB.                                      &*
    *& Source Code Type : Report                                           &*
    report  z_send_job.
    *                           INCLUDE                                    *
    include z_send_job_data.
    include z_send_job_pai.
    *                    AT SELECTION-SCREEN.                              *
    at selection-screen.
      if s_email1[] is initial.
        message s899(mm) with 'Please Enter E-Mail id'.
        stop.
      endif.
      if p_spool is initial and p_tcode is initial and p_pgna is initial and p_sch is initial.
        message s899(mm) with 'Please enter Spool Number or Tcode or Program name or created by'.
        stop.
      endif.
    *                    START-OF-SELECTION.                               *
    start-of-selection.
      perform get_job_details.
      if not p_pdf is initial.
    *process to send as pdf attachment
        perform convert_spool_to_pdf.
        perform process_email.
      else.
    *process to send as excel attachment
        perform convert_spool_excel.
        if not it_spool_xls_return[] is initial.
          perform process_email.
        else.
          message i000(0) with 'Cannot Send this spool as an Excel File'.
        endif.
      endif.
    *iinclude z_send_job_data.
    *&  Include           Z_SEND_JOB_DATA
    *                       Tables Workarea                                *
    tables: somlreci1,
             tbtcp.
    *                       TYPE-POOLS                                     *
    type-pools: truxs.
    *                           CONSTANTS                                  *
    constants: c_no(1) type c value ' ',
               c_device(4) type c value 'LOCL'.
    *                   GLOBAL DATA DECLARATIONS                           *
    data : gd_recsize type i.
    data : l_format(3) type c.
    *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,
           gd_sender_type like soextreci1-adr_typ,
           gd_attachment_desc type so_obj_nam,
           gd_attachment_name type so_obj_des.
    *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.
    data : gv_client type tsp01-rqclient,
           gv_name   type tsp01-rqo1name,
           gv_type   type  rststype-type,
           gv_objtype   type  rststype-type,
           gv_is_otf(1) type  c value ' ',
    *         GV_SPOOL   type  i,
           gv_pdfspoolid type tsp01-rqident,
           gv_jobname    type tbtcjob-jobname,
           gv_jobcount   type tbtcjob-jobcount.
    *                       Field Strings                                  *
    *Spool IDs
    types: begin of t_tbtcp.
            include structure tbtcp.
    types: end of t_tbtcp.
    *for excel
    types: begin of t_spool.
            include structure bapixmspoo.
    types: end of t_spool.
    *                     Internal Tables                                  *
    data: it_tbtcp type standard table of t_tbtcp initial size 0,
          wa_tbtcp type t_tbtcp.
    *Binary store for PDF
    data: begin of it_pdf_output occurs 0.
            include structure tline.
    data: end of it_pdf_output.
    data t_spools type standard table of t_spool with default key.
    data : it_spool_xls        like   t_spools with header line.
    data : it_spool_xls_return type   truxs_t_text_data.
    data: wa_spool_xls_return(255) type c.
    data:   it_message type standard table of solisti1 initial size 0
                    with header line.
    data:   it_attach type standard table of solisti1 initial size 0
                    with header line.
    data : begin of gt_spool_file occurs 0,
               tdline(2500) type c,
           end of gt_spool_file.
    *                    Selection Screen                                  *
    selection-screen begin of block b1 with frame title text-001.
    select-options: s_email1 for  somlreci1-receiver
                                  no intervals.
    parameter: p_spool like tbtcp-listident,
               p_tcode like tstc-tcode,
               p_pgna like tstc-pgmna,
               p_sch like tbtcp-sdluname default sy-uname.
    selection-screen end of block b1.
    selection-screen begin of block b2 with frame title text-002.
    parameter: p_pdf radiobutton group g1 default 'X',
               p_excel radiobutton group g1.
    selection-screen end of block b2.
    *include z_send_job_pai
    *&  Include           Z_SEND_JOB_PAI
    *&      Form  GET_JOB_DETAILS
    form get_job_details .
      data : l_spool(10) type c.
      if p_spool is initial.
    *IF USER ENTER tcode get program name
        if not p_tcode is initial.
          select single pgmna into p_pgna from tstc
                                          where tcode = p_tcode.
        endif.
    *get spool if for program name.
        if not p_pgna is initial.
          if p_sch is initial.
            select listident into l_spool from tbtcp    "GD_SPOOL_NR
                                    up to 1 rows
                                    where progname = p_pgna
                                    order by listident descending.
            endselect.
            if sy-subrc eq 0.
              move : l_spool to gd_spool_nr.
            endif.
          else.
            select listident into l_spool from tbtcp
                                up to 1 rows
                                where progname = p_pgna
                                and sdluname = p_sch
                                order by listident descending.
            endselect.
            if sy-subrc eq 0.
              move : l_spool to gd_spool_nr.
            endif.
          endif.
        endif.
    *get spool id with usr name
        if not p_sch is initial and p_pgna is initial.
          select listident into l_spool from tbtcp
                                  up to 1 rows
                                  where sdluname = p_sch
                                  order by listident descending.
          endselect.
          if sy-subrc eq 0.
            move : l_spool to gd_spool_nr.
          endif.
        endif.
      else.
        gd_spool_nr = p_spool.
      endif.
      if gd_spool_nr is initial.
        message s899(mm) with 'Spool not found'.
        stop.
      endif.
    endform.                    " GET_JOB_DETAILS
    *&      Form  CONVERT_SPOOL_TO_PDF
    form convert_spool_to_pdf .
      call function 'RSPO_RETURN_SPOOLJOB'
        exporting
          rqident              = gd_spool_nr
          first_line           = 1
          last_line            = 1000
          desired_type         = 'RAW'
        tables
          buffer               = gt_spool_file
        exceptions
          no_such_job          = 1
          job_contains_no_data = 2
          selection_empty      = 3
          no_permission        = 4
          can_not_access       = 5
          read_error           = 6
          type_no_match        = 7
          others               = 8.
      if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
      select single rqclient
                    rqo1name
                    into (gv_client, gv_name)
                    from tsp01
                    where rqident = gd_spool_nr.
      call function 'RSTS_GET_ATTRIBUTES'
        exporting
          authority     = 'SP01'
          client        = gv_client
          name          = gv_name
          part          = 1
        importing
          type          = gv_type
          objtype       = gv_objtype
        exceptions
          fb_error      = 1
          fb_rsts_other = 2
          no_object     = 3
          no_permission = 4
          others        = 5.
      if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
      if gv_objtype(3) = 'OTF'.
        gv_is_otf = 'X'.
      else.
        gv_is_otf = space.
      endif.
      if gv_is_otf eq 'X'.
        call function 'CONVERT_OTFSPOOLJOB_2_PDF'
          exporting
            src_spoolid   = gd_spool_nr
            no_dialog     = ' '
          importing
            pdf_bytecount = gd_bytecount
            pdf_spoolid   = gv_pdfspoolid
            btc_jobname   = gv_jobname
            btc_jobcount  = gv_jobcount
          tables
            pdf           = it_pdf_output.
      else.
        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.
      endif.
      if sy-subrc eq 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.
      endif.
    endform.                    " CONVERT_SPOOL_TO_PDF
    *&      Form  PROCESS_EMAIL
    form process_email .
      if not p_pdf is initial.
        describe table it_mess_att lines gd_recsize.
      else.
        describe table it_spool_xls_return lines gd_recsize.
      endif.
      check gd_recsize > 0.
      perform send_email.
    endform.                    " PROCESS_EMAIL
    *&      Form  SEND_FILE_AS_EMAIL_ATTACHMENT
    form send_file_as_email_attachment
         tables it_message
                it_attach
         using 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.
      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_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.
    * do the follwoing 3 times with three different internal tables.
      t_attachment[] = it_attach[].
    * 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 = 1.
      t_packing_list-body_start = 1.
      describe table t_attachment lines t_packing_list-body_num.
      t_packing_list-doc_type  = ld_format.
      t_packing_list-obj_descr = ld_attdescription.
      t_packing_list-obj_name  = 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 s_email1.
        t_receivers-receiver   = s_email1-low.
        t_receivers-rec_type   = 'U'.
        t_receivers-com_type   = 'INT'.
        t_receivers-notif_del  = 'X'.
        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.
      if ld_error ne 0.
        message s899(mm) with 'Error while sending email'.
        stop.
      else.
        message s899(mm) with 'Email sent succesfully'.
      endif.
    * Populate zreceiver return code
      loop at t_receivers.
        ld_receiver = t_receivers-retrn_code.
      endloop.
    endform.                    " SEND_FILE_AS_EMAIL_ATTACHMENT
    *&      Form  SEND_EMAIL                                               &*
    form send_email. " USING  P_EMAIL.
      data p_sender like somlreci1-receiver.
      data l_sub(50) type c.
      refresh it_mess_bod.
    * Default subject matter
      if not p_pdf is initial.
        gd_subject = 'SAP Report Spool Output - .pdf File Attachment'.
        gd_attachment_desc = 'spooldata'.
        it_mess_bod = 'SAP Report Spool Output - .pdf File Attachment'.
        append it_mess_bod.
      else.
        gd_subject = 'SAP Report Spool Output - .xls File Attachment'.
        gd_attachment_desc = 'spooldata'.
        it_mess_bod = 'SAP Report Spool Output - .xls File Attachment'.
        append it_mess_bod.
      endif.
    * If no sender specified - default blank
      if p_sender eq space.
        gd_sender_type = space.
      else.
        gd_sender_type = 'INT'.
      endif.
      if not p_tcode is initial.
        concatenate 'Attachment from TNS' p_tcode into l_sub separated by space.
      elseif not p_pgna is initial.
        concatenate 'Attachment from program' p_pgna into l_sub separated by space.
      elseif not p_spool is initial.
        concatenate 'Attachment from spool' p_spool into l_sub separated by space.
      else.
        concatenate 'Attachment from user' p_sch into l_sub separated by space.
      endif.
      if not p_pdf is initial.
        l_format = 'PDF'.
      else.
        l_format = 'XLS'.
        it_mess_att[] = it_spool_xls_return[].
      endif.
    * Send file by email according to the selection file format (.PDF,.XLS File)
      perform send_file_as_email_attachment
              tables it_mess_bod
                     it_mess_att
              using l_sub
                    l_format
                    gd_attachment_name
                    gd_attachment_desc
                    p_sender
                    gd_sender_type
              changing gd_error
                    gd_reciever.
    endform.                    " SEND_EMAIL
    *&      Form  convert_spool_excel                                      &*
    form convert_spool_excel .
      data : lv_spool like tsp01-rqident,
             l_count  type sy-tfill,
             l_tabix  type sy-tabix.
      lv_spool = gd_spool_nr.
      call function 'RSPO_RETURN_ABAP_SPOOLJOB'
        exporting
          rqident              = lv_spool
          first_line           = 1
        tables
          buffer               = it_spool_xls
        exceptions
          no_such_job          = 1
          not_abap_list        = 2
          job_contains_no_data = 3
          selection_empty      = 4
          no_permission        = 5
          can_not_access       = 6
          read_error           = 7
          others               = 8.
      if sy-subrc ne 0.
        message s899(mm) with 'Error while reading spool'.
        stop.
      endif.
      call function 'SAP_CONVERT_TO_CSV_FORMAT'
        exporting
          i_field_seperator    = '|'
          i_line_header        = '-'
          i_filename           = 'TEST'
        tables
          i_tab_sap_data       = it_spool_xls
        changing
          i_tab_converted_data = it_spool_xls_return
        exceptions
          conversion_failed    = 1
          others               = 2.
      if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
      data : l_length(3) type c.
    *change the format to excel by using the object classes
      loop at it_spool_xls_return into wa_spool_xls_return.
        condense wa_spool_xls_return.
    *  l_length = strlen( wa_spool_xls_return ).
    *  l_length = l_length - 3.
    **delete header lines if contains any
        if  wa_spool_xls_return cp '|--*--|'
        or  wa_spool_xls_return np '*|*|*|*'.
          delete it_spool_xls_return.
          clear wa_spool_xls_return.
    *      concatenate cl_abap_char_utilities=>newline wa_SPOOL_XLS_RETURN
    *      into wa_SPOOL_XLS_RETURN.
    *      modify it_spool_xls_return from wa_spool_xls_return.
    *      clear wa_spool_xls_return.
        else.
    *If not new line then replace '|' by tabs
          if not wa_spool_xls_return eq cl_abap_char_utilities=>newline.
            if wa_spool_xls_return ca '|'.
              concatenate cl_abap_char_utilities=>newline wa_spool_xls_return
    *        cl_abap_char_utilities=>horizontal_tab
              into wa_spool_xls_return.
              replace all occurrences of '|' in wa_spool_xls_return
              with cl_abap_char_utilities=>horizontal_tab.
    *get rid of '-' symbol if contains any
    *        if wa_SPOOL_XLS_RETURN CA '-'. "or not wa_SPOOL_XLS_RETURN CA '|'.
    *          CLEAR wa_SPOOL_XLS_RETURN.
    *          concatenate cl_abap_char_utilities=>newline wa_SPOOL_XLS_RETURN
    *          cl_abap_char_utilities=>horizontal_tab
    *          into wa_SPOOL_XLS_RETURN.
    *        endif.
              replace all occurrences of '.' in wa_spool_xls_return
              with space.
              condense wa_spool_xls_return.
              modify it_spool_xls_return from wa_spool_xls_return.
    *          wa_SPOOL_XLS_RETURN = cl_abap_char_utilities=>newline.
    *          IF l_count NE 0 .
    **        l_tabix = l_tabix + 1.
    **Insert new line for the excel data
    **        if sy-tabix gt 1.
    **          INSERT wa_SPOOL_XLS_RETURN INTO it_SPOOL_XLS_RETURN INDEX l_tabix.
    **        endif.
    *            l_count = l_count - 1.
    *          ENDIF.
              clear wa_spool_xls_return.
            else.
              delete it_spool_xls_return.
              clear wa_spool_xls_return .
    *          concatenate cl_abap_char_utilities=>newline wa_SPOOL_XLS_RETURN
    **        cl_abap_char_utilities=>horizontal_tab
    *          into wa_SPOOL_XLS_RETURN.
    *          modify it_SPOOL_XLS_RETURN from wa_SPOOL_XLS_RETURN.
    *          clear wa_SPOOL_XLS_RETURN.
            endif.
          endif.
        endif.
      endloop.
    endform.                    " convert_spool_excel

  • Multiple Attachments in Email Payload declaring with Application Types

    Hi XI Experts,
    I am currently working on an Email Module to handle multiple attachments. I have read all forum entries to this topic but I got know answer to my question.
    My question:
    Is it technically possible to declare more than one Atttachment of the Payload with the tag <Application Type>? From the coding point of view I know that it is possible like this
    for ( int  i = 0; i < XMBMessageOperator.numberOfPayloads(message); i++){
    XMBPayload payload = XMBMessageOperator.getPayload(message, i);
    payload .setPayloadType(PayloadType.APPLICATION);
    but does the XI then also process all application attachment messages correctly as separate messages?
    So from the coding point of view does the XI iterate over all application attachments and processes the messages?
    best regards,
    Dries

    Hi Dries,
    I would suggest to do it using SAPConnect instead of ccBPM.Check this blog.
    It splits the payload and sends it as multiple attachment.https://weblogs.sdn.sap.com/pub/wlg/3007.Source [original link is broken] [original link is broken] [original link is broken] [original link is broken] code sends multple attachments as an email.
    You have to use the viceversa.Read the thomas jung blogs for further info /people/thomas.jung3/blog/2004/09/09/receiving-e-mail-and-processing-it-with-abap--version-610-and-higher .
    vasanth

  • Issues with multiple things since Mavericks update

    I installed the Mavericks update and since, I have been having multiple problems with different things on my MacBook Pro 13"
    1. Printer issues: I have an HP officejet 6500 wireless printer (Officejet 6500 E709n Series), and now it's having major issues with printing, yet was working perfect prior to update. It will either cut out pages when printing PDF documents, or printing so slow that it has to take a break in between printing each document (an issue that all never occurred until update), to print documents back to back, it will stop after one document as though I have no other documents in queue to print, and pauses for an extremely long time (nearly a full minute, no exaggeration here, literally almost a full 60 seconds), something it's never done before this update. My Apps update even did an update to the HP software that is inside the Mac already to use printing (in other words, the mac doesn't need to have the HP software manually installed for it to work, it automatically sees the printer because it is connected to my wireless network just as my Macbook Pro which is also connected wirelessly to my network).
    2. Internet issues: am now unable to click on certain links in safari that I was able to use prior to the update, yet they will open fine inside of firefox with no issues, yet I cannot always switch between two different browsers to perform task online (literally have to start all over inside firefox while in the middle of something in safari). Also lots of websites no longer work correctly and I have to constantly clear history and cookies to attempt to use certain sites, at times it will help, other times it wont work period, yet the same exact site will work perfect in firefox (which I do not use, only on my system for use on certain sites for school because in safari prior to the update, I would have issues with only the class site and some links not working at all, no spinning wheel, no errors, just nothing, no response of any kind, basically worse than what it was before the update). Another issue, hit Ctrl+a to select inside Safari and it highlights, but then when you click out of the highlight, it comes back on it's own several times without you hitting anything, just click inside the screen on a blank space (no links, etc) with touchpad.
    3. System issues:  My system is way slower than what it was prior to the update, click on things and it wont respond at all, then minutes later will eventually respond or pops up the spinning color wheel, which it either never responds or takes an extremely long time to respond. And no matter how much I restart, it doesn't help anything. Even just to sit doing nothing, no clicking or usage on the system, and the color wheel pops up.
    4. Mail issues: Mail is now popping up completely blank messages that I have sent out, the person receives it with no issues, yet I cannot look at the message I sent neither in the inbox or the sent items when I need to look at them again, an issue not present prior to update. Also I an now having issues when receiving mail, sometimes it will check for mail and sometimes I have to manually click to make it check the server for mail, an issue not present prior to update as well.
    As of now, since I have had the chance to used the system since the update, these are the issues I have had, yet haven't had the chance to check other things, so there may be other issues that are occurring that I'm not aware of at the moment. I knew it would be a mistake to do this "free" update and did so anyway and now having one issue after the next with each application I open to use.
    Mac general info:
    Mac is one year old, purchased brand new, no shareware programs of any kind installed.
    Use for school and basic web surfing use.
    Do not install any programs onto system that I'm unsure are safe (basically programs for/from school/school websites only, or from the Mac Apps store only), not even programs like Skype, nor any windows based programs of any kind.
    Lots of free memory avail because I save everything onto external hard drives (purchased brand new as well, only 4months old) in case system crash occurs, only things on the system is Itunes music or pics from photo stream that sync to the system when Iphone connected.
    Mac system info:
    - Processor  2.5 GHz Intel Core i5
    - Memory  4 GB 1600 MHz DDR3
    - Graphics  Intel HD Graphics 4000 1024 MB
    - Software  OS X 10.9
    - Number of Processors:          1
    - Total Number of Cores:          2
    - L2 Cache (per Core):          256 KB
    - L3 Cache:          3 MB

    For those needing help fixing their system and putting it back to Lion or Mountain Lion, this is what I have done to eliminate all my issues in about an hour (depending on your internet connection).
    Amazing thing, I just restored my computer back to Mountain Lion, and she's working perfect again, as I knew she would. E-mail popping into mailbox instantly as it should and did before the update, printer working fast as it was before update, no more freezing or glitches of any kind thankfully and finally. Here is the link that is through the Apple site to direct you on how to put your system back and get rid of Maverick's, that is assuming that is what you would like to do and also includes link for those wanting to try fixing the issue if that is your preference (most of this info is for those with mountain lion and some with the previousverisoin of OS X lion).
    If you want to keep Maverick's here is a good post on the apple discussion board to help you out:
    https://discussions.apple.com/docs/DOC-6161
    If you just want to totally get rid of it and put back what you had before, this is the short version of how to do so:
    https://discussions.apple.com/docs/DOC-3353
    NOTE: This particular link has a lot of info on what to do for different situations, it is a bit lengthy, yet still very helpful.
    OS X Mountain Lion: Reinstall OS X (direct from Apple support site, not someone else):
    http://support.apple.com/kb/PH10763?viewlocale=en_US
    OS X: About OS X Recovery (also from apple support directly and includes some instructions just the same as previous links above):
    http://support.apple.com/kb/HT4718
    Just in case you aren't sure what it will all look like as you are doing things, this is a link to show you a few pics of what you will see  as you as you are going through the process, it can be helpful for those who aren't sure what they are doing or how to do things at all:
    http://www.apple.com/osx/recovery/
    This is a way to download the Mountain Lion disk info from the server
    http://support.apple.com/kb/DL1433
    I hope this helps someone, it was amazing for me and my system is working perfect again like it was, battery life is way better went from like 3 hours to like 5 (not on full charge by the way, after it sat for a while doing the online update which took a while so that's saying something alone, huge improvement). I plan to wait a while before attempting to reinstall Maverick's, long enough for them to fix the bugs.

  • Issue with multiple digital signatues in form

    Hello all-
    I'm having an issue with a form that has multiple digital signatures.  The form additionally has a listbox in which the user can select recipients to email the form to. My objective is to be able to send a form to various users by email to sign digitally. After extending the features for Reader, I inserted a standard Livecycle digital signature by clicking on one of the digital signature fields. However, after inserting the digital signature, I can't perform any other actions (email the form by selecting recipients from the listbox, clicking a different digital signature field for signature insertion, etc.) It is as if the digital signature instertion made an uneditable snapshot of the form, which I do not want to do.  What can I do to rectify this process?
    Will upload the form if necessary.
    Thank you and happy holidays.
    masber2000

    Mr. Kumar,
    The desired workflow is for
    1)      Firefighter 1 to complete the top portion of the Agreement
    section, sign in the Firefighter 1 signature field (which locks the top
    portion of the Agreement Section), then select Firefighter 2 from the
    e-mail drop down list and e-mail the PDF form to Firefighter 2;
    2)      Firefighter 2 opens the e-mail and the PDF attachment,
    completes the second portion of the Agreement Section, sign in the
    Firefighter 2 signature field (which locks the bottom portion of the
    Agreement Section), select Lieutenant 1 from the e-mail drop down list
    and e-mail the PDF form to Lieutenant 1;
    3)      Lieutenant 1 opens the e-mail and the PDF attachment, checks
    the approved box, signs the Lieutenant 1 signature field, select
    Lieutenant 2 from the e-mail drop down list and e-mail the PDF form to
    Lieutenant 2;
    4)      Step three continues through Lieutenant 2, Battalion Chief 1
    and Battalion Chief 2
    5)      Battalion Chief 2 sends the fully completed form back to
    Firefighter 1 who copies the completed form to Firefighter 2
    Note: if any of the officers disapprove the agreement the disapproved
    form is immediately sent back to Firefighter 1
    Jim Frazier, Deputy Chief
    Villages Public Safety Department
    3035 Morse Boulevard
    The Villages, FL 32163
    352-205-8280
    Honor in Service

Maybe you are looking for

  • My macbook will only start in safe mode.

    I think my Mac is dying. It got really slow and started showing the beach ball, then it would just freeze up. I would have to restart it. For a while, it would restart just fine, then it would take forever and show me the gray screen. Then, it wouldn

  • I think the dock on my 5th generation ipod nano is broken. Is there a way that i could fix this?

    Every time I try to connect my 5th generation ipod Nano to my computer I get a message that says that the device is unrecognizable. I have tried uninstalling and then reinstalling itunes and I have tried most everything else the Apple Support says to

  • Adding audio (music)to my project

    I am trying to create a highlight video of all my sons football games. After spending hours learning ( new user for PE) I finally figured out editing out my highlights , it was much easier placing my clips in the timeline. I did not figure this out u

  • POPUPKEY_FROM_QUERY returning value to wrong row

    Hi, I'm running Apex 3.0.1. I have a tabular report that I'm trying to add a popup from query that returns the key/code value (instead of the display value). I can call the pop-up okay, but it's returning the value to the wrong table row. I can see i

  • SQL conversion of MEMO field

    I have a web site that builds pages based on content in an Access DB. One of the fields is MEMO and contains body copy for the page (usually 300-400 words per record). This bodyCopy field is HTML tagged IN the record (in case that matters). So I impo