Unicode in a SOAPMessage attachment

Hi all,
I'm at the end of my resources (and those are very limited when speaking of character sets).
Specifically, I'm having trouble with unicode character 2628 (http://www.fileformat.info/info/unicode/char/2628/index.htm)
The SOAPMessage response I'm receiving is fine.
SOAPMessage response = getResponse();
response.writeTo(System.out); // Works fine. Outputs the cross of lorraine fine.Where I'm having trouble is reading the data from the attachments. I've tried a few hundred different things to no avail.
Iterator attItr = response.getAttachments();
AttachmentPart attPart = (AttachmentPart)attItr.next();                          
String content = new String(attPart.getRawContentBytes(), "UTF-8"); // Doesn't work. Giberish.
String contentTo = attPart.getContent(); // Doesn't work either. Giberish as wellI've tried a few other things ... but I'm really stuck.
Any help would be greatly appreciated.
Thanks.

public class AttachmentInfo {
private Part part;
private int num;
* Returns the attachment's content type.
public String getAttachmentType() throws MessagingException {
String contentType;
if ((contentType = part.getContentType()) == null)
return "invalid part";
else
     return contentType;
* Returns the attachment's content (if it is plain text).
public String getContent() throws java.io.IOException, MessagingException {
if (hasMimeType("text/plain"))
return (String)part.getContent();
else
return "";
* Returns the attachment's description.
public String getDescription() throws MessagingException {
String description;
if ((description = part.getDescription()) != null)
return description;
else
return "";
* Returns the attachment's filename.
public String getFilename() throws MessagingException {
String filename;
if ((filename = part.getFileName()) != null)
return filename;
else
return "";
* Returns the attachment number.
public String getNum() {
return (Integer.toString(num));
* Method for checking if the attachment has a description.
public boolean hasDescription() throws MessagingException {
return (part.getDescription() != null);
* Method for checking if the attachment has a filename.
public boolean hasFilename() throws MessagingException {
return (part.getFileName() != null);
* Method for checking if the attachment has the desired mime type.
public boolean hasMimeType(String mimeType) throws MessagingException {
return part.isMimeType(mimeType);
* Method for checking the content disposition.
public boolean isInline() throws MessagingException {
if (part.getDisposition() != null)
return part.getDisposition().equals(Part.INLINE);
else
return true;
* Method for mapping a message part to this AttachmentInfo class.
public void setPart(int num, Part part)
throws MessagingException, ParseException {
this.part = part;
this.num = num;
}

Similar Messages

  • Unicode Upgarde Issue : Excel attachment formatting error

    Hi all
    We recently had over unicode upgrade.
    We have some ALV reports, which when we run in bg, send an email with attachment in excel format. These excel sheets have some XML tags also specified in it.
    Now after upgrade, when i open the attachment, whole data ( along with XML tags ) are all filled in the 1st column of the excel.
    I am using FM SO_NEW_DOCUMENT_ATT_SEND_API1 to send email
    The funny thing..when i copy all these data from column 1 and create a new xls document, the xml format is coming fine.
    Can any one please guide me in this issue
    Points will be rewarded for all helpful answers

    Hello.. any updates..anyone??

  • Unique Problem: Returning SOAP+ Attachment using a class based webservice

    Hi everyone,
    Im trying to return a Soap+ attachment response back using the following:
    attachDoc(byte[] bdoc, String sTransactionNumber,
                   String sRequestedType)
    Where byte[] is the attachment and the 2 string parameters are soap message contents.
    The attachment is attached successfully to the message and i can send a response back to the clients console using :
    message.writeTo(System.out);
    My problem is that i dont know how to return this soapmessage+attachment back to the client.
    Ive tried using the return type of the method as :
    public SOAPMessage attachDoc(byte[] bdoc, String sTransactionNumber,
                   String sRequestedType)
    but i cant return a SOAPMessage return type in axis.
    Does anyone have any clues how i should sort this out so that the client gets the SOAPMessage and attachment when the method is called ?
    Please help :S
    Thanks,

    I dunno if this is what you asked for....
    Hope this helps a bit
    You may want to check this link out
    http://www-unix.globus.org/mail_archive/discuss/2007/02/msg00037.html
    MessageContext msgContext = MessageContext.getCurrentContext();
    File file = new File("filename.txt");
    org.apache.axis.attachments.AttachmentPart replyPart=
    new org.apache.axis.attachments.AttachmentPart(new DataHandler(new
    FileDataSource(file)));
    Message rspMsg= msgContext.getResponseMessage();
    rspMsg.addAttachmentPart(replyPart);
    so ur basically adding the file to the reply message.
    The link i gave has a better description, it has the entire process of sending file to server and downloading file from server codes.

  • Mail Sending- with Unicode enabled text in the attachment

    hi,
    i have a specific requirement for JAPAN country. its as follows:
    i am retrieving delivery details into my program & i need to send them as in a mail attachment(as CSV file) to particular mail id.
    for sending mail, i am using the function module "SO_NEW_DOCUMENT_ATT_SEND_API1".
    here is my problem :
    as this program will be used by JAPAN people, some of the delivery details are stored in Japanese (text like Customer name,street address etc..)
    .so when i am trying to send it as attachment these japanese text is not appearing correctly in the mail attachment. its appearing as Junk characters.
    i observed here the problem is may be because these Texts are not sending with UNICODE format. may be the default format is ASCII, which can not
    interpret Japanese text properly.
    so pl let me know is there any new function module where we can mention the Encoding format like UNICODE ?? or can i use the
    same above mentioned function module with providing this UNICODE value somewhere....
    regards
    srikanth,Intelligroup.
    Message was edited by: Srikanth Kidambi

    Hi,
    Check the answer from xiaoming cai in this thread:
    Send mails with attachment to external email id
    Eddy

  • SRM can not open attachment after unicode conversion

    Hi,
    Our system is SRM4.0,  last week we do a unicode conversion project.
    After we convert to unicode, some attachment in SC and PO can not be openned,  these attachment file name include some chinese. If the attachment file name is all English, no problem to open it.
    I think it is the cause by unicode conversion, do you have any idea what is the root of this problem?
    Thanks.

    Hi,
    Please check in table :BBP_PDATT
    If you have created a shopping cart with attachment. The attachment will be in the above table
    Regards
    G.Ganesh Kumar

  • Sending Excel as attachment in Email (Unicode)

    Hi,
    I'm using SO_NEW_DOCUMENT_ATT_SEND_API1 FM to send excel attachments as emails to external addresses.
    However, this the SAP upgrade to ECC6.0 from R/3 4.6B
    then I cannot open BIG5 char excel, who does know how to sending Unicode excel as attachment in email.
    the Excel can show Chinese , BIG5 code ,Japanese ,Korea .
    OR which new funciton module in ECC6.0 like SO_NEW_DOCUMENT_ATT_SEND_API1 FM .
    Regards,
    Hank

    Hey,
    try this one.
        lv_string = str_data1.
          cl_bcs_convert=>string_to_solix(
            EXPORTING
              iv_string   = lv_string
              iv_codepage = '4103'  "suitable for MS Excel, leave empty
          iv_add_bom  = 'X'     "for other doc types
            IMPORTING
              et_solix  = binary_content
              ev_size   = size ).
        CATCH cx_bcs.
          MESSAGE e445(so).
      ENDTRY.
            send_request = cl_bcs=>create_persistent( ).
    Now  create document object from internal table with text
    document = cl_document_bcs=>create_document(
              i_type    = 'RAW'
              i_text    = main_text
              i_subject = l_var ).     
           document->add_attachment(
              i_attachment_type    = 'xls'                               i_attachment_subject = ' Details'                      i_attachment_size    = size
              i_att_content_hex    = binary_content ).
        add document object to send request
            send_request->set_document( document ).
        --------- add recipient (e-mail address) -----------------------
        create recipient object
            recipient = cl_cam_address_bcs=>create_internet_address( abc at abc.com).
           recipient = cl_cam_address_bcs=>create_internet_address( 'abc at abc.com' ).
        add recipient object to send request
            send_request->add_recipient( recipient ).
            sent_to_all = send_request->send( i_with_error_screen = 'X' ).
            COMMIT WORK.
    This will definitely work .if any doubts aask me.
    Neeraj

  • Unicode attachment

    I want to create an email attachment encoded in unicode sending from a servlet. I've tried to create temporary file, and attach the file. I can see the temporary file in my server is encoded correctly but after I received the attachment, it's a bunch of "?". I've also tried to use the string (unicode) directly and also with the same problem. Has anybody done this before? Many thanks!
    Here is my code:
    Properties props = new Properties();
    props.put("mail.smtp.host", mymailhost);
    Session s = Session.getInstance(props,null);
    MimeMessage message = new MimeMessage(s);
    message.setFrom(new InternetAddress("[email protected]"));
    essage.addRecipient(Message.RecipientType.TO,
    new InternetAddress(req.getParameter("emailAddr")));
    message.setSubject(subject);
    // send a multipart message// create and fill the first message part
    MimeBodyPart mbp1 = new MimeBodyPart();
    String msgText = new String(mystr.getBytes("8859_1"),"UTF-8");
    mbp1.setText(msgText, "UTF-8");
    //String file = getServletContext().getRealPath("/"); + "/temp/" + request.getSession().getId() + String.valueOf((new Date()).getTime())+ ".txt";
    //writeOutput(msgText, file);
    MimeBodyPart mbp2 = new MimeBodyPart();
    // DataSource fds = new FileDataSource(file);
    //mbp2.setDataHandler(new DataHandler(fds));
    mbp2.setDataHandler(new DataHandler(msgText, "text/html;charset=\"UTF-8\""));
    //mbp2.setText(msgText, "UTF-8");
    Multipart mp = new MimeMultipart();
    mp.addBodyPart(mbp1);
    mp.addBodyPart(mbp2);
    message.setContent(mp);
    message.setSentDate(new Date());
    private void writeOutput(String str, String file) {
    try {
    FileOutputStream fos = new FileOutputStream(file);
    Writer out = new OutputStreamWriter(fos, "UTF8");
    out.write(str);
    out.close();
    } catch (IOException ex) {
    ex.printStackTrace();
    }

    For me it worked when I used
    setText(msgText, "utf8");
    UTF-8 and utf-8 did not work!
    complete:
    MimeBodyPart bodyPartAttachment = new MimeBodyPart();
    bodyPartAttachment.setHeader("Content-Transfer-Encoding", "quoted-printable");
    bodyPartAttachment.setHeader("Content-Type", "text/html; charset=utf8");
    bodyPartAttachment.setText(sAttachment, "utf8");
    bodyPartAttachment.setDisposition(Part.ATTACHMENT);
    bodyPartAttachment.setFileName(...);
    bodyPartAttachment.setDescription("File Attachment");
    multipart.addBodyPart(bodyPartAttachment);

  • Email attachment problem - unicode?

    Hi All,
    I've copied some of the examples from SDN on how to send an attachment via email from ABAP.
    The problem is that the text file attachments are incorrect. Each character is separated by another character. If I create a text attachment that reads "Hello" in the ABAP, the resulting text attachment is "H E L L O ".
    The SAP system is unicode. I have tried both SO_NEW_DOCUMENT_ATT_SEND_API1 and SO_DOCUMENT_ATT_SEND_API1. Both have the same effect.
    Does anyone have any idea how to ensure the email attachments retain the same format?
    Cheers
    Richard

    Hi Richard,
    Please refer to the below mentioned code and compare the Function modules used in your program and the below one.
    Program:  ZRAT                 Creation Date: 12.04.2007 *
    Program Title :  Retirement Age Trigger                  *
    Program Author:  Puneet Jhari                            *
    Program Type  :   Executable                             *
    Object ID     :                                          *
    Technical Specification Version:                         *
    Technical Specification Author:                          *
    Code Quality Reviewer     :                              *
    Transport No.          :  SRDK906499                     *
    Program Description:                                     *
    Inputs                                                   *
       Tables:                                               *
       Parameters                                            *
       External files:                                       *
    Outputs                                                  *
       Reports:                                              *
       Tables:                                               *
       Databases:                                            *
       Screens:                                              *
       Parameters                                            *
       External files:                                       *
       Other objects:                                        *
    Return codes set by ABAP:                                *
    Modification Informaion                                  *
    Program Version:                                         *
    Date         : DD-MMM-YYYY                               *
    Author       :                                           *
    Description  :                                           *
    Transport No.:                                           *
    REPORT  zrat NO STANDARD PAGE HEADING.
    *DATA DECLARATION
    DATA : BEGIN OF wa_ccode,
            bukrs TYPE t001-bukrs,
           END OF wa_ccode.
    DATA : itab_ccode LIKE TABLE OF wa_ccode.
    DATA : BEGIN OF wa_emp,
            pernr TYPE pa0001-pernr,
            sachp TYPE pa0001-sachp,
            sname TYPE pa0001-sname,
           END OF wa_emp.
    DATA : itab_emp LIKE TABLE OF wa_emp.
    DATA : BEGIN OF wa_bdate,
            nachn LIKE pa0002-nachn,
            vorna LIKE pa0002-vorna,
            pernr TYPE pa0002-pernr,
            gbdat TYPE pa0002-gbdat,
           END OF wa_bdate.
    DATA : itab_bdate LIKE TABLE OF wa_bdate.
    DATA : new_date LIKE sy-datum.
    DATA : diff TYPE i.
    DATA : years LIKE p0347-scryy,
           months LIKE p0347-scrmm,
           days LIKE p0347-scrdd.
    DATA : sup_code LIKE pa0001-sachp,
           itab_usrid LIKE t526-usrid,
           sup_pernr LIKE pa0105-pernr.
    DATA : BEGIN OF wa_email,
           usrid_long LIKE pa0105-usrid_long,
           END OF wa_email.
    DATA : sup_email LIKE TABLE OF wa_email.
    DATA : gwa_document_data LIKE sodocchgi1,
           gc_name  TYPE so_obj_nam VALUE 'RETIREMENT',
           gc_senst TYPE so_obj_sns VALUE 'P',
           gc_size  TYPE so_doc_siz VALUE '510',
           gi_obj_cnt LIKE TABLE OF solisti1 WITH HEADER LINE,
           gi_recievers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
           gwa_obj_cnt LIKE LINE OF gi_obj_cnt.
    DATA : smtp_addr LIKE adr6-smtp_addr.
    DATA : wa_date LIKE sy-datum,
           entries LIKE sy-tabix,
           name(15),
           line1(18) TYPE c,
           line2(20) TYPE c,
           line3(20) TYPE c,
           line4(23) TYPE c,
           line5(10) TYPE c,
           line6(45) type c,
           date(2) TYPE c,
           month(2) TYPE c,
           year(4) TYPE c.
    *START OF SELECTION
    SELECT bukrs
    FROM t001
    INTO TABLE itab_ccode
    WHERE land1 EQ 'GB'.
    SORT itab_ccode.
    DELETE ADJACENT DUPLICATES FROM itab_ccode.
    SELECT pernr sachp sname
    FROM pa0001
    INTO TABLE itab_emp
    FOR ALL ENTRIES IN itab_ccode
    WHERE bukrs EQ itab_ccode-bukrs AND begda LE sy-datum AND
    endda GE sy-datum and persg eq '1'.
    SELECT nachn vorna pernr gbdat
    FROM pa0002
    INTO TABLE itab_bdate
    FOR ALL ENTRIES IN itab_emp
    WHERE pernr EQ itab_emp-pernr.
    *TO CHECK EMPLOYEES WHOSE AGE IS NEAR 75 YEARS.
    LOOP AT itab_bdate INTO wa_bdate.
      new_date = wa_bdate-gbdat.
    *TO CALCULATE THE AGE TILL DATE
      CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
        EXPORTING
          date1                         = sy-datum
          date2                         = new_date
         output_format                 = '05'
       IMPORTING
         years                         = years
         months                        = months
         days                          = days
      IF sy-subrc <> 0.
      ENDIF.
      IF years EQ 64 AND months EQ 4.
        IF days GE 23 AND days LE 31.
    *FETCH THE DATA IF THE AGE IS NEARING 75 YEARS
          SELECT SINGLE sachp FROM pa0001 INTO sup_code WHERE pernr EQ
          wa_bdate-pernr AND begda LE sy-datum AND endda GE sy-datum.
          SELECT SINGLE usrid FROM t526 INTO itab_usrid WHERE sachx EQ
          sup_code.
          SELECT SINGLE pernr FROM pa0105 INTO sup_pernr WHERE usrid EQ
          itab_usrid AND subty EQ '0001'.
          clear sup_email[].
          SELECT usrid_long FROM pa0105 INTO TABLE sup_email WHERE pernr EQ
          sup_pernr AND subty EQ '0010'.
    *EMAIL ADDRESS OF THE SUPERVISOR TO BE NOTIFIED
          CLEAR gi_obj_cnt.
          CLEAR gi_recievers.
          CLEAR gwa_document_data.
          Loop at sup_email into wa_email.
          write sy-uline+0(5).
          write sy-uline+10(5).
          write sy-uline+20(5).
          write sy-uline+30(5).
          write sy-uline+40(5).
          write sy-uline+50(5).
          write sy-uline+60(5).
          write sy-uline+70(5).
          smtp_addr = wa_email-usrid_long.
          gi_recievers-receiver = smtp_addr.
          gi_recievers-rec_type = 'U'.
          gi_recievers-com_type = 'INT'.
          APPEND gi_recievers.
          Endloop.
          smtp_addr = '[email protected]'.
          gi_recievers-receiver = smtp_addr.
          gi_recievers-rec_type = 'U'.
          gi_recievers-com_type = 'INT'.
          APPEND gi_recievers.
          gwa_document_data-obj_name    = gc_name.
          gwa_document_data-obj_descr   = 'RETIRE'.
          gwa_document_data-sensitivty  = gc_senst.
          gwa_document_data-obj_langu = sy-langu.
    *CONTENT OF THE EMAIL TO BE SENT
          line1 = 'Please note that  '.
          line2 = wa_bdate-vorna.
          line3 = wa_bdate-nachn.
          line4 = ' will be 65 years on  '.
          line50(4) = wa_bdate-gbdat4(4).
          date = line5+2(2).
          month = line5+0(2).
          year = wa_bdate-gbdat+0(4) + 65.
          CONCATENATE date month year INTO line5 SEPARATED BY '.'.
          line6 = '.Please complete the Retirement Procedure.'.
          CONCATENATE line1 line2 line3 line4 line5 line6 INTO gwa_obj_cnt
          SEPARATED BY space.
          APPEND gwa_obj_cnt TO gi_obj_cnt.
          CLEAR gwa_obj_cnt.
          DESCRIBE TABLE gi_obj_cnt LINES entries.
          READ TABLE gi_obj_cnt INDEX entries.
    gwa_document_data-doc_size = ( entries - 1 ) * 255 + STRLEN( gi_obj_cnt
    *FUNCTION MODULE TO SEND THE EMAIL TO THE CONCERNED PERSONS
    CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
      EXPORTING
        document_data                    = gwa_document_data
        document_type                    = 'RAW'
             commit_work                      = 'X'
            TABLES
             object_content                   = gi_obj_cnt
              receivers                        = gi_recievers
      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
    *MESSAGE TO BE DISPLAYED AFTER THE EXECUTION
         endif.
          CASE sy-subrc.
            WHEN 0.
              LOOP AT gi_recievers.
                IF gi_recievers-receiver = space.
                  name = gi_recievers-rec_id.
                ELSE.
                  name = gi_recievers-receiver.
                ENDIF.
                IF gi_recievers-retrn_code = 0.
                  WRITE: / name, ': succesfully sent'.
                ELSE.
                  WRITE: / name, ': error occured'.
                ENDIF.
              ENDLOOP.
            WHEN 1.
              WRITE: / 'Too many receivers specified !'.
            WHEN 2.
              WRITE: / 'No receiver got the document !'.
            WHEN 4.
              WRITE: / 'Missing send authority !'.
            WHEN OTHERS.
              WRITE: / 'Unexpected error occurred !'.
          ENDCASE.
        ENDIF.
      ENDIF.
    ENDLOOP.
    In case you have any further clarifications,do let me know.
    Regards,
    Puneet Jhari.

  • UTF-8 Unicode output

    Hi all,
    I'm at the end of my resources (and those are very limited when speaking of character sets).
    Specifically, I'm having trouble with unicode character 2628 (http://www.fileformat.info/info/unicode/char/2628/index.htm)
    The SOAPMessage response I'm receiving is fine.
    SOAPMessage response = getResponse();
    response.writeTo(System.out); // Works fine. Outputs it correctlyWhere I'm having trouble is reading the data from the attachment itself. I've tried a few hundred different things to no avail.
    Iterator attItr = response.getAttachments();
    AttachmentPart attPart = (AttachmentPart)attItr.next();                          
    String content = new String(attPart.getRawContentBytes(), "UTF-8"); // Doesn't work. Giberish.
    String contentTo = attPart.getContent(); // Doesn't work either. Giberish as wellI've tried a few other things ... but I'm really stuck.
    Any help would be greatly appreciated.
    Thanks.

    You may be able to find a text editor that can do the conversion. Alternatively, I have converted from one encoding to the another programmatically using Java as well.
    Tim Tow
    Applied OLAP, Inc

  • "Content is not allowed in prolog" with SOAP Attachment

    I'm writing an application using SAAJ that sends a soap message to a servlet which responds with some information, including HTML which the client application will display. The HTML has to go into a SOAP attachment so the tags won't get confused with XML.
    I had the whole thing working with plain text sending within a normal node, and I only switched a few lines to make that text an attachment with HTML instead, but now I'm getting the exception "Content is not allowed in prolog" on the Client side when it tries to create the envelope from the SOAPMessage.
    Code for building answering SOAPMessage with attachment (Servlet to Client)
         public static SOAPMessage buildXML(Message newMessage){
              SOAPMessage msg = null;
              try {
                   MessageFactory msgFactory = MessageFactory.newInstance();
                   msg = msgFactory.createMessage();
                   // Create an envelope in the message
                   SOAPEnvelope envelope = msg.getSOAPPart().getEnvelope();
                   msg.setProperty(SOAPMessage.WRITE_XML_DECLARATION, "true");
                   msg.setProperty(SOAPMessage.CHARACTER_SET_ENCODING, "UTF-8");
                   //Get hold of the the body
                   SOAPBody body = envelope.getBody();
                   SOAPElement soap_message = body.addChildElement("MESSAGE");
                   if (newMessage.message_type != null){
                        SOAPElement soap_message_type = soap_message.addChildElement("MESSAGETYPE");
                        soap_message_type.addTextNode(newMessage.message_type);
                   if (newMessage.questionID != 0){
                        SOAPElement soap_questionID = soap_message.addChildElement("QUESTIONID");
                        soap_questionID.addTextNode("" + newMessage.questionID);
                   if (newMessage.username != null){
                        SOAPElement soap_username = soap_message.addChildElement("USERNAME");
                        soap_username.addTextNode(newMessage.username);
                   if (newMessage.password != null){
                        SOAPElement soap_password = soap_message.addChildElement("PASSWORD");
                        soap_password.addTextNode(newMessage.password);
                   if (newMessage.message_text != null){
                        AttachmentPart soap_message_text = msg.createAttachmentPart("<html><body>" + newMessage.message_text + "</body></html>", "text/html");
                        soap_message_text.setContentId("MESSAGETEXT");
                        msg.addAttachmentPart(soap_message_text);
                        //SOAPElement soap_message_text = soap_message.addChildElement("MESSAGETEXT");
                        //soap_message_text.addTextNode(newMessage.message_text);
                   if (newMessage.sampleString != null){
                        SOAPElement soap_password = soap_message.addChildElement("SAMPLESTRING");
                        soap_password.addTextNode(newMessage.sampleString);
                   SOAPElement tmpEl;
                   for (int i=0; i<newMessage.numArrayUsed; i++){
                        tmpEl = soap_message.addChildElement("SAMPLEINT");
                        tmpEl.addTextNode("" + newMessage.sampleInt);
                   msg.saveChanges();
              } catch (Exception e) {
                   e.printStackTrace();
              return msg;
    You can see in the area where it adds MESSAGETEXT there are two clients commented out which work. The three lines above it are what changed to make it an attachment instead.
    Code in Client for recieving reply from Servlet
    SOAPMessage reply = connection.call(soap_msg, endpoint);
    System.out.println("\nReceived reply from: " + endpoint);
    reply.writeTo(System.out);
    System.out.println("");
    reply_msg = ProcessXML.parse(reply);This is the console output:
    Edit: These forums seem to be inserting an extra > before the <?xml version="1.0" encoding="UTF-8"?> line, but it doesn't exist in the code I'm pasting
    Received reply from: http://localhost:8080/kuj/CaseStudyServlet
    ------=_Part_2_371807.1137465625031
    Content-Type: text/xml; charset=UTF-8
    <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><MESSAGE><MESSAGETYPE>deliverquestion</MESSAGETYPE><QUESTIONID>1</QUESTIONID><USERNAME>zac</USERNAME></MESSAGE></SOAP-ENV:Body></SOAP-ENV:Envelope>
    ------=_Part_2_371807.1137465625031
    Content-Type: text/html
    Content-Id: MESSAGETEXT
    <html><body>This is an Array sort Question. You will be given 10 random integers and you must sort and return them in the order of greatest to least.</body></html>
    ------=_Part_2_371807.1137465625031--
    ERROR:  'Content is not allowed in prolog.'
    17-Jan-2006 02:40:25 com.sun.xml.messaging.saaj.soap.EnvelopeFactory createEnvelope
    SEVERE: SAAJ0511: Unable to create envelope from given source
    com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to create envelope from given source:
         at com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFactory.java:111)
         at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.createEnvelopeFromSource(SOAPPart1_1Impl.java:39)
         at com.sun.xml.messaging.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:98)
         at com.zacwittedesign.xml.ProcessXML.realParse(ProcessXML.java:32)
         at com.zacwittedesign.xml.ProcessXML.parse(ProcessXML.java:26)
    (snip)And this is the beginning of the code for extracting the info from the SOAPMessage on the Client side:
    private static Message realParse(SOAPMessage msg){
              Message newMessage = new Message();
              try {
                   SOAPEnvelope envelope = msg.getSOAPPart().getEnvelope();
                   SOAPBody body = envelope.getBody();
    (snip)It dies on SOAPEnvelope envelope = msg.getSOAPPart().getEnvelope();
    Does anyone know what I'm doing wrong?

    I suppose I should also include the bit where the Servlet actually SENDs the resulting SOAPMessage
    SOAPMessage msg = ProcessXML.buildXML(outMessage);
    // try to send it
    try {
         response.setContentType("text/xml");
         msg.writeTo(response.getOutputStream());

  • Attached image is null

    <?xml version="1.0" encoding="UTF-8"?>
    <definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
         xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
         xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
         xmlns:soapbind="http://schemas.xmlsoap.org/wsdl/soap/"
         xmlns:tns="http://www.example.org/SOAPAttReceiverWithMessage/"
         xmlns:xsd="http://www.w3.org/2001/XMLSchema"
         targetNamespace="http://www.example.org/SOAPAttReceiverWithMessage/">
         <types>
              <xsd:schema
                   targetNamespace="http://www.example.org/SOAPAttReceiverWithMessage/"
                   xmlns:tns="http://www.example.org/SOAPAttReceiverWithMessage/"
                   xmlns:xsd="http://www.w3.org/2001/XMLSchema">
                   <xsd:element name="InfoMessage" type="xsd:string" />
              </xsd:schema>
         </types>
         <message name="imageMsg">
              <part element="tns:InfoMessage" name="body" />
              <part name="image" type="xsd:hexBinary" />
         </message>
         <message name="empty" />
         <portType name="AttachmentWithMessage">
              <operation name="sendImageAndMessage">
                   <input message="tns:imageMsg" />
                   <output message="tns:empty" />
              </operation>
         </portType>
         <binding name="AttachmentWithMessageBinding"
              type="tns:AttachmentWithMessage">
              <soap:binding style="rpc"
                   transport="http://schemas.xmlsoap.org/soap/http" />
              <operation name="sendImageAndMessage">
                   <soap:operation soapAction="" />
                   <input>
                        <soap:body parts="body" use="literal" />
                        <mime:multipartRelated>
                             <mime:part>
                                  <mime:content part="image" type="image/gif" />
                             </mime:part>
                        </mime:multipartRelated>
                   </input>
                   <output>
                        <soap:body use="literal" />
                   </output>
              </operation>
         </binding>
         <service name="AttachmentWithMessageService">
              <port binding="tns:AttachmentWithMessageBinding"
                   name="AttachmentWithMessage">
                   <soap:address
                        location="URL" />
              </port>
         </service>
    </definitions>Endpoint generated form WSDL
    public class AttachmentWithMessageBindingImpl implements org.example.www.AttachmentWithMessage{
        public void sendImageAndMessage(java.lang.String body, java.awt.Image image) throws java.rmi.RemoteException {}
             Client
      Name bodyName = soapFactory.createName(
                      "sendImageAndMessage", "tns",
                      "http://www.example.org/SOAPAttReceiverWithMessage/");
                    SOAPBodyElement bodyElement =
                      body.addBodyElement(bodyName);
                    Name name = soapFactory.createName("InfoMessage");
                    SOAPElement info =
                      bodyElement.addChildElement(name);
                    info.addTextNode("This is a info message!");
                    AttachmentPart attachment = message.createAttachmentPart();
                    URL url = new URL("file:///C:/temp/pic.gif");
                    URLDataSource fds = new URLDataSource(url);
                    DataHandler dataHandler = new DataHandler(fds);
                    AttachmentPart attachmentPart =
                      message.createAttachmentPart(dataHandler);
                    attachment.setContentId("image");
                    attachment.setContentType("image/gif");
                    message.addAttachmentPart(attachmentPart);
                    URL endpoint = new URL
                      ("URL");
                   // SOAPMessage response =
                      connection.call(message, endpoint);
                    connection.close();I get the body part right but image is null. SOAP message seems to have this image attached but when I try to access it at the enpoint it's null.
    SOAP message:
    ------=_Part_0_394663814.1176981061039
    Content-Type: text/xml; charset=UTF-8
    Content-Transfer-Encoding: binary
    Content-Id: <841848929844.1176981061039.***>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><tns:sendImageAndMessage xmlns:tns="http://www.example.org/SOAPAttReceiverWithMessage/"><InfoMessage>This is a info message!</InfoMessage></tns:sendImageAndMessage></soapenv:Body></soapenv:Envelope>
    ------=_Part_0_394663814.1176981061039
    Content-Type: image/gif
    Content-Transfer-Encoding: binary
    Content-Id: <83287838504.1176981059055.***>
    GIF89a�h�Any suggestions?

    try {
                   MessageContext context = MessageContext.getCurrentThreadsContext();
                   SOAPMessageContext soapContext = (SOAPMessageContext)context;
                   SOAPMessage msg = soapContext.getMessage();
                   SOAPPart soapPart =     msg.getSOAPPart();
                   SOAPEnvelope envelope = soapPart.getEnvelope();
                   Iterator i = msg.getAttachments();
                   while(i.hasNext())
                        System.out.println("Attachment");
                        AttachmentPart ap = (AttachmentPart)i.next();
                        System.out.println(ap.getContentId());
                        System.out.println(ap.getContentType());
                        System.out.println(ap.getContentLocation());
                        System.out.println(ap.getSize());
                        Object oo = ap.getContent();
                        if(oo==null){
                             System.out.println("oo is nul");
                        DataHandler dh = (DataHandler)ap.getDataHandler();
                        if(dh==null){
                             System.out.println("dh is null");
                        else{
                             Image o = (Image)dh.getContent();
                   }When I try to cast DataHandler.getContent() to java awt.Image I get following exception:
    com.ibm.ws.webservices.engine.attachments.ManagedMemoryDataSource$Instream incompatible with java.awt.Image
    [23.4.2007 16:37:05:862 EEST] 0000002e SystemErr     R java.lang.ClassCastException: com.ibm.ws.webservices.engine.attachments.ManagedMemoryDataSource$Instream incompatible with java.awt.Image
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at org.example.www.AttachmentWithMessageBindingImpl.sendImageAndMessage(AttachmentWithMessageBindingImpl.java:65)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at java.lang.reflect.Method.invoke(Method.java:615)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.ws.webservices.engine.dispatchers.java.JavaDispatcher.invokeMethod(JavaDispatcher.java:178)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.ws.webservices.engine.dispatchers.java.JavaDispatcher.invokeOperation(JavaDispatcher.java:141)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.ws.webservices.engine.dispatchers.SoapRPCProcessor.processRequestResponse(SoapRPCProcessor.java:447)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.ws.webservices.engine.dispatchers.SoapRPCProcessor.processMessage(SoapRPCProcessor.java:412)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.ws.webservices.engine.dispatchers.BasicDispatcher.processMessage(BasicDispatcher.java:134)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.ws.webservices.engine.dispatchers.java.SessionDispatcher.invoke(SessionDispatcher.java:204)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:227)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.ws.webservices.engine.handlers.jaxrpc.JAXRPCHandler.invoke(JAXRPCHandler.java:152)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.ws.webservices.engine.handlers.WrappedHandler.invoke(WrappedHandler.java:64)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:227)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:227)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.ws.webservices.engine.WebServicesEngine.invoke(WebServicesEngine.java:332)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.ws.webservices.engine.transport.http.WebServicesServlet.doPost(WebServicesServlet.java:736)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.ws.webservices.engine.transport.http.WebServicesServletBase.service(WebServicesServletBase.java:341)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3129)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:238)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:290)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741)
    [23.4.2007 16:37:05:893 EEST] 0000002e SystemErr     R      at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)
    [23.4.2007 16:37:05:909 EEST] 0000002e SystemErr     R      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)When sending I print size of the attachment
    Attachment size = 45233
    Size is same when receiving message at server but still it's null.

  • To avoid the attachment for the body content while sending email from ABAP

    SAP Version : 4.7
       When i tried to send an external email from the abap report program, the body content of the mail is coming as an attachment for the same. I need to avoid this. Please give the suggestion. Am attaching the code.
                        DECLARATION PART                                 *
    TYPE-POOLS : SLIS.
    TABLES : VBAK.
    DECLARATION FOR ALV.
    DATA : F_FIELD TYPE SLIS_T_FIELDCAT_ALV,
           W_FIELD TYPE SLIS_FIELDCAT_ALV,
           L_HEADER TYPE SLIS_T_LISTHEADER,
           W_HEADER TYPE SLIS_LISTHEADER,
           W_LAYOUT TYPE SLIS_LAYOUT_ALV,
           t_sort type slis_t_sortinfo_alv,
           w_sort type slis_sortinfo_alv.
    TYPES : BEGIN OF T_VBAK,
              VBELN    LIKE VBAK-VBELN,
              VKGRP    LIKE VBAK-VKGRP,
              KUNNR    LIKE VBAK-KUNNR,
              ERDAT    LIKE VBAK-ERDAT,
              VTWEG    LIKE VBAK-VTWEG,
              LIFSK    LIKE VBAK-LIFSK,
              VKBUR    LIKE VBAK-VKBUR,
            END OF T_VBAK.
    TYPES : BEGIN OF T_VBAP,
              VBELN    LIKE VBAP-VBELN,
              POSNR    LIKE VBAP-POSNR,
              MATNR    LIKE VBAP-MATNR,
              WERKS    LIKE VBAP-WERKS,
              ARKTX    LIKE VBAP-ARKTX,
              KWMENG   LIKE VBAP-KWMENG,
              CUOBJ    LIKE VBAP-CUOBJ,
              NETWR    LIKE VBAP-NETWR,
              ZSCHL_K  LIKE VBAP-ZSCHL_K,
              KONDM    LIKE VBAP-KONDM,
              ZZURWN   LIKE VBAP-ZZURWN,
            END OF T_VBAP.
    TYPES : BEGIN OF T_LIPS,
              VBELN    LIKE LIPS-VBELN,
              POSNR    LIKE LIPS-POSNR,
              VGBEL    LIKE LIPS-VGBEL,
              VGPOS    LIKE LIPS-VGPOS,
            END OF T_LIPS.
    TYPES : BEGIN OF T_KNA1,
              KUNNR    LIKE KNA1-KUNNR,
              NAME1    LIKE KNA1-NAME1,
              ADRNR    LIKE KNA1-ADRNR,
            END OF T_KNA1.
    TYPES : BEGIN OF T_VBKD,
              VBELN    LIKE VBKD-VBELN,
              POSNR    LIKE VBKD-POSNR,
              BSTKD    LIKE VBKD-BSTKD,
              BSTDK    LIKE VBKD-BSTDK,
              KURSK    LIKE VBKD-KURSK,          " CURRENCY CHECK
              BZIRK    LIKE VBKD-BZIRK,          " SALES DISTRICT
              KDGRP    LIKE VBKD-KDGRP,
              IHREZ    LIKE VBKD-IHREZ,
            END OF T_VBKD.
    TYPES : BEGIN OF T_LIKP,
              VBELN    LIKE LIKP-VBELN,
              ERDAT    LIKE LIKP-ERDAT,
            END OF T_LIKP.
    TYPES : BEGIN OF T_ADR6,
              ADDRNUMBER LIKE ADR6-ADDRNUMBER,
              SMTP_ADDR  LIKE ADR6-SMTP_ADDR,
            END OF T_ADR6.
    DATA  : BEGIN OF IT_CUST OCCURS 0,
              KUNNR LIKE VBAK-KUNNR,
            END OF IT_CUST.
    TYPES : BEGIN OF T_VBUP,
              VBELN    LIKE VBUP-VBELN,
              POSNR    LIKE VBUP-POSNR,
              KOSTA    LIKE VBUP-KOSTA,
              WBSTA    LIKE VBUP-WBSTA,
            END OF T_VBUP.
    TYPES : BEGIN OF T_TVLST,
              LIFSP    LIKE TVLST-LIFSP,
              VTEXT    LIKE TVLST-VTEXT,
            END OF T_TVLST.
    TYPES : BEGIN OF T_CONFIG.
            INCLUDE STRUCTURE CONF_OUT.
    TYPES : END OF T_CONFIG.
    DATA  : TMP LIKE VBAK-KUNNR.
    DATA  : NAME_TEXT LIKE THEAD-TDNAME.
    DATA  : TLINE1 LIKE TLINE OCCURS 0 WITH HEADER LINE.
    DATA  : TMP_BRAKET LIKE CONF_OUT-ATWRT,
            TMP_BRAKET1 LIKE CONF_OUT-ATWRT.
    DATA : BEGIN OF IT_FINAL OCCURS 0,
              WERKS   LIKE VBAP-WERKS,
              VBELN   LIKE VBAP-VBELN,
              POSNR   LIKE VBAP-POSNR,
              KUNNR   LIKE VBAK-KUNNR,
              NAME1   LIKE KNA1-NAME1,
              VBELN1  LIKE LIKP-VBELN,
              ERDAT   LIKE LIKP-ERDAT,
              LIFSK   LIKE VBAK-LIFSK,
              ZZURWN  LIKE VBAP-ZZURWN,
              IHREZ   LIKE VBKD-IHREZ,
              ERDAT1  LIKE VBAK-ERDAT,
              NETWR(25) type C,
              BSTKD   LIKE VBKD-BSTKD,
              BSTDK   LIKE VBKD-BSTDK,
              SALORD(17)  TYPE C,
              PUMP_TYPE LIKE CONF_OUT-ATWRT,
              PUMP_SIZE LIKE CONF_OUT-ATWRT,
              VTEXT     LIKE TVLST-VTEXT,
              KWMENG(25) TYPE C,
              FOOTER(330) TYPE C,
              ITMTXT(330) TYPE C,
           END OF IT_FINAL.
    DATA : IT_VBAK TYPE STANDARD TABLE OF T_VBAK,
           IT_VBAP TYPE STANDARD TABLE OF T_VBAP,
           IT_VBKD TYPE STANDARD TABLE OF T_VBKD,
           IT_LIKP TYPE STANDARD TABLE OF T_LIKP,
           IT_LIPS TYPE STANDARD TABLE OF T_LIPS,
           IT_VBUP TYPE STANDARD TABLE OF T_VBUP,
           IT_KNA1 TYPE STANDARD TABLE OF T_KNA1,
           IT_ADR6 TYPE STANDARD TABLE OF T_ADR6,
           IT_FINAL1 LIKE IT_FINAL OCCURS 0 with header line,
           IT_TVLST TYPE STANDARD TABLE OF T_TVLST,
           IT_CONFIG TYPE STANDARD TABLE OF T_CONFIG,
           W_VBAK TYPE T_VBAK,
           W_VBAP TYPE T_VBAP,
           W_VBKD TYPE T_VBKD,
           W_LIKP TYPE T_LIKP,
           W_ADR6 TYPE T_ADR6,
           W_LIPS TYPE T_LIPS,
           W_VBUP TYPE T_VBUP,
           W_KNA1 TYPE T_KNA1,
           W_TVLST TYPE T_TVLST,
           W_CONFIG TYPE T_CONFIG.
    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:   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,
            gd_error    TYPE sy-subrc,
            gd_reciever TYPE sy-subrc.
                        SELECTION-CRITERIA                               *
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETERS : R2 RADIOBUTTON GROUP G1 USER-COMMAND radio DEFAULT 'X',
                 R1 RADIOBUTTON GROUP G1 .
    selection-screen end of block b1.
    selection-screen begin of block b2 with frame title text-002.
    PARAMETERS:  p_email TYPE somlreci1-receiver
                                      DEFAULT '[email protected]'.
    PARAMETERS : P_VTWEG LIKE W_VBAK-VTWEG ,
                 P_WERKS LIKE W_VBAP-WERKS.
    select-options : s_vkgrp for w_vbak-vkgrp,
                     s_ERDAT for w_LIKP-ERDAT.
    selection-screen end of block b2.
                              Initialization
    INITIALIZATION.
      s_vkgrp-sign = 'I'.
      s_vkgrp-option = 'BT'.
      s_vkgrp-low = '313'.
      s_vkgrp-high = '324'.
      APPEND s_vkgrp.
      s_erdat-sign = 'I'.
      s_erdat-option = 'BT'.
      s_erdat-low = '20080108'.
      s_erdat-high = '20080108'.
    s_erdat-low = '20070101'.
    s_erdat-high = sy-datum.
      APPEND s_erdat.
                      selection-screen validations
    AT SELECTION-SCREEN.
      Validation for Plant.
      IF p_werks NE '7210'.
        MESSAGE : 'Plant entered should be 7210' TYPE 'E'.
      ENDIF.
                   START OF SELECTION                                    *
    start-of-selection.
    GETTING THE DATA FROM THE DATABASE TABLE
      PERFORM DATA_FETCH.
    FILLING THE FINAL INTERNAL TABLE
      PERFORM FILL_FINAL.
    GETTING THE LIST FOR SENDING MAIL OR DISPLAY.
    IF R1 = 'X'.
      Populate table with details to be entered into .xls file
      LOOP AT IT_CUST.
        PERFORM build_xls_data_table using it_cust-kunnr.
      ENDLOOP.
      Instructs mail send program for SAPCONNECT to send email(rsconn01)
        PERFORM initiate_mail_execute_program.
    ELSEIF R2 = 'X'.
      PERFORM LIST_DISPLAY.
    ENDIF.
                   END OF SELECTION                                      *
    end-of-selection.
    *&      Form  DATA_FETCH
          text
    -->  p1        text
    <--  p2        text
    FORM DATA_FETCH .
       SELECT VBELN
              VKGRP
              KUNNR
              ERDAT
              VTWEG
              LIFSK
              VKBUR
       INTO TABLE IT_VBAK
       FROM VBAK
       WHERE VTWEG = P_VTWEG
       AND   VKGRP IN S_VKGRP
       AND   LIFSK NE ''.
    IF IT_VBAK[] IS NOT INITIAL.
      SELECT  LIFSP
              VTEXT
      INTO TABLE IT_TVLST
      FROM TVLST
      FOR ALL ENTRIES IN IT_VBAK
      WHERE  LIFSP = IT_VBAK-LIFSK
      AND    SPRAS = 'EN'.
      SELECT  VBELN
              POSNR
              MATNR
              WERKS
              ARKTX
              KWMENG
              CUOBJ
              NETWR
              ZSCHL_K
              KONDM
              ZZURWN
      INTO TABLE IT_VBAP
      FROM VBAP
      FOR ALL ENTRIES IN IT_VBAK
      WHERE VBELN = IT_VBAK-VBELN
      AND   WERKS = P_WERKS.
      SELECT KUNNR
             NAME1
             ADRNR
      INTO TABLE IT_KNA1
      FROM KNA1
      FOR ALL ENTRIES IN IT_VBAK
      WHERE   KUNNR = IT_VBAK-KUNNR.
      SELECT  VBELN
              POSNR
              BSTKD
              BSTDK
              KURSK
              BZIRK
              KDGRP
      INTO TABLE IT_VBKD
      FROM VBKD
      FOR ALL ENTRIES IN IT_VBAK
      WHERE VBELN = IT_VBAK-VBELN.
    ENDIF.
    IF IT_VBAP[] IS NOT INITIAL.
      SELECT VBELN
             POSNR
             VGBEL
             VGPOS
      INTO TABLE IT_LIPS
      FROM LIPS
      FOR ALL ENTRIES IN IT_VBAP
      WHERE VGBEL = IT_VBAP-VBELN
      AND   VGPOS = IT_VBAP-POSNR.
    ENDIF.
    IF IT_LIPS[] IS NOT INITIAL.
      SELECT VBELN
             ERDAT
      INTO TABLE IT_LIKP
      FROM LIKP
      FOR ALL ENTRIES IN IT_LIPS
      WHERE VBELN = IT_LIPS-VBELN
      AND   ERDAT IN S_ERDAT.
      SELECT VBELN
             POSNR
             KOSTA
             WBSTA
      INTO TABLE IT_VBUP
      FROM VBUP
      FOR ALL ENTRIES IN IT_LIPS
      WHERE VBELN = IT_LIPS-VBELN
      AND   POSNR = IT_LIPS-POSNR
      AND   KOSTA EQ 'C'
      AND   WBSTA NE 'C'.
    ENDIF.
    IF IT_KNA1[] IS NOT INITIAL.
      SELECT ADDRNUMBER
             SMTP_ADDR
      INTO TABLE IT_ADR6
      FROM ADR6
      FOR ALL ENTRIES IN IT_KNA1
      WHERE ADDRNUMBER = IT_KNA1-ADRNR.
    ENDIF.
    ENDFORM.                    " DATA_FETCH
    *&      Form  LIST_DISPLAY
          text
    -->  p1        text
    <--  p2        text
    FORM LIST_DISPLAY .
    REFRESH F_FIELD.
      IF R2 = 'X'.
        W_FIELD-col_pos = 1.
        W_FIELD-fieldname = 'WERKS'.
        W_FIELD-tabname = 'IT_FINAL'.
        W_FIELD-emphasize = 'C410'.
        W_FIELD-seltext_m = 'Plant'.
        APPEND W_FIELD TO F_FIELD.
        CLEAR W_FIELD.
        W_FIELD-col_pos = 2.
        W_FIELD-fieldname = 'VBELN'.
        W_FIELD-tabname = 'IT_FINAL'.
        W_FIELD-emphasize = 'C410'.
        W_FIELD-seltext_m = 'Sales Order'.
        APPEND W_FIELD TO F_FIELD.
        CLEAR W_FIELD.
        W_FIELD-col_pos = 3.
        W_FIELD-fieldname = 'KUNNR'.
        W_FIELD-tabname = 'IT_FINAL'.
        W_FIELD-emphasize = 'C410'.
        W_FIELD-seltext_m = 'Customer Code'.
        APPEND W_FIELD TO F_FIELD.
        CLEAR W_FIELD.
        W_FIELD-col_pos = 4.
        W_FIELD-fieldname = 'NAME1'.
        W_FIELD-tabname = 'IT_FINAL'.
        W_FIELD-emphasize = 'C410'.
        W_FIELD-seltext_m = 'Customer Name'.
        APPEND W_FIELD TO F_FIELD.
        CLEAR W_FIELD.
        W_FIELD-col_pos = 5.
        W_FIELD-fieldname =  'VBELN1'.
        W_FIELD-tabname = 'IT_FINAL'.
        W_FIELD-emphasize = 'C410'.
        W_FIELD-seltext_m = 'Delivery Number'.
        APPEND W_FIELD TO F_FIELD.
        CLEAR W_FIELD.
        W_FIELD-col_pos = 6.
        W_FIELD-fieldname = 'ERDAT'.
        W_FIELD-tabname = 'IT_FINAL'.
        W_FIELD-emphasize = 'C410'.
        W_FIELD-seltext_m = 'Delivery Date'.
        APPEND W_FIELD TO F_FIELD.
        CLEAR W_FIELD.
        W_FIELD-col_pos = 7.
        W_FIELD-fieldname = 'LIFSK'.
        W_FIELD-tabname = 'IT_FINAL'.
        W_FIELD-emphasize = 'C410'.
        W_FIELD-seltext_m = 'Delivery Block'.
        APPEND W_FIELD TO F_FIELD.
        CLEAR W_FIELD.
        W_FIELD-col_pos = 8.
        W_FIELD-fieldname = 'PUMP_TYPE'.
        W_FIELD-tabname = 'IT_FINAL'.
        W_FIELD-emphasize = 'C410'.
        W_FIELD-seltext_m = 'Pump Type'.
        APPEND W_FIELD TO F_FIELD.
        CLEAR W_FIELD.
        W_FIELD-col_pos = 9.
        W_FIELD-fieldname = 'PUMP_SIZE'.
        W_FIELD-tabname = 'IT_FINAL'.
        W_FIELD-emphasize = 'C410'.
        W_FIELD-seltext_l = 'Pump Size'.
        APPEND W_FIELD TO F_FIELD.
        CLEAR W_FIELD.
        W_FIELD-col_pos = 10.
        W_FIELD-fieldname = 'ZZURWN'.
        W_FIELD-tabname = 'IT_FINAL'.
        W_FIELD-emphasize = 'C410'.
        W_FIELD-seltext_m = 'Pump Srno'.
        APPEND W_FIELD TO F_FIELD.
        CLEAR W_FIELD.
        W_FIELD-col_pos = 11.
        W_FIELD-fieldname = 'IHREZ'.
        W_FIELD-tabname = 'IT_FINAL'.
        W_FIELD-emphasize = 'C410'.
        W_FIELD-seltext_m = 'Indent No.'.
        APPEND W_FIELD TO F_FIELD.
        CLEAR W_FIELD.
        W_FIELD-col_pos = 12.
        W_FIELD-fieldname = 'ERDAT'.
        W_FIELD-tabname = 'IT_FINAL'.
        W_FIELD-emphasize = 'C410'.
        W_FIELD-seltext_m = 'Order Booking Dt'.
        APPEND W_FIELD TO F_FIELD.
        CLEAR W_FIELD.
        W_FIELD-col_pos = 13.
        W_FIELD-fieldname = 'NETWR'.
        W_FIELD-tabname = 'IT_FINAL'.
        W_FIELD-emphasize = 'C710'.
        W_FIELD-seltext_m = 'Net Value'.
        w_field-do_sum = 'X'.
        APPEND W_FIELD TO F_FIELD.
        CLEAR W_FIELD.
        W_FIELD-col_pos = 14.
        W_FIELD-fieldname = 'KWMENG'.
        W_FIELD-tabname = 'IT_FINAL'.
        W_FIELD-emphasize = 'C710'.
        W_FIELD-seltext_m = 'Qty'.
        w_field-do_sum = 'X'.
        APPEND W_FIELD TO F_FIELD.
        CLEAR W_FIELD.
        W_FIELD-col_pos = 15.
        W_FIELD-fieldname = 'BSTKD'.
        W_FIELD-tabname = 'IT_FINAL'.
        W_FIELD-emphasize = 'C410'.
        W_FIELD-seltext_m = 'Customer PONO'.
        APPEND W_FIELD TO F_FIELD.
        CLEAR W_FIELD.
        W_FIELD-col_pos = 16.
        W_FIELD-fieldname = 'BSTDK'.
        W_FIELD-tabname = 'IT_FINAL'.
        W_FIELD-emphasize = 'C410'.
        W_FIELD-seltext_m = 'Customer PODT'.
        APPEND W_FIELD TO F_FIELD.
        CLEAR W_FIELD.
        W_FIELD-col_pos = 17.
        W_FIELD-fieldname = 'SALORD'.
        W_FIELD-tabname = 'IT_FINAL'.
        W_FIELD-emphasize = 'C410'.
        W_FIELD-seltext_m = 'Sales Order/Item'.
        APPEND W_FIELD TO F_FIELD.
        CLEAR W_FIELD.
        W_FIELD-col_pos = 18.
        W_FIELD-fieldname = 'VTEXT'.
        W_FIELD-tabname = 'IT_FINAL'.
        W_FIELD-emphasize = 'C410'.
        W_FIELD-seltext_m = 'Delivery Block Desc.'.
        APPEND W_FIELD TO F_FIELD.
        CLEAR W_FIELD.
        W_FIELD-col_pos = 19.
        W_FIELD-fieldname = 'FOOTER'.
        W_FIELD-tabname = 'IT_FINAL'.
        W_FIELD-emphasize = 'C410'.
        W_FIELD-seltext_m = 'Footer Text'.
        APPEND W_FIELD TO F_FIELD.
        CLEAR W_FIELD.
        W_FIELD-col_pos = 20.
        W_FIELD-fieldname = 'ITMTXT'.
        W_FIELD-tabname = 'IT_FINAL'.
        W_FIELD-emphasize = 'C410'.
        W_FIELD-seltext_m = 'Item Text'.
        APPEND W_FIELD TO F_FIELD.
        CLEAR W_FIELD.
        PERFORM SORT_FIELD.
        PERFORM LAYOUT_DISPLAY.
        PERFORM GRID_DISPLAY.
      ENDIF.
    ENDFORM.                    " LIST_DISPLAY
    *&      Form  FILL_FINAL
          text
    -->  p1        text
    <--  p2        text
    FORM FILL_FINAL .
    REFRESH IT_FINAL.
    LOOP AT IT_VBUP INTO W_VBUP.
        READ TABLE IT_LIPS INTO W_LIPS WITH KEY VBELN = W_VBUP-VBELN POSNR = W_VBUP-POSNR.
        READ TABLE IT_LIKP INTO W_LIKP WITH KEY VBELN = W_LIPS-VBELN.
        IF SY-SUBRC EQ 0.
        READ TABLE IT_VBAP INTO W_VBAP WITH KEY VBELN = W_LIPS-VGBEL POSNR = W_LIPS-VGPOS.
        READ TABLE IT_VBAK INTO W_VBAK WITH KEY VBELN = W_VBAP-VBELN.
        READ TABLE IT_VBKD INTO W_VBKD WITH KEY VBELN = W_VBAK-VBELN.
        READ TABLE IT_KNA1 INTO W_KNA1 WITH KEY KUNNR = W_VBAK-KUNNR.
        READ TABLE IT_TVLST INTO W_TVLST WITH KEY LIFSP = W_VBAK-LIFSK.
          IT_FINAL-WERKS   = W_VBAP-WERKS.
          IT_FINAL-VBELN   = W_VBAP-VBELN.
          IT_FINAL-KUNNR   = W_VBAK-KUNNR.
          IT_FINAL-NAME1   = W_KNA1-NAME1.
          IT_FINAL-VBELN1  = W_LIKP-VBELN.
          IT_FINAL-ERDAT   = W_LIKP-ERDAT.
          IT_FINAL-LIFSK   = W_VBAK-LIFSK.
          IT_FINAL-ZZURWN  = W_VBAP-ZZURWN.
          IT_FINAL-IHREZ   = W_VBKD-IHREZ.
          IT_FINAL-ERDAT1  = W_VBAK-ERDAT.
          IT_FINAL-NETWR   = W_VBAP-NETWR.
          IT_FINAL-BSTKD   = W_VBKD-BSTKD.
          IT_FINAL-BSTDK   = W_VBKD-BSTDK.
          IT_FINAL-POSNR   = W_VBAP-POSNR.
          IT_FINAL-VTEXT   = W_TVLST-VTEXT.
          IT_FINAL-KWMENG  = W_VBAP-KWMENG.
          CONCATENATE W_VBAP-VBELN W_VBAP-POSNR INTO IT_FINAL-SALORD SEPARATED BY '/'.
          IF W_VBAP-CUOBJ NE '000000000000000000'.
            REFRESH IT_CONFIG.
              CALL FUNCTION 'VC_I_GET_CONFIGURATION'
                EXPORTING
                  INSTANCE            = W_VBAP-CUOBJ
                  LANGUAGE            = SY-LANGU
                TABLES
                  CONFIGURATION       = IT_CONFIG
                EXCEPTIONS
                  INSTANCE_NOT_FOUND  = 1
                  INTERNAL_ERROR      = 2
                  NO_CLASS_ALLOCATION = 3
                  INSTANCE_NOT_VALID  = 4
                  OTHERS              = 5.
              IF SY-SUBRC = 0.
                READ TABLE IT_CONFIG INTO W_CONFIG WITH KEY ATNAM = 'IN_PUMP_TYPE'.
                IT_FINAL-PUMP_TYPE = W_CONFIG-ATWRT.
                CLEAR W_CONFIG.
                READ TABLE IT_CONFIG INTO W_CONFIG WITH KEY ATNAM = 'IN_PUMP_SIZE' .
                IT_FINAL-PUMP_SIZE = W_CONFIG-ATWRT.
                CLEAR W_CONFIG.
              ENDIF.
          ENDIF.
            move w_vbap-vbeln to name_text.
            CALL FUNCTION 'READ_TEXT'
              EXPORTING
                id       = 'ZKT1'
                language = 'E'
                name     = name_text
                object   = 'VBBK'
              TABLES
                lines    = tline1
              EXCEPTIONS
                OTHERS   = 8.
          LOOP AT TLINE1.
            CONCATENATE IT_FINAL-FOOTER TLINE1-TDLINE+0(65) INTO IT_FINAL-FOOTER.
            CLEAR : TLINE1.
          ENDLOOP.
          clear : name_text,tline1[].
          concatenate w_vbap-vbeln w_vbap-posnr into name_text.
            CALL FUNCTION 'READ_TEXT'
              EXPORTING
                id       = 'ZKT3'
                language = 'E'
                name     = name_text
                object   = 'VBBP'
              TABLES
                lines    = tline1
              EXCEPTIONS
                OTHERS   = 8.
          LOOP AT TLINE1.
            CONCATENATE IT_FINAL-ITMTXT TLINE1-TDLINE+0(65) INTO IT_FINAL-ITMTXT.
            CLEAR : TLINE1.
          ENDLOOP.
          APPEND IT_FINAL.
        ENDIF.
       CLEAR : IT_FINAL,W_VBAP,W_VBKD,W_VBUP,W_LIPS,W_LIKP,W_KNA1,W_VBAK,W_TVLST,name_text,tline1[].
    ENDLOOP.
    IT_FINAL1[] = IT_FINAL[].
    SORT IT_FINAL1 BY KUNNR.
    LOOP AT IT_FINAL1.
      IF TMP NE IT_FINAL1-KUNNR.
       IT_CUST-KUNNR = IT_FINAL1-KUNNR.
       APPEND IT_CUST.
       clear : tmp,it_cust.
       TMP = IT_FINAL1-KUNNR.
      ENDIF.
      CLEAR : IT_FINAL1.
    ENDLOOP.
    ENDFORM.                    " FILL_FINAL
    *&      Form  LAYOUT_DISPLAY
          text
    -->  p1        text
    <--  p2        text
    FORM LAYOUT_DISPLAY .
      W_LAYOUT-colwidth_optimize = 'X'.
    ENDFORM.                    " LAYOUT_DISPLAY
    *&      Form  GRID_DISPLAY
          text
    -->  p1        text
    <--  p2        text
    FORM GRID_DISPLAY .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
         EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
           I_CALLBACK_PROGRAM                = SY-REPID
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
           I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
         IS_LAYOUT                         = W_LAYOUT
         IT_FIELDCAT                       = F_FIELD
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
         IT_SORT                           = T_SORT
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =
      IT_EVENTS                         =
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      I_HTML_HEIGHT_TOP                 =
      I_HTML_HEIGHT_END                 =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
          TABLES
            T_OUTTAB                          = IT_FINAL
    EXCEPTIONS
      PROGRAM_ERROR                     = 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.
    ENDFORM.                    " GRID_DISPLAY
    *&      Form  SORT_FIELD
          text
    -->  p1        text
    <--  p2        text
    FORM SORT_FIELD .
      w_sort-spos = 1.
      w_sort-fieldname = 'KUNNR'.
      w_sort-up = 'X'.
      append w_sort to t_sort.
      clear w_sort.
      w_sort-spos = 2.
      w_sort-fieldname = 'VBELN'.
      w_sort-up = 'X'.
      append w_sort to t_sort.
      clear w_sort.
    ENDFORM.                    " SORT_FIELD
    *&      Form  TOP_OF_PAGE
          text
    FORM top_of_page.
      IF R2 = 'X'.
        REFRESH l_header.
        w_header-typ = 'S'.
        w_header-key = 'Delivery Block : '.
        w_header-info = 'Outbound delivery created but not despatched'.
        APPEND w_header TO l_header.
        CLEAR w_header.
        CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
          EXPORTING
            it_list_commentary = l_header.
      ENDIF.
    ENDFORM.                    "TOP_OF_PAGE
    *&      Form  BUILD_XLS_DATA_TABLE
          Build data table for .xls document
    FORM build_xls_data_table using custcode.
    CONSTANTS: con_cret TYPE X VALUE '0D',  "OK for non Unicode
                con_tab TYPE x VALUE '09'.   "OK for non Unicode
    data : it_custcode like vbak-kunnr.
    *If you have Unicode check active in program attributes thnen you will
    *need to declare constants as follows
    *class cl_abap_char_utilities definition load.
    constants:
        con_tab  type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
        con_cret type c value cl_abap_char_utilities=>CR_LF.
    clear : it_attach,it_attach[].
      CONCATENATE 'Customer PONO' 'Customer PODT' 'Sales Order No' 'Item No'
                  'Pump Type' 'Pump Size' 'Order Value Rs' 'Delivery No.' 'Delivery Dt.'
                  'Quantity' 'Reasons for not getting Despatch'
              INTO it_attach SEPARATED BY con_tab.
      CONCATENATE con_cret it_attach  INTO it_attach.
      APPEND  it_attach.
      it_custcode = custcode.
    CLEAR : W_KNA1,W_ADR6.                                             "Code need to be added once testing is over.
    READ TABLE IT_KNA1 INTO W_KNA1 WITH KEY KUNNR = IT_CUSTCODE.
    READ TABLE IT_ADR6 INTO W_ADR6 WITH KEY ADDRNUMBER = W_KNA1-ADRNR.
    P_EMAIL = W_ADR6-SMTP_ADDR.
      LOOP AT it_final where kunnr = it_custcode.
        CONCATENATE
                    IT_FINAL-BSTKD
                    IT_FINAL-BSTDK
                    IT_FINAL-VBELN
                    IT_FINAL-POSNR
                    IT_FINAL-PUMP_TYPE
                    IT_FINAL-PUMP_SIZE
                    IT_FINAL-NETWR
                    IT_FINAL-VBELN1
                    IT_FINAL-ERDAT
                    IT_FINAL-KWMENG
                    IT_FINAL-VTEXT
        INTO it_attach SEPARATED BY con_tab.
        CONCATENATE con_cret it_attach  INTO it_attach.
        APPEND  it_attach.
        clear it_final.
      ENDLOOP.
      if R1 = 'X'.
    Populate message body text
      perform populate_email_message_body.
    Send file by email as .xls speadsheet
      PERFORM send_file_as_email_attachment
                                   tables it_message
                                          it_attach
                                    using p_email
                                          'AWAITING DESPATCH CLEARANCE'
                                          'XLS'
                                          'Delivery_Block'
                                          'Delivery_Blk'
                                          '[email protected]'
                                          'INT'
                                 changing gd_error
                                          gd_reciever.
      endif.
    ENDFORM.                    " BUILD_XLS_DATA_TABLE
    *&      Form  SEND_FILE_AS_EMAIL_ATTACHMENT
          Send email
    FORM send_file_as_email_attachment tables pit_message
                                              pit_attach
                                        using p_email
                                              p_mtitle
                                              p_format
                                              p_filename
                                              p_attdescription
                                              p_sender_address
                                              p_sender_addres_type
                                     changing p_error
                                              p_reciever.
      DATA: objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
      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.
      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,w_cnt.
      DESCRIBE TABLE it_attach LINES w_cnt.
    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.
      t_attachment[] = pit_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.
      t_receivers-receiver = ld_email.
      t_receivers-rec_type = 'U'.
      t_receivers-com_type = 'INT'.
      t_receivers-notif_del = 'X'.
      t_receivers-notif_ndel = 'X'.
      APPEND t_receivers.
      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
                object_header              = objhead
                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.
    *&      Form  INITIATE_MAIL_EXECUTE_PROGRAM
          Instructs mail send program for SAPCONNECT to send email.
    FORM initiate_mail_execute_program.
      WAIT UP TO 2 SECONDS.
      SUBMIT rsconn01 WITH mode = 'INT'
                    WITH output = 'X'
                    AND RETURN.
    ENDFORM.                    " INITIATE_MAIL_EXECUTE_PROGRAM
    *&      Form  POPULATE_EMAIL_MESSAGE_BODY
           Populate message body text
    form populate_email_message_body.
      REFRESH it_message.
      it_message = 'We have manufactured the pump/s against your purchase order and regret to inform'.
      APPEND it_message.
      it_message = 'you that same cannot be despatched for the reason/s indicated below.'.
      APPEND it_message.
      it_message = ' '.
      APPEND it_message.
      it_message = 'Please find the below attachment "Delivery_Blk.xls" for the details.'.
      APPEND it_message.
      it_message = ' '.
      APPEND it_message.
      it_message = 'We now request you to send the required detail/s by return mail/post to enable us '.
      APPEND it_message.
      it_message = 'to despatch the pump/s at the earliest.'.
      APPEND it_message.
      it_message = ' '.
      APPEND it_message.
      it_message = ' '.
      APPEND it_message.
      it_message = 'Best Regards'.
      APPEND it_message.
      it_message = 'O.E. ENGINEER'.
      APPEND it_message.
    endform.                    " POPULATE_EMAIL_MESSAGE_BODY

    Hi,
    Refer to the following piece of code. This is the simple code to send email with content and attachment.
    Declaration
      DATA:    lwa_hd_change TYPE sood1,
               lt_objcont    TYPE STANDARD TABLE OF soli,
               lwa_objcont   TYPE soli,
               lt_receivers  TYPE STANDARD TABLE OF soos1,
               lwa_receivers TYPE soos1 ,
               lt_att_cont   TYPE STANDARD TABLE OF soli,
               lwa_att_cont  TYPE soli,
               lt_packing    TYPE STANDARD TABLE OF soxpl,
               lwa_packing   TYPE soxpl,
               lf_sent       TYPE sonv-flag,
               lf_size       TYPE i.
      CONSTANTS: lc_obj(11)  TYPE c VALUE 'BOMSouthco',
                 lc_desc(20) TYPE c VALUE 'BOM Download',
                 lc_lang(1)  TYPE c VALUE 'E',
                 lc_raw(3)   TYPE c VALUE 'RAW',
                 lc_net(1)   TYPE c VALUE 'U',
                 lc_mail(4)  TYPE c VALUE 'MAIL',
                 lc_xls(3)   TYPE c VALUE 'XLS',
                 lc_ext(3)   TYPE c VALUE 'EXT'.
    Passing values to the strutures used in SO_OBJECT_SEND function module
      lwa_hd_change-objla      = lc_lang.
      lwa_hd_change-objnam     = lc_obj.
      lwa_hd_change-objdes     = lc_desc.
      lwa_hd_change-objlen     = 255.
      lwa_objcont-line = text-t29.
      APPEND lwa_objcont TO lt_objcont.
      CLEAR lwa_objcont.
      lwa_receivers-recextnam  = text-t31.
      lwa_receivers-recesc     = lc_net.
      lwa_receivers-sndart     = lc_mail.
      lwa_receivers-sndex      = 'X'.
      lwa_receivers-sndpri     = 1.
      lwa_receivers-mailstatus = 'E'.
      APPEND lwa_receivers TO lt_receivers.
      CLEAR lwa_receivers.
      lwa_receivers-recextnam  = text-t30.
      lwa_receivers-recesc     = lc_net.
      lwa_receivers-sndart     = lc_mail.
      lwa_receivers-sndex      = 'X'.
      lwa_receivers-sndpri     = 1.
      lwa_receivers-mailstatus = 'E'.
      APPEND lwa_receivers TO lt_receivers.
      CLEAR lwa_receivers.
    Passing values for the attachment file
      LOOP AT gt_output INTO gwa_output.
        CONCATENATE gf_lf  gwa_output-matnr  gf_etb  gwa_output-idnrk  gf_etb
                    gwa_output-type   gf_etb  gwa_output-menge   gf_etb
                    gwa_output-meins  gf_etb  gwa_output-comp    gf_etb
          INTO lwa_att_cont-line.
        APPEND lwa_att_cont TO lt_att_cont.
        CLEAR lwa_att_cont.
      ENDLOOP.
      CHECK lt_att_cont IS NOT INITIAL.
      DESCRIBE TABLE lt_att_cont LINES lf_size.
      lwa_packing-transf_bin = ' '.
      lwa_packing-head_start = 1.
      lwa_packing-head_num   = 0.
      lwa_packing-body_start = 1.
      lwa_packing-body_num   = lf_size.
      lwa_packing-file_ext   = lc_xls.
      lwa_packing-objlen     = lf_size * 255.
      lwa_packing-objtp      = lc_ext.
      lwa_packing-objdes     = lc_desc.
      lwa_packing-objnam     = lc_obj.
      APPEND lwa_packing TO lt_packing.
      CLEAR lwa_packing.
      CHECK gf_error IS NOT INITIAL. "Check if unix file is written
    FM to send email to the intended recipients
      CALL FUNCTION 'SO_OBJECT_SEND'
        EXPORTING
          object_hd_change           = lwa_hd_change
          object_type                = lc_raw
        IMPORTING
          sent_to_all                = lf_sent
        TABLES
          objcont                    = lt_objcont
          receivers                  = lt_receivers
          packing_list               = lt_packing
          att_cont                   = lt_att_cont
        EXCEPTIONS
          active_user_not_exist      = 1
          communication_failure      = 2
          component_not_available    = 3
          folder_not_exist           = 4
          folder_no_authorization    = 5
          forwarder_not_exist        = 6
          note_not_exist             = 7
          object_not_exist           = 8
          object_not_sent            = 9
          object_no_authorization    = 10
          object_type_not_exist      = 11
          operation_no_authorization = 12
          owner_not_exist            = 13
          parameter_error            = 14
          substitute_not_active      = 15
          substitute_not_defined     = 16
          system_failure             = 17
          too_much_receivers         = 18
          user_not_exist             = 19
          originator_not_exist       = 20
          x_error                    = 21
          OTHERS                     = 22.
      IF sy-subrc = 0.
        MESSAGE s004 WITH text-t34.
      ENDIF.
      COMMIT WORK.
    Reward if helpful.
    Regards,
    Ramya

  • Problem in sending attachment using "SO_NEW_DOCUMENT_ATT_SEND_API1"

    Hi All,
    I have a requirement of sending the data available in an internal table via email. I need to populate this content into excel sheet and send it as an attachment to recipients. I am using the following code for that.
    REPORT  z51515t_doc_att.
    DATA: objpack   LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
    DATA: objhead   LIKE solisti1 OCCURS 1 WITH HEADER LINE.
    DATA: objbin    LIKE solisti1 OCCURS 10 WITH HEADER LINE.
    DATA: objtxt    LIKE solisti1 OCCURS 10 WITH HEADER LINE.
    DATA: reclist   LIKE somlreci1 OCCURS 5 WITH HEADER LINE.
    DATA: doc_chng  LIKE sodocchgi1.
    DATA: tab_lines LIKE sy-tabix.
    DATA : BEGIN OF itab OCCURS 0,
              pernr LIKE p0001-pernr,
              name LIKE p0002-vorna,
           END OF itab.
    Creation of the document to be sent
    File Name
    doc_chng-obj_name = 'SENDFILE'.
    Mail Subject
    doc_chng-obj_descr = 'Delivered Mail'.
    Mail Contents
    objtxt = 'My Content 1 '.
    APPEND objtxt.
    objtxt = 'My Content2'.
    APPEND objtxt.
    DESCRIBE TABLE objtxt LINES tab_lines.
    Creation of the entry for the document
    CLEAR objpack-transf_bin. "Will get content from content_text
    objpack-head_start = 1. "Reads given row number in object header
    objpack-head_num = 0.
    objpack-body_start = 1.
    objpack-body_num = tab_lines.
    objpack-doc_type = 'RAW'.
    APPEND objpack.
    Prepare content for attachment
    DO 3 TIMES.
      itab-pernr = 182.
      itab-name = 'Prasath'.
      APPEND itab.
      itab-pernr = 1000.
      itab-name = 'Praveen'.
      APPEND itab.
    ENDDO.
    Populate attachment content
    LOOP AT itab.
      CONCATENATE itab-pernr itab-name INTO objbin-line.
      APPEND objbin.
    ENDLOOP.
    DESCRIBE TABLE objbin LINES tab_lines.
    Creation of the entry for the compressed attachment
    objpack-transf_bin = 'X'. "Will get content from content_bin
    objpack-head_start = 1.
    objpack-head_num   = 1.
    objpack-body_start = 1.
    objpack-body_num   = tab_lines.
    objpack-doc_type   = 'EXT'.
    objpack-obj_name   = 'WEBSITE'.
    objpack-obj_descr  = 'MyFile.XLS'.
    objpack-doc_size   = tab_lines * 255.
    APPEND objpack.
    target recipent
    CLEAR reclist.
    reclist-receiver = '[email protected]'.
    reclist-express  = 'X'.
    reclist-rec_type = 'U'.
    APPEND reclist.
    copy recipents
    CLEAR reclist.
    reclist-receiver = '[email protected]'.
    reclist-express  = 'X'.
    reclist-rec_type = 'U'.
    reclist-copy     = 'X'.
    APPEND reclist.
    Sending the document
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
      EXPORTING
        document_data              = doc_chng
        put_in_outbox              = 'X'
        commit_work                = 'X'
      TABLES
        packing_list               = objpack
        object_header              = objhead
        contents_bin               = objbin
        contents_txt               = objtxt
        receivers                  = reclist
      EXCEPTIONS
        too_many_receivers         = 1
        document_not_sent          = 2
        operation_no_authorization = 4
        OTHERS                     = 99.
    Now using this code i am able to send out the file but the data in the XL file is not aligned properly. When i open the attachment that i receive the contents of itab appear inside the same cell - A1 of the XL sheet. I want the data to be available in different rows and columns. How do i achieve this?
    Thanks,
    Prasath N

    See the below program it was sending the file   as  attach in XLS  format   by  column and rows  are  properly placed ...  see the
    <b>Code  in my program  :
    CONSTANTS: con_cret TYPE x VALUE '0D',  "OK for non Unicode
                 con_tab TYPE x VALUE '09'.   "OK for non Unicode</b>
    REPORT  ZEMAIL_ATTACH                   .
    TABLES: ekko.
    PARAMETERS: p_email   TYPE somlreci1-receiver
                                      DEFAULT '[email protected]'.
    TYPES: BEGIN OF t_ekpo,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
    END OF t_ekpo.
    DATA: it_ekpo TYPE STANDARD TABLE OF t_ekpo INITIAL SIZE 0,
          wa_ekpo TYPE t_ekpo.
    TYPES: BEGIN OF t_charekpo,
      ebeln(10) TYPE c,
      ebelp(5)  TYPE c,
      aedat(8)  TYPE c,
      matnr(18) TYPE c,
    END OF t_charekpo.
    DATA: wa_charekpo TYPE t_charekpo.
    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:   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,
            gd_error    TYPE sy-subrc,
            gd_reciever TYPE sy-subrc.
    *START_OF_SELECTION
    START-OF-SELECTION.
    *   Retrieve sample data from table ekpo
      PERFORM data_retrieval.
    *   Populate table with detaisl to be entered into .xls file
      PERFORM build_xls_data_table.
    *END-OF-SELECTION
    END-OF-SELECTION.
    * Populate message body text
      perform populate_email_message_body.
    * Send file by email as .xls speadsheet
      PERFORM send_file_as_email_attachment
                                   tables it_message
                                          it_attach
                                    using p_email
                                          'Example .xls documnet attachment'
                                          'XLS'
                                          'filename'
                                 changing gd_error
                                          gd_reciever.
    *   Instructs mail send program for SAPCONNECT to send email(rsconn01)
      PERFORM initiate_mail_execute_program.
    *&      Form  DATA_RETRIEVAL
    *       Retrieve data form EKPO table and populate itab it_ekko
    FORM data_retrieval.
      SELECT ebeln ebelp aedat matnr
       UP TO 10 ROWS
        FROM ekpo
        INTO TABLE it_ekpo.
    ENDFORM.                    " DATA_RETRIEVAL
    *&      Form  BUILD_XLS_DATA_TABLE
    *       Build data table for .xls document
    FORM build_xls_data_table.
      CONSTANTS: con_cret TYPE x VALUE '0D',  "OK for non Unicode
                 con_tab TYPE x VALUE '09'.   "OK for non Unicode
    *If you have Unicode check active in program attributes thnen you will
    *need to declare constants as follows
    *class cl_abap_char_utilities definition load.
    *constants:
    *    con_tab  type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
    *    con_cret type c value cl_abap_char_utilities=>CR_LF.
      CONCATENATE 'EBELN' 'EBELP' 'AEDAT' 'MATNR'
             INTO it_attach SEPARATED BY con_tab.
      CONCATENATE con_cret it_attach  INTO it_attach.
      APPEND  it_attach.
      LOOP AT it_ekpo INTO wa_charekpo.
        CONCATENATE wa_charekpo-ebeln wa_charekpo-ebelp
                    wa_charekpo-aedat wa_charekpo-matnr
               INTO it_attach SEPARATED BY con_tab.
        CONCATENATE con_cret it_attach  INTO it_attach.
        APPEND  it_attach.
      ENDLOOP.
    ENDFORM.                    " BUILD_XLS_DATA_TABLE
    *&      Form  SEND_FILE_AS_EMAIL_ATTACHMENT
    *       Send email
    FORM send_file_as_email_attachment tables pit_message
                                              pit_attach
                                        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.
      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_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[] = pit_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.
      t_receivers-receiver = ld_email.
      t_receivers-rec_type = 'U'.
      t_receivers-com_type = 'INT'.
      t_receivers-notif_del = 'X'.
      t_receivers-notif_ndel = 'X'.
      APPEND t_receivers.
      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.
    *&      Form  INITIATE_MAIL_EXECUTE_PROGRAM
    *       Instructs mail send program for SAPCONNECT to send email.
    FORM initiate_mail_execute_program.
      WAIT UP TO 2 SECONDS.
      SUBMIT rsconn01 WITH mode = 'INT'
                    WITH output = 'X'
                    AND RETURN.
    ENDFORM.                    " INITIATE_MAIL_EXECUTE_PROGRAM
    *&      Form  POPULATE_EMAIL_MESSAGE_BODY
    *        Populate message body text
    form populate_email_message_body.
      REFRESH it_message.
      it_message = 'Please find attached a list test ekpo records'.
      APPEND it_message.
    endform.                    " POPULATE_EMAIL_MESSAGE_BODY
    reward  points  if it is usefull ....
    Girish

  • How to send a mail as .txt attachment ,As data is seperated by pipeline

    Hi ,
    I got a requirement to send a mail in .txt format (Using OOPS) and the data inside the mail is seperated by '|'  Pls help me in this regard.
    i have written a mail to send the mail in .xls it is working fine for me in .xls but i dont know how to write the same for txt where data should be seperated by '|'.
    Regards
    sas
    Ps:  i am attaching my code. and please specify where i need to modify to achieve the same. and any perfromance enhacements are also welcome.
    *& Report  ZGBTEST02
    REPORT  YSAS_MAIL2.
    *Changes done by sas
    *PARAMETERS: P_MAIL TYPE AD_SMTPADR OBLIGATORY, " G C by sas
    *P_MAIL1 TYPE AD_SMTPADR OBLIGATORY." G by sas
    tables: adr6.
    SELECT-OPTIONS:p_eaddr FOR adr6-SMTP_ADDR NO INTERVALS .
    *end of changes by sas
    DATA: I_GLT0 TYPE STANDARD TABLE OF GLT0.
    DATA: I_MARA  TYPE STANDARD TABLE OF MARA.  " MARA Entries
    *      I_MARC  TYPE STANDARD TABLE OF MARC.  " MARC Entries
    DATA: L_TEXT  TYPE CHAR255.  " Text
    DATA: L_LINES TYPE I,
          L_SIZE  TYPE SOOD-OBJLEN.
    " Size of Attachment
    * Mail related
    DATA: I_CONTENT         TYPE   SOLI_TAB, " Mail content
          I_ATTACH          TYPE   SOLI_TAB, " Attachment
          I_ATTACH1         TYPE   SOLIX_TAB. " Attachment
    DATA: L_SEND_REQUEST    TYPE REF TO    CL_BCS,
                                                " E-Mail Send Request
          L_DOCUMENT        TYPE REF TO    CL_DOCUMENT_BCS,
                                                " E-Mail Attachment
          L_RECIPIENT       TYPE REF TO    IF_RECIPIENT_BCS,
                                                " Distribution List
          L_SENDER          TYPE REF TO    IF_SENDER_BCS,
                                                " Address of Sender
          L_UNAME           TYPE           SALRTDRCPT,
                                                " Sender Name(SY-UNAME)
          L_BCS_EXCEPTION   TYPE REF TO    CX_DOCUMENT_BCS,
                                                " BCS Exception
          L_ADDR_EXCEPTION  TYPE REF TO    CX_ADDRESS_BCS,
                                                " Address Exception
          L_SEND_EXCEPTION  TYPE REF TO    CX_SEND_REQ_BCS.
    " E-Mail sending Exception
    *Constants------------------------------------------------------------*
    CONSTANTS: C_TAB(1) TYPE C VALUE
               CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB,
                                         " Tab Character
               C_CR(1)  TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF,
                                         " Line Feed for End-Of_line
               C_EXT    TYPE SOODK-OBJTP VALUE 'XLS'. " XLS Extension
    START-OF-SELECTION.
      SELECT * FROM MARA INTO TABLE I_MARA UP TO 20 ROWS.
      IF SYST-SUBRC EQ 0.
    *    SELECT * FROM MARC INTO TABLE I_MARC FOR ALL ENTRIES IN I_MARA WHERE MATNR = I_MARA-MATNR.
      ENDIF.
    *select * from glt0 into table i_glt0.
    * Preparing body of the Mail
      MOVE 'SAP Material Master Records' TO L_TEXT.
      APPEND L_TEXT TO I_CONTENT.
      CLEAR L_TEXT.
      APPEND L_TEXT TO I_CONTENT.
      MOVE 'Thanks,' TO L_TEXT.
      APPEND L_TEXT TO I_CONTENT.
      MOVE 'SAP MM' TO L_TEXT.
      APPEND L_TEXT TO I_CONTENT.
    * Creates persistent send request
      TRY.
          L_SEND_REQUEST = CL_BCS=>CREATE_PERSISTENT( ).
    * Creating Document
          L_DOCUMENT = CL_DOCUMENT_BCS=>CREATE_DOCUMENT(
                                        I_TYPE  = 'RAW'
                                        I_TEXT  = I_CONTENT[]
                                        I_SUBJECT = 'SAS MASTER Records' ).
    * Preparing contents of attachment with Change Log
          PERFORM PREPARE_ATTACHMENT.
          DESCRIBE TABLE I_MARA LINES L_LINES.
    * Size to multiplied by 2 for UNICODE enabled systems
          L_SIZE = L_LINES * 2 * 255.
    * Adding Attachment
          CALL METHOD L_DOCUMENT->ADD_ATTACHMENT
            EXPORTING
              I_ATTACHMENT_TYPE    = C_EXT
              I_ATTACHMENT_SIZE    = L_SIZE
              I_ATTACHMENT_SUBJECT = 'MARA Details'
    *          i_att_content_hex    = i_attach[].
              I_ATT_CONTENT_TEXT   = I_ATTACH[].
    *      DESCRIBE TABLE I_MARC LINES L_LINES.
    * Size to multiplied by 2 for UNICODE enabled systems
    *      L_SIZE = L_LINES * 2 * 255.
    ** Adding Attachment
    *      CALL METHOD L_DOCUMENT->ADD_ATTACHMENT
    *        EXPORTING
    *          I_ATTACHMENT_TYPE    = C_EXT
    *          I_ATTACHMENT_SIZE    = L_SIZE
    *          I_ATTACHMENT_SUBJECT = 'MARC Details'
    *          I_ATT_CONTENT_HEX    = I_ATTACH1[].
    **          i_att_content_text   = i_attach1[].
    * Add document to send request
          CALL METHOD L_SEND_REQUEST->SET_DOCUMENT( L_DOCUMENT ).
          DATA:LR_SENDER TYPE REF TO IF_SENDER_BCS,
               LR_SEND TYPE REF TO CL_BCS.
    * Preparing the sender object
    *      LR_SENDER = CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS( sy-uname ).
           DATA: L1_UNAME TYPE SY-UNAME.
           L1_UNAME = SY-UNAME.
           LR_SENDER = CL_SAPUSER_BCS=>CREATE( L1_UNAME ).
    * Setting the sender
          CALL METHOD L_SEND_REQUEST->SET_SENDER
            EXPORTING
              I_SENDER = LR_SENDER.
    * E-Mail
       LOOP AT P_EADDR.
          TRANSLATE P_EADDR-LOW TO LOWER CASE.
          L_RECIPIENT = CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS( P_EADDR-LOW ).
          CALL METHOD L_SEND_REQUEST->ADD_RECIPIENT
            EXPORTING
              I_RECIPIENT  = L_RECIPIENT
              I_EXPRESS    = 'U'
              I_COPY       = ' '
              I_BLIND_COPY = ' '
              I_NO_FORWARD = ' '.
           IF SY-subrc EQ 0.
              WRITE:/'** SUCCESS:  Email Sent to', p_eaddr-LOW COLOR COL_NORMAL.
            ELSE.
              WRITE:/'** ERROR: Failed to send Email to',p_eaddr-LOW COLOR COL_NEGATIVE .
            ENDIF.
          ENDLOOP.
    *Trigger E-Mail immediately
          L_SEND_REQUEST->SET_SEND_IMMEDIATELY( ' ' ).
          CALL METHOD L_SEND_REQUEST->SEND( ).
          COMMIT WORK.
        CATCH CX_DOCUMENT_BCS INTO L_BCS_EXCEPTION.
        CATCH CX_SEND_REQ_BCS INTO L_SEND_EXCEPTION.
        CATCH CX_ADDRESS_BCS  INTO L_ADDR_EXCEPTION.
      ENDTRY.
    *&      Form  PREPARE_ATTACHMENT
    FORM PREPARE_ATTACHMENT .
      FIELD-SYMBOLS: <LFS_TABLE>,    " Internal table structure
                     <LFS_CON>.      " Field Content
      DATA: L_TEXT TYPE CHAR1024.     " Text content for mail attachment
      DATA: L_CON TYPE STRING. "(50) TYPE c.        " Field Content in character format
      DATA: L_STR TYPE STRING,
            L_STR1 TYPE STRING.
      DATA: LS_SOLIX TYPE SOLIX.
    * Columns to be tab delimeted
      LOOP AT I_MARA ASSIGNING <LFS_TABLE>.
        DO.
          ASSIGN COMPONENT SY-INDEX OF STRUCTURE <LFS_TABLE>
                 TO <LFS_CON>.
          IF SY-SUBRC NE 0.
            CONCATENATE C_CR L_TEXT INTO L_TEXT.
    *        CONCATENATE l_str c_cr l_text INTO l_str.
    *        ls_solix-line = l_text.
    *        APPEND ls_solix TO i_attach.
            APPEND L_TEXT TO I_ATTACH.
            EXIT.
          ELSE.
            CLEAR: L_CON.
            MOVE <LFS_CON> TO L_CON.
            CONDENSE L_CON.
            IF SY-INDEX = 1.
              CLEAR: L_TEXT.
              MOVE L_CON TO L_TEXT.
            ELSE.
              CONCATENATE L_TEXT L_CON INTO L_TEXT
                 SEPARATED BY C_TAB.
            ENDIF.
          ENDIF.
        ENDDO.
      ENDLOOP.
    ** Columns to be tab delimeted
    *  LOOP AT I_MARC ASSIGNING <LFS_TABLE>.
    *    DO.
    *      ASSIGN COMPONENT SY-INDEX OF STRUCTURE <LFS_TABLE>
    *             TO <LFS_CON>.
    *      IF SY-SUBRC NE 0.
    *        CONCATENATE C_CR L_TEXT INTO L_TEXT.
    **        CONCATENATE l_str c_cr l_text INTO l_str1.
    *        LS_SOLIX-LINE = L_TEXT.
    *        APPEND LS_SOLIX TO I_ATTACH1.
    *        EXIT.
    *      ELSE.
    *        CLEAR: L_CON.
    *        MOVE <LFS_CON> TO L_CON.
    *        CONDENSE L_CON.
    *        IF SY-INDEX = 1.
    *          CLEAR: L_TEXT.
    *          MOVE L_CON TO L_TEXT.
    *        ELSE.
    *          CONCATENATE L_TEXT L_CON INTO L_TEXT
    *             SEPARATED BY C_TAB.
    *        ENDIF.
    *      ENDIF.
    *    ENDDO.
    *  ENDLOOP.
    *  i_attach1[] = i_attach[].
    ENDFORM.                    " PREPARE_ATTACHMENT

    Hi Sas,
    I have copied the code and executed and it is working fine. I'm getting the text attachement in the email.
    * Adding Attachment
          CALL METHOD L_DOCUMENT->ADD_ATTACHMENT
            EXPORTING
              I_ATTACHMENT_TYPE    = 'TXT'          "  C_EXT   My change
              I_ATTACHMENT_SIZE    = L_SIZE
              I_ATTACHMENT_SUBJECT = 'MARA Details'
    *          i_att_content_hex    = i_attach[].
              I_ATT_CONTENT_TEXT   = I_ATTACH[].
    CONCATENATE i_mara-MATNR
                             i_mara-ERSDA
                             i_mara-ERNAM
                             i_mara-LAEDA
                   INTO   L_TEXT
                 SEPARATED BY '|'.

  • How to send a mail as .txt attachment ?

    Hi all,
    I got a requirement to write code for sending mail in oops.
    i have written code for .xls which is working fine. But requirement is to send the mail in the format of txt.
    i just only chnge the .xls to .txt where i can see the output properly in sap but problem is that i am unable to get the proper alignment. when i execute the report and see the output in sost i can see the attachment.i am downloading the attachment there only(Our server is not configured to get the mails directly) .So when i open the saved text file on my pc the output is appearing as follows...
    pernr nachn vorna
            0001 L0001 F0001
                0002 L0002 F0002
                   0003 L0003 F0003
                         0004 L0004 F0004...
    Where it should come in straight line as follows in my o/p code..
    pernr nachn vorna
    0001 L0001 F0001
    0002 L0002 F0002
    0003 L0003 F0003
    0004 L0004 F0004...
    i am puttin g my code ..please correct me where i am wrong .....waiting for your valuabel inputs..
    *& Report  ZGBTEST02
    REPORT  YSAS_MAIL2.
    *Changes done by sas
    *PARAMETERS: P_MAIL TYPE AD_SMTPADR OBLIGATORY, " G C by sas
    *P_MAIL1 TYPE AD_SMTPADR OBLIGATORY." G by sas
    TABLES: ADR6.
    SELECT-OPTIONS:P_EADDR FOR ADR6-SMTP_ADDR NO INTERVALS .
    *end of changes by sas
    DATA: I_GLT0 TYPE STANDARD TABLE OF GLT0.
    *DATA: I_pernr  TYPE STANDARD TABLE OF pa0002.  " MARA Entries
    DATA: BEGIN OF I_PERNR OCCURS 1 ,
    PERNR TYPE PA0002-PERNR,
    NACHN TYPE PA0002-NACHN,
    VORNA TYPE PA0002-VORNA,
    END OF I_PERNR..
    *      I_MARC  TYPE STANDARD TABLE OF MARC.  " MARC Entries
    DATA: L_TEXT  TYPE CHAR255.  " Text
    DATA: L_LINES TYPE I,
          L_SIZE  TYPE SOOD-OBJLEN.
    " Size of Attachment
    * Mail related
    DATA: I_CONTENT         TYPE   SOLI_TAB, " Mail content
          I_ATTACH          TYPE   SOLI_TAB, " Attachment
          I_ATTACH1         TYPE   SOLIX_TAB. " Attachment
    DATA: L_SEND_REQUEST    TYPE REF TO    CL_BCS,
                                                " E-Mail Send Request
          L_DOCUMENT        TYPE REF TO    CL_DOCUMENT_BCS,
                                                " E-Mail Attachment
          L_RECIPIENT       TYPE REF TO    IF_RECIPIENT_BCS,
                                                " Distribution List
          L_SENDER          TYPE REF TO    IF_SENDER_BCS,
                                                " Address of Sender
          L_UNAME           TYPE           SALRTDRCPT,
                                                " Sender Name(SY-UNAME)
          L_BCS_EXCEPTION   TYPE REF TO    CX_DOCUMENT_BCS,
                                                " BCS Exception
          L_ADDR_EXCEPTION  TYPE REF TO    CX_ADDRESS_BCS,
                                                " Address Exception
          L_SEND_EXCEPTION  TYPE REF TO    CX_SEND_REQ_BCS.
    " E-Mail sending Exception
    *Constants------------------------------------------------------------*
    CONSTANTS: C_TAB(1) TYPE C VALUE
               CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB,
                                         " Tab Character
               C_CR(1)  TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF,
                                         " Line Feed for End-Of_line
               C_EXT    TYPE SOODK-OBJTP VALUE 'TXT'. " XLS Extension
    START-OF-SELECTION.
      SELECT PERNR NACHN VORNA  FROM PA0002 INTO CORRESPONDING FIELDS OF TABLE I_PERNR UP TO 20 ROWS.
    *select * from glt0 into table i_glt0.
    * Preparing body of the Mail
    *  MOVE 'SAP Material Master Records' TO L_TEXT.
    *  APPEND L_TEXT TO I_CONTENT.
    *  CLEAR L_TEXT.
    *  APPEND L_TEXT TO I_CONTENT.
    *  MOVE 'Thanks,' TO L_TEXT.
    *  APPEND L_TEXT TO I_CONTENT.
    *  MOVE 'SAP MM' TO L_TEXT.
    *  APPEND L_TEXT TO I_CONTENT.
      MOVE '<BR>Attached is your HRIS report(s) generated from the Firm''s' TO L_TEXT.
      APPEND L_TEXT TO I_CONTENT.
      MOVE ' Human Resources  Information System (SAP).' TO L_TEXT.
      APPEND L_TEXT TO I_CONTENT.
      MOVE '<BR>  ' TO L_TEXT.
      APPEND L_TEXT TO I_CONTENT.
      MOVE '<BR>This is an automated report.' TO L_TEXT.
      APPEND L_TEXT TO I_CONTENT.
    *        MOVE '<BR>  ' TO l_text.
    *        APPEND l_text TO i_content.
      MOVE '<BR>  ' TO L_TEXT.
      APPEND L_TEXT TO I_CONTENT.
    *        MOVE '<BR>Please do not reply to this email' TO l_text.
    *        APPEND l_text TO i_content.
    *        MOVE '<BR>  ' TO l_text.
    *        APPEND l_text TO i_content.
      MOVE '<BR>Thank you.' TO L_TEXT.
      APPEND L_TEXT TO I_CONTENT.
    * Creates persistent send request
      TRY.
          L_SEND_REQUEST = CL_BCS=>CREATE_PERSISTENT( ).
    * Creating Document
          L_DOCUMENT = CL_DOCUMENT_BCS=>CREATE_DOCUMENT(
                                        I_TYPE  = 'RAW'
                                        I_TEXT  = I_CONTENT[]
                                        I_SUBJECT = 'Automated HRIS (SAP) Report' ).
    DATA: W_PERNR LIKE I_PERNR.
    * Preparing contents of attachment with Change Log
          PERFORM PREPARE_ATTACHMENT.
          DATA: compressed like solisti1 occurs 10 with header line.
    DATA: decompressed like solisti1 occurs 10 with header line.
          CALL FUNCTION 'TABLE_COMPRESS'
    *   IMPORTING
    *     COMPRESSED_SIZE       =
                        TABLES
    *      in                    = eerec
                          in                    = i_attach
                          out                   = compressed.
          CALL FUNCTION 'TABLE_DECOMPRESS'
            TABLES
              in  = compressed
              out = decompressed.
          DESCRIBE TABLE decompressed LINES L_LINES.
    * Size to multiplied by 2 for UNICODE enabled systems
          L_SIZE = L_LINES * 2 * 255.
    * Adding Attachment
          CALL METHOD L_DOCUMENT->ADD_ATTACHMENT
            EXPORTING
              I_ATTACHMENT_TYPE    = C_EXT
              I_ATTACHMENT_SIZE    = L_SIZE
              I_ATTACHMENT_SUBJECT = 'Hr Details'
    *          i_att_content_hex    = i_attach[].
              I_ATT_CONTENT_TEXT   = decompressed[].
    *      DESCRIBE TABLE I_MARC LINES L_LINES.
    * Size to multiplied by 2 for UNICODE enabled systems
    *      L_SIZE = L_LINES * 2 * 255.
    ** Adding Attachment
    *      CALL METHOD L_DOCUMENT->ADD_ATTACHMENT
    *        EXPORTING
    *          I_ATTACHMENT_TYPE    = C_EXT
    *          I_ATTACHMENT_SIZE    = L_SIZE
    *          I_ATTACHMENT_SUBJECT = 'MARC Details'
    *          I_ATT_CONTENT_HEX    = I_ATTACH1[].
    **          i_att_content_text   = i_attach1[].
    * Add document to send request
          CALL METHOD L_SEND_REQUEST->SET_DOCUMENT( L_DOCUMENT ).
          DATA:LR_SENDER TYPE REF TO IF_SENDER_BCS,
               LR_SEND TYPE REF TO CL_BCS.
    * Preparing the sender object
    *      LR_SENDER = CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS( sy-uname ).
          DATA: L1_UNAME TYPE SY-UNAME.
          L1_UNAME = SY-UNAME.
          LR_SENDER = CL_SAPUSER_BCS=>CREATE( L1_UNAME ).
    * Setting the sender
          CALL METHOD L_SEND_REQUEST->SET_SENDER
            EXPORTING
              I_SENDER = LR_SENDER.
    * E-Mail
          LOOP AT P_EADDR.
            TRANSLATE P_EADDR-LOW TO LOWER CASE.
            L_RECIPIENT = CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS( P_EADDR-LOW ).
            CALL METHOD L_SEND_REQUEST->ADD_RECIPIENT
              EXPORTING
                I_RECIPIENT  = L_RECIPIENT
                I_EXPRESS    = 'U'
                I_COPY       = ' '
                I_BLIND_COPY = ' '
                I_NO_FORWARD = ' '.
            IF SY-SUBRC EQ 0.
              WRITE:/'** SUCCESS:  Email Sent to', P_EADDR-LOW COLOR COL_NORMAL.
            ELSE.
              WRITE:/'** ERROR: Failed to send Email to',P_EADDR-LOW COLOR COL_NEGATIVE .
            ENDIF.
          ENDLOOP.
    *Trigger E-Mail immediately
          L_SEND_REQUEST->SET_SEND_IMMEDIATELY( ' ' ).
          CALL METHOD L_SEND_REQUEST->SEND( ).
          COMMIT WORK.
        CATCH CX_DOCUMENT_BCS INTO L_BCS_EXCEPTION.
        CATCH CX_SEND_REQ_BCS INTO L_SEND_EXCEPTION.
        CATCH CX_ADDRESS_BCS  INTO L_ADDR_EXCEPTION.
      ENDTRY.
    *&      Form  PREPARE_ATTACHMENT
    FORM PREPARE_ATTACHMENT .
      FIELD-SYMBOLS: <LFS_TABLE>,    " Internal table structure
                     <LFS_CON>.      " Field Content
      DATA: L_TEXT TYPE CHAR1024.     " Text content for mail attachment
      DATA: L_CON TYPE STRING. "(50) TYPE c.        " Field Content in character format
      DATA: L_STR TYPE STRING,
            L_STR1 TYPE STRING.
    *data: w_pernr type TABLE OF I_PERNR.
      DATA: LS_SOLIX TYPE SOLIX.
    *  CONCATENATE 'PERNR' 'FIRST NAME' 'Last Name' C_CR INTO L_TEXT SEPARATED BY '|'.
    *  append l_text to i_attach.
    *  clear l_text.
    * Columns to be tab delimeted
      LOOP AT I_PERNR ASSIGNING <LFS_TABLE>.
        DO.
          ASSIGN COMPONENT SY-INDEX OF STRUCTURE <LFS_TABLE>
                 TO <LFS_CON>.
          IF SY-SUBRC NE 0.
            CONCATENATE C_CR L_TEXT INTO L_TEXT.
    *        CONCATENATE l_str c_cr l_text INTO l_str.
    *        ls_solix-line = l_text.
    *        APPEND ls_solix TO i_attach.
            APPEND L_TEXT TO I_ATTACH.
            EXIT.
          ELSE.
            CLEAR: L_CON.
            MOVE <LFS_CON> TO L_CON.
            CONDENSE L_CON.
            IF SY-INDEX = 1.
              CLEAR: L_TEXT.
              MOVE L_CON TO L_TEXT.
            ELSE.
              CONCATENATE L_TEXT L_CON INTO L_TEXT
                 SEPARATED BY C_TAB.
            ENDIF.
          ENDIF.
        ENDDO.
      ENDLOOP.
    *  i_attach1[] = i_attach[].
    ENDFORM.                    " PREPARE_ATTACHMENT
    Please if any one having 6.0 version please upload it and see..
    Regards
    Sas

    Hi ,
    Did you downloaded from  SOST  using the display icon and inside that 4th tab for attachment ....
    and see?
    Regards
    sas
    pS: THE FIRST page is not allowing the spaces in sdn...
    i am getting o/p as
    pernr vochn norna
    .........0001 f0001 l0001
    .................0002 F0002 L0002
    .......................0003 F0003 L0003.....
    Please remove dots and understand that is the o/p i am getting in my presenation file
    i just expecting the o/p as told earlier..
    Regards
    sas

Maybe you are looking for

  • Game center ios7 problems (achievements out of sync)

    There are many serious bugs in Game Center for iOS7.  None of the deficiencies of GC on iOS6 were addressed, and new crashes, hangs, and other bugs were added.  It's as if Apple couldn't care less that games are the single biggest category of apps se

  • OSX10.4.9/iSync 2.4 with Palm E2 running HotSync 3.2.1

    Hi All, iSync happily syncs between my Powerbook and phone; HotSync happily syncs between Powerbook and my Palm... but I can't get iSync to install the iSync Conduit in HotSync Manager enabling the Palm to download to iCal etc. I've run 'Enable Palm

  • Trying to install cs5.5 design premium on my laptop(second computer)

    i dont have the serial code because its a student version and i am no longer in school so i dont have that email address anymore

  • Why has the last update screwed everything up

    ...Now, important site I use no longer functions like it should. It should remember what I've looked at, this is the way it use to function. this might sound vague but I got no input on my last question!-maybe too long? It's a music site I use for bu

  • Message: the older version of bonjour cannot be removed

    Hi, I tried to upgrade my iTunes yesterday and the message popped up when I tried to install it. I've tried several solutions (including http://discussions.info.apple.com/thread.jspa?threadID=2505467&tstart=330) and am still having trouble. When I us