Email notification with excel attachment.

Hello,
I have a requirement to find an OSS note which talks about sending payment notification email with an excel attachment. If any body has come across this kind of note, please reply with the details.
Thank You.
Moderator message: please look for OSS notes yourself in the SAP Service Marketplace.
Edited by: Thomas Zloch on Jun 14, 2011 9:22 AM

Can you post your code?
Regards,
Rich Heilman

Similar Messages

  • Send Email with Excel attachment with formatting(bold, color) in Background

    Hi,
    I have requirement wherein I have to send an email with excel attachment with proper formatting of certain fields in the excel sheet like making it bold or setting different color. The data is available in an internal table. Just to to format it and send an email when the program is executed in background mode.
    Any pointers on this would be highly appreciated!
    Thanks,
    Anil.

    I  resolved my own problem using the BCS_EXAMPLE_7 program as sample.

  • Email with excel attached

    Hello,
    I have to send an email in a workflow step with a excel attach from an internal table, Does anyone have any sugestion ?
    Thanks,
    Diego

    Hi,
    Check this [thread1|send excel attachment as email; [thread2|Re: Excel attachment in SO_DOCUMENT_SEND_API1; & [thread3|Help needed for the Excel attachment to mail;.
    Regards,
    Surjith

  • Problem in excel format while sending mail with excel attachment.

    Hi Gurus ,
    I am sending a email with Excel attachment using FM SO_DOCUMENT_SEND_API1 or SO_NEW_DOCUMENT_ATT_SEND_API1.
    I am able to send a mail with excel attachment with a piece of code which I got from SDN itself.
    But the problem is when I am trying to open the attachment, <b>A pop up comes which says that it is not in recognizable format. Would you like to open it?
    and several other lines of caution.</b>
    When i choose to open it, i get the correct data in one excel sheet. Certain vertical lines of the excel sheet is missing. <b>But no data is missing. </b>
    I am attaching the code below. Can any one please tell me where is the problem in this code ?
    Thanx in advance
    types: begin of t_mara,
    matnr type mara-matnr,
    matkl type mara-matkl,
    mtart type mara-mtart,
    meins type mara-meins,
    end of t_mara.
    data: gt_mara type table of t_mara,
    wa_mara like line of gt_mara,
    it_packing_list type table of SOPCKLSTI1,
    wa_packing_list like line of it_packing_list,
    it_receivers type table of SOMLRECI1,
    wa_receivers like line of it_receivers,
    it_mailbody type table of SOLISTI1,
    wa_mailbody like line of it_mailbody,
    it_attachment type table of SOLISTI1,
    wa_attachment like line of it_attachment.
    data: la_doc type SODOCCHGI1.
    constants:
    con_tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
    con_cret type c value cl_abap_char_utilities=>CR_LF.
    * get material
    select matnr matkl mtart meins
    into table gt_mara
    from mara
    up to 25 rows.
    * Populate the subject/generic message attributes
    la_doc-obj_langu = sy-langu.
    la_doc-obj_descr = 'Material Details' . "Mail Header
    la_doc-sensitivty = 'F'.
    la_doc-doc_size = 1.
    * Add the recipients email address
    CLEAR wa_receivers.
    REFRESH it_receivers.
    wa_receivers-receiver = 'PCSDEVL'.
    wa_receivers-rec_type = 'U'.
    wa_receivers-com_type = 'INT'.
    wa_receivers-notif_del = 'X'.
    wa_receivers-notif_ndel = 'X'.
    APPEND wa_receivers to it_receivers.
    * Mail Body
    CLEAR wa_mailbody.
    REFRESH it_mailbody.
    wa_mailbody-line = 'Please find the attachment'.
    APPEND wa_mailbody to it_mailbody.
    * Mail attachmwnt
    CLEAR wa_attachment.
    REFRESH it_attachment.
    CONCATENATE 'MATNR' 'MATKL' 'MTART' 'MEINS'
    INTO wa_attachment SEPARATED BY con_tab.
    CONCATENATE con_cret wa_attachment INTO wa_attachment.
    APPEND wa_attachment to it_attachment.
    LOOP AT gt_mara INTO wa_mara.
    CONCATENATE wa_mara-matnr wa_mara-matkl
    wa_mara-mtart wa_mara-meins
    INTO wa_attachment SEPARATED BY con_tab.
    CONCATENATE con_cret wa_attachment INTO wa_attachment.
    APPEND wa_attachment to it_attachment.
    ENDLOOP.
    * Describe the body of the message
    CLEAR wa_packing_list.
    REFRESH it_packing_list.
    wa_packing_list-transf_bin = space.
    wa_packing_list-head_start = 1.
    wa_packing_list-head_num = 0.
    wa_packing_list-body_start = 1.
    wa_packing_list-body_num = 1.
    wa_packing_list-doc_type = 'RAW'.
    APPEND wa_packing_list to it_packing_list.
    * Create attachment notification
    wa_packing_list-transf_bin = 'X'.
    wa_packing_list-head_start = 1.
    wa_packing_list-head_num = 1.
    wa_packing_list-body_start = 1.
    DESCRIBE TABLE it_attachment LINES wa_packing_list-body_num.
    wa_packing_list-doc_type = 'XLS'. " To word attachment change this as 'DOC'
    wa_packing_list-obj_descr = ' '.
    concatenate wa_packing_list-doc_type 'file' into wa_packing_list-OBJ_DESCR
    separated by space.
    wa_packing_list-doc_size = wa_packing_list-body_num * 255.
    APPEND wa_packing_list to it_packing_list.
    CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
    EXPORTING
    document_data = la_doc
    PUT_IN_OUTBOX = 'X'
    * SENDER_ADDRESS = SY-UNAME
    * SENDER_ADDRESS_TYPE = 'B'
    COMMIT_WORK = 'X'
    * IMPORTING
    * SENT_TO_ALL =
    * NEW_OBJECT_ID =
    * SENDER_ID =
    tables
    packing_list = it_packing_list
    * OBJECT_HEADER =
    CONTENTS_BIN = it_attachment
    CONTENTS_TXT = it_mailbody
    * CONTENTS_HEX =
    * OBJECT_PARA =
    * OBJECT_PARB =
    receivers = it_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
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.

    REPORT  Zex5 LINE-SIZE 255 LINE-COUNT 255 .
    class CL_ABAP_CHAR_UTILITIES definition load. "-->
    TABLES : vbap.
    SELECT-OPTIONS: s_vbeln FOR vbap-vbeln.
    DATA : BEGIN OF itab OCCURS 1,
           vbeln LIKE vbap-vbeln,
           posnr LIKE vbap-posnr,
           matnr LIKE vbap-matnr,
           END OF itab.
    parameters : p_email like somlreci1-receiver
    DATA: tlines type i.
    DATA: itmessage   LIKE solisti1 OCCURS 1 WITH HEADER LINE. "Ok
    DATA: itattach    LIKE solisti1 OCCURS 2 WITH HEADER LINE. "Ok
    DATA: itpacklist  LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE.
    DATA: itreclist   LIKE somlreci1 OCCURS 5 WITH HEADER LINE.
    data: itattachment like solisti1 OCCURS 2 WITH HEADER LINE.
    start-of-selection.
      SELECT vbeln posnr matnr
             FROM vbap
             INTO TABLE itab
             WHERE vbeln IN s_vbeln.
    **Make the internal table data to be compatible in excel format .
      PERFORM BUILD_XLS_FORMAT.
    **Populate message of body text.
      clear itmessage.
      refresh itmessage.
      itmessage = 'Please find attached Excel file'.
      append itmessage.
      PERFORM send_mail_as_xls_attachment tables itmessage
                                                 itattach
             using p_email 'Excel Attachment' 'TXT'    " 'XLS'
              using p_email 'TEXT Attachment' 'TXT'    " 'XLS'
                            'TestFileName'
                            'SalesOrders' .
    *&      Form  BUILD_XLS_FORMAT
          text
    -->  p1        text
    <--  p2        text
    form BUILD_XLS_FORMAT.
    previosuly we were using for unicode ..now replaced
    **Declare constants for the spacing .
    *Constants : con1 type x value '0D',
               con2 type x value '09'.
      Constants : con1 type c
            value CL_ABAP_CHAR_UTILITIES=>CR_LF,
            con2 type c
            value CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
    **For the Header descriptions.
      Concatenate 'SalesORdNo'
                  'Item'
                  'Materialno' into itattach separated by con2.
      Concatenate con1 itattach into itattach.
      Append itattach.
    **Now align the items in the itab as above .
      Loop at Itab.
        concatenate itab-vbeln
                    itab-posnr
                    itab-matnr into itattach separated by con2.
        concatenate con1 itattach into itattach .
        Append itattach.
      endloop.
    endform.                    " BUILD_XLS_FORMAT
    *&      Form  send_mail_as_xls_attachment
          text
         -->P_ITMESSAGE  text
         -->P_ITATTACH  text
         -->P_P_EMAIL  text
         -->P_0116   text
         -->P_0117   text
         -->P_0118   text
         -->P_0119   text
    form send_mail_as_xls_attachment tables   p_itmessage
                                              p_itattach
                                     using    p_email
                                              p_mtitle
                                              p_format
                                              p_filename
                                              p_attdescription.
      Data : xdocdata like sodocchgi1,
             xcnt type i.
    *Fill the document data.
      xdocdata-doc_size = 1.
    *Populate the subject/generic message attributes.
      xdocdata-obj_name  = 'SAPRPT'.
      xdocdata-obj_langu = sy-langu.
      xdocdata-obj_descr = p_mtitle.
    *Fill the document data and fetch size of attachment.
      clear xdocdata.
      read table itattach index xcnt.
      xdocdata-doc_size = ( xcnt - 1 ) * 255 + strlen( itattach ).
    xdocdata-doc_size =  ( xcnt - 1 ) * 255.
      xdocdata-obj_name  = 'SAPRPT'.
      xdocdata-obj_langu = sy-langu.
      xdocdata-obj_descr = p_mtitle.
      clear itattachment. refresh itattachment.
         itattachment[] = p_itattach[].
    *Describe the body of the message.
      clear itpacklist. refresh itpacklist.
      itpacklist-transf_bin = 'X'.
      itpacklist-head_start = '1'.
      itpacklist-head_num = '0'.
      itpacklist-body_start = '1'.
      describe table itattachment lines itpacklist-body_num .
      itpacklist-doc_type = 'TXT'.
    itpacklist-doc_type = 'XLS'.
      append itpacklist.
    *Create attachment notification.
      itpacklist-transf_bin = 'X'.
      itpacklist-head_start = '1'.
      itpacklist-head_num = '1'.
      itpacklist-body_start = '1'.
      describe table itattachment lines itpacklist-body_num .
      itpacklist-doc_type = p_format.
      itpacklist-obj_name = p_filename.
      itpacklist-obj_descr = p_attdescription.
      itpacklist-doc_size = itpacklist-body_num * 255 .
      append itpacklist.
    *FIll the receivers list.
      Clear itreclist. refresh itreclist.
      itreclist-receiver = p_email.
      itreclist-rec_type = 'U'.
      itreclist-com_type = 'INT'.
      itreclist-notif_del = 'X'.
      itreclist-notif_ndel = 'X'.
    *itreclist-notif_read = 'X'.
      append itreclist.
    *CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
    EXPORTING
      document_data                    = xdocdata
      PUT_IN_OUTBOX                    = 'X'
      commit_work    = 'X'
      SENDER_ADDRESS                   = SY-UNAME
    tables
       packing_list                    = itpacklist
       CONTENTS_BIN                    = itattachment
       CONTENTS_TXT                    = itmessage
       receivers                       = itreclist
    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
    *IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = xdocdata
          PUT_IN_OUTBOX              = 'X'
        TABLES
          packing_list               = itpacklist
          CONTENTS_BIN               = itattachment
          CONTENTS_TXT               = itmessage
          receivers                  = itreclist
        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.
      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.                    " send_mail_as_xls_attachment
    Just execute the above code and let me know.
    What is the sap version u r using .
    Vijay

  • Sending mail with excel attachment-improper format

    Dear experts,
    I am sending a mail to outlook with an excel attachment. The mail is sent with attachment and the data, but all in one cell.
    I am using SO_NEW_DOCUMENT_ATT_SEND_API1. What parameters do i need to manipulate to have data in different columns of excel? I am using "packing_list" table of FM. But dont know the exact parameters to be passed. Can anyone help with the same please?
    Best regards and thanks!
    Sumit Nene.

    Hello Sumit,
    I am using same function module to send mail with excel attachment.
    Below I am attaching my own code for your reference.
    Data which u want to add in excel file is maintain in IT_OBJBIN i.e. document information.
    CLEAR :IMESSAGE,IT_OBJBIN,IT_OBJPACK,IT_RECLIST.
    REFRESH: IMESSAGE[ ] , IT_OBJBIN[ ]  , IT_OBJPACK[ ] ,  IT_RECLIST[ ].
    " populate the text for body of the mail
    CLEAR WA_IMESSAGE.
    CONCATENATE    'Board : ' P_BOARD ':' 'Please find  the excel attached for the list of Material whose routing is created'   INTO WA_IMESSAGE-LINE.
      APPEND WA_IMESSAGE TO IMESSAGE.
    "document information
      W_DOC_CHNG-OBJ_NAME = 'Excel'.
      IF NOT P_BOARD IS INITIAL.
        CONCATENATE    'Board : ' P_BOARD ':' 'List Of Routing Materials' INTO  W_DOC_CHNG-OBJ_DESCR.
      ELSE.
        CONCATENATE     'List Of' ' Routing Materials' INTO  W_DOC_CHNG-OBJ_DESCR.
      ENDIF.
      W_DOC_CHNG-SENSITIVTY = 'F'.  " ->Functional object
      " displaying  material , plant in the excel
      CONCATENATE 'BOARD NO : ' P_BOARD INTO WA_OBJBIN.
      APPEND WA_OBJBIN TO IT_OBJBIN.
      CONCATENATE 'MATERIAL' 'PLANT' 'DESCRIPTION' INTO WA_OBJBIN SEPARATED BY C_TAB.
      CONCATENATE C_RET WA_OBJBIN INTO WA_OBJBIN.
      APPEND WA_OBJBIN TO IT_OBJBIN.
      CLEAR : WA_OBJBIN.
      LOOP AT IT_DOWNLOAD INTO WA_DOWNLOAD. "It_orders is the internal table to be transferred to excel
        CONCATENATE WA_DOWNLOAD-MATNR WA_DOWNLOAD-WERKS WA_DOWNLOAD-DESC INTO WA_OBJBIN SEPARATED BY C_TAB.
        CONCATENATE C_RET WA_OBJBIN INTO WA_OBJBIN.
        APPEND WA_OBJBIN TO IT_OBJBIN.
      ENDLOOP.
      DESCRIBE TABLE IT_OBJBIN LINES V_LINES_BIN.   " no of lines for excel data
      " pack the data as RAW
      CLEAR WA_IT_OBJPACK-TRANSF_BIN.                     "Obj. to be transported not in binary form
      WA_IT_OBJPACK-HEAD_START = 1.                   "Start line of object header in transport packet
      WA_IT_OBJPACK-HEAD_NUM = 0.                     "Number of lines of an object header in object packet
      WA_IT_OBJPACK-BODY_START = 1.                   "Start line of object contents in an object packet
      WA_IT_OBJPACK-BODY_NUM = MESSAGE_LINES.         "Number of lines of the mail body
      WA_IT_OBJPACK-DOC_TYPE = 'RAW'.
      APPEND WA_IT_OBJPACK TO IT_OBJPACK.
      " pack the data as excel
      WA_IT_OBJPACK-TRANSF_BIN = 'X'.
      WA_IT_OBJPACK-HEAD_START = 1.
      WA_IT_OBJPACK-HEAD_NUM = 1.
      WA_IT_OBJPACK-BODY_START = 1.
      WA_IT_OBJPACK-BODY_NUM = V_LINES_BIN.         "no of lines of it_orders to give no of unprocessed orders
      WA_IT_OBJPACK-DOC_TYPE = 'XLS'.   " ->  excel fomat
      WA_IT_OBJPACK-OBJ_NAME = 'EXCEL ATTACHMENT'.
      " attachment name
      IF NOT P_BOARD IS INITIAL.
        CONCATENATE P_BOARD '.XLS' INTO WA_IT_OBJPACK-OBJ_DESCR.
      ELSE.
        CONCATENATE 'LIST' '.XLS' INTO WA_IT_OBJPACK-OBJ_DESCR.
      ENDIF.
      WA_IT_OBJPACK-DOC_SIZE = V_LINES_BIN * 255.
      APPEND WA_IT_OBJPACK TO IT_OBJPACK.
      " creating email id
      DATA: STR1 TYPE STRING,
          STR2 TYPE STRING,
          STR3 TYPE STRING,
          ITAB TYPE TABLE OF STRING.
      DATA : WA_I LIKE LINE OF ITAB.
      SPLIT P_EMAIL AT ',' INTO: TABLE ITAB.
    e-mail receivers.
      CLEAR WA_IT_RECLIST.
      LOOP AT ITAB INTO WA_I.
        WA_IT_RECLIST-RECEIVER = WA_I.
      WA_IT_RECLIST-RECEIVER = V_MAILADDR.
        WA_IT_RECLIST-EXPRESS =  'X'.
        WA_IT_RECLIST-REC_TYPE = 'U'. "->  Internet address
        APPEND WA_IT_RECLIST TO IT_RECLIST.
        CLEAR WA_IT_RECLIST.
      ENDLOOP.
      " sending mail
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          DOCUMENT_DATA                    = W_DOC_CHNG
         PUT_IN_OUTBOX                    = 'X'
         COMMIT_WORK                      = 'X'
       IMPORTING
         SENT_TO_ALL                      =
         NEW_OBJECT_ID                    =
        TABLES
          PACKING_LIST                     = IT_OBJPACK
         OBJECT_HEADER                    =
         CONTENTS_BIN                      = IT_OBJBIN
         CONTENTS_TXT                      = IMESSAGE
         CONTENTS_HEX                     =
         OBJECT_PARA                      =
         OBJECT_PARB                      =
          RECEIVERS                        = IT_RECLIST
       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
      COMMIT WORK.
      IF SY-SUBRC = 0.
        MESSAGE I001 WITH 'Routing is Created for Board' P_BOARD 'and Mail send on e-mail id :' P_EMAIL.
      ENDIF.

  • Issue with Excel Attachement in BI 7.0

    Hi,
    I have developed a custom report to send an e-mail with excel attachment in BI 7.0. When we are trying to open the excel sheet attachment in the e-mail. I am getting a message warning message stating that<b> 'This file is not in a recognizable format'</b>. but if we click on ok button then everything looks fine i.e the data is displaying as expected.
    I have developed the same reports in SAP R/3 and SRM but I don't see any issues over there.
    Can any one help me on this issue.
    Thanks in advance,
    Venkat Bomma

    When the selection screen pops up choose the KEY only function on the TOOLS on the top right corner of the screen. Then you will be able to enter the values manually.
    Hope this helps.

  • Error in Sending Mail with excel attachment

    Hi All,
    While sending a mail with excel attachment it is getting successfully send but when i am opening the excel it gives a popup saying "The file is not in recognizable format", and when i click OK the data is getting displayed.
    So anybody has any idea of how to remove the popup??
    I am using SO_NEW_DOCUMENT_ATT_SEND_API1 FM for sending the mail.
    Can anybody help me regarding this.
    Thanks
    Salish

    Hi,
    I was facing the issue when I did not populate the parameters packing_list, object_header,contents_bin, contents_txt of the FM
    SO_NEW_DOCUMENT_ATT_SEND_API1 properly.
    Also the possible cause could be the configuration in SCOT, not very sure about this. Check with the BASIS guy.
    Regards,
    Sagar

  • Problem with sending message with excel attachment

    hi,
           i m using sap b1 2005b  i send message with excel attachment to sap user but message is reached to destination but attchment cannot send .ot shows an internal error pls help me.
    reagrds,
    vishal

    Vishal,
    Couple of questions. 
    How are you sending this message.  Is it a message that you create and send Internally with an attachment.
    As you reply me, please also check if the <b>Attachments folder</b> has been set under <b>Administration > System Initialization > General Settings.....Path Tab</b>
    SBO tries to copy the attachment from the location you select to the Path defined for Attachments.
    Let me know
    Suda

  • Email notification with SP 10

    Hi all,
    We are using Solution Manager 7.1 SP 10 and would like to use the "new" email notification with the new standard actions. Nevertheless, it seems that is doesn't work.
    Based on what we read, we should not need to create anything anymore as described here Pep Up Your ChaRM - Part 1: HowTo Create a Smart e-Mail Action as we have now 2 actions already created in standard :
    But when we try the SEND_MAIL_CHANGE_MANAGER one with the following action definition :
    with schedule condition :
    and start condition :
    SCOT / SO16 / BP are properly configured based on the following thread ChaRM: Approval Settings - Email Functionality in Change Request
    No email are triggered when for instance the status is in "validation". Are we missing something ?
    Thank you in advance.
    Kind Regards.

    Hi Vivek,
    Thanks for the answer.
    Of course, I have the corresponding YMCR actions created.
    As it is "scheduled automatically", don't I have some kind of WF or jobs to plan ?
    I assume that is not activated by  default once you are in SP 10, isn't it ?
    Based on the TJ30 table, my manager should received an email once the RfC is on "To be approved" or "Being implemented" status....which is not the case today...
    As I am using the same user for testing the flow, I am wondering if it doesn't come from that but I doubt it.
    And again, I wonder if there is not configuration to activate for these 2 actions, don't you think ?
    Thank you in advance for your answer.

  • Issue in Sending email with EXCEL attachment

    Hi,
    Im using the FM SO_NEW_DOCUMENT_ATT_SEND_API1 for sending emails to a list of recipients with an excel attachment. In the attachment data, as the field length is 255 for the structure SOLISTI1, for the records having more than 255 characters, data is being truncated. I did a search in this forum and done some changes , still it is not working properly.
    I have used SCMS_TEXT_TO_XSTRING, SCMS_XSTRING_TO_BINARY FMs for converting the data to hexa format. This case, records having more than 255 are displayed properly in the attachment, but there are blank lines inserted between two records.
    Please suggest me to resolve this isssue.
    Thanks in advance.
    Jayashree

    Hi Jayashree,
    you might want to check out the example link by Saso in his post Send external email from within ABAP program to xls.
    For the rest I can only guess that there might be some issues with the format you use for Excel. In case of empty lines and using a text format for Excel the issue is in most cases that there are too many carriage return line feeds in the text fiel (cl_abap_char_utilities=>cr_lf).
    Hope that helps.
    Best Regards
    Michael

  • Send email with excel attachment in outlook structure - SAP 6.0

    Hello experts..
    I need send a email with a excel attachment and use the signature in outlook to send.
    The attachment will be create in the process of send email program.
    Is it possible?
    How can I created and attach in the same process?
    How can I use the outlook strutucture to send a email?

    I  resolved my own problem using the BCS_EXAMPLE_7 program as sample.

  • Email with excel attachment...strange....

    My mother is trying to send me an Excel file that she received in another email (she can't open it-doesn't have Excel). She's tried forwarding the whole email to me, dragging just the wanted file to a new email and also saving the file to her desktop and attaching to a new email. Her "sent" box says it was sent-all times. The emails never arrive. I've checked my webmail folders and nothing. She sent a straight test email with nothing attached and it arrives fine. I'm stumped....

    Is your mom also using a Mac? If so, what OS is she using?
    Your mom can download the freeware NeoOffice http://download.neooffice.org/neojava/en/index.php
    NeoOffice is equivalent to Microsoft Office. It can open Excel files, Word files & PowerPoint files. You can also create these types of files that can be opened by PC users.
    NeoOffice 2.2.5 will operate on OS 10.3 & higher
    NeoOffice 3.0 requires OS 10.4
     Cheers, Tom

  • Sending an Email with Excel Attachment from Local directory

    Hi,
    I have a requirement : I want to send an email with an attachment which is exist on local  directory and currently I am using
    cl_bcs classes
    Thanks,
    Moderator message: Welcome to SCN!
    Moderator message: please do more research before asking, show what you have done yourself when asking.
    [Rules of engagement|http://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement]
    [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers]
    Edited by: Thomas Zloch on Aug 4, 2011 5:15 PM

    Hi,
    I have a requirement : I want to send an email with an attachment which is exist on local  directory and currently I am using
    cl_bcs classes
    Thanks,
    Moderator message: Welcome to SCN!
    Moderator message: please do more research before asking, show what you have done yourself when asking.
    [Rules of engagement|http://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement]
    [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers]
    Edited by: Thomas Zloch on Aug 4, 2011 5:15 PM

  • Email with excel attachment

    Hello friends,
    I'm having an issue with excel attachmnet which is being genetaed through email using function module 'SO_NEW_DOCUMENT_ATT_SEND_API1'...issue is getting more space on first column of the data...not header column, only space on data column. Do you have any idea  what might be the reason? Thanks in advance.
    Regards,
    Satya

    HI
    Implemented this idea . Problem is while generated the excel file That is
    Suppose  5 field in ur internal table then but dont want display all 5 fields
    just all  add ' ' if you dont want column then alignment will ready
    for example
             CONCATENATE CON_NEW  ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' INTO IT_ATTACH SEPARATED BY CON_TAB. "***
           APPEND IT_ATTACH.
    with regards
    anand kumar

  • Sending email with excel attachment from an ABAP report

    Hello All,
    I am using the function module SO_DOCUMENT_SEND_API1 to send an e-mail with an excel attachment.
    The code works fine for  less than 255 characters in each row of excel file.But for more than 255 characters , the excel file received has data upto 255 characters only.
    Can someone please suggest how to send excel file with more than 255 characters in each row ?
    Regards,
    KK

    check below code
    FORM excelrep .
      DATA :l_syuzeit TYPE sy-uzeit,
            l_time(5) TYPE c,
            l_ampm(2) TYPE c,
            l_subject(255) TYPE c.
      CLEAR t_xls.
      REFRESH t_xls.
      l_syuzeit = sy-uzeit.
      IF t_final_data1[] IS NOT INITIAL.
        PERFORM fill_header.
        LOOP AT t_final_data1 WHERE status NE space.
          t_xls-jobname = t_final_data1-jobname.
          WRITE t_final_data1-act_start_date TO t_xls-act_start_date.
          WRITE t_final_data1-est_start_time TO t_xls-est_start_time.
          WRITE t_final_data1-act_start_time TO t_xls-act_start_time.
          WRITE t_final_data1-est_end_time TO t_xls-est_end_time.
          WRITE t_final_data1-act_end_time TO t_xls-act_end_time.
          t_xls-est_duration = t_final_data1-est_duration.
          t_xls-act_duration = t_final_data1-duration.
          t_xls-status = t_final_data1-comment.
          t_xls-process = t_final_data1-desc.
          t_xls-fill10 = c_0d.
          t_xls-fill1 = c_09.
          t_xls-fill2 = c_09.
          t_xls-fill3 = c_09.
          t_xls-fill4 = c_09.
          t_xls-fill5 = c_09.
          t_xls-fill6 = c_09.
          t_xls-fill7 = c_09.
          t_xls-fill8 = c_09.
          t_xls-fill9 = c_09.
          APPEND t_xls.
          CLEAR t_xls.
        ENDLOOP.
        l_ampm = c_am.
        IF l_syuzeit GT c_125959.
          l_syuzeit = l_syuzeit - c_120000.
          l_ampm = c_pm.
        ELSEIF l_syuzeit GT c_120000.
          l_ampm = c_pm.
        ELSEIF l_syuzeit LT c_010000.
          l_syuzeit = l_syuzeit + c_120000.
          l_ampm = c_am.
        ENDIF.
        WRITE l_syuzeit TO l_time USING EDIT MASK c_edmask.
        CONCATENATE text-070 l_time l_ampm INTO l_subject
                                      SEPARATED BY space.
        CLEAR w_doc_chng.
        w_doc_chng-obj_name = l_subject.
        w_doc_chng-obj_descr = l_subject.
        CLEAR t_objtxt.
        REFRESH t_objtxt.
        t_objtxt = text-068.
        APPEND t_objtxt.
        CLEAR t_objtxt.
        t_objtxt = space.
        APPEND t_objtxt.
        CLEAR t_objtxt.
        t_objtxt = text-069.
        APPEND t_objtxt.
        CLEAR t_objtxt.
        t_objtxt = space.
        APPEND t_objtxt.
        CLEAR t_objtxt.
        MOVE w_sysinfo TO t_objtxt.
        APPEND t_objtxt.
        CLEAR t_objtxt.
        t_objtxt = space.
        APPEND t_objtxt.
        CLEAR t_objtxt.
        CLEAR w_tab_lines.
        DESCRIBE TABLE t_objtxt LINES w_tab_lines.
        w_doc_chng-doc_size = w_tab_lines * c_255.
        CLEAR t_objpack.
        REFRESH t_objpack.
        t_objpack-body_start = c_1.
        t_objpack-body_num = w_tab_lines * c_255.
        t_objpack-doc_type = c_txt.
        APPEND t_objpack.
        CLEAR t_objpack.
        CLEAR t_objbin.
        REFRESH t_objbin.
        LOOP AT t_xls.
          t_objbin = t_xls.
          APPEND t_objbin.
          CLEAR t_objbin.
        ENDLOOP.
        CLEAR w_tab_lines.
        DESCRIBE TABLE t_objbin LINES w_tab_lines.
        CLEAR l_subject.
        CONCATENATE text-083 sy-datum l_time l_ampm INTO l_subject
                    SEPARATED BY c_uscore.
        CLEAR t_objhead.
        REFRESH t_objhead.
        t_objhead = l_subject.
        APPEND t_objhead.
        CLEAR t_objhead.
        t_objpack-transf_bin = c_x.
        t_objpack-head_start = c_1.
        t_objpack-head_num = c_1.
        t_objpack-body_start = c_1.
        t_objpack-body_num = w_tab_lines.
        t_objpack-doc_type = c_xls.
        t_objpack-obj_name = text-070.
        t_objpack-obj_descr = text-070.
        t_objpack-doc_size = w_tab_lines * c_255.
        t_objpack-mess_type =  space.
        APPEND t_objpack.
        CLEAR t_objpack.
        CLEAR t_reclist.
        REFRESH t_reclist.
        IF s_email[] IS NOT INITIAL.
          LOOP AT s_email.
            t_reclist-receiver = s_email-low.
            t_reclist-rec_type = c_u.
            APPEND t_reclist.
            CLEAR t_reclist.
          ENDLOOP.
        ENDIF.
        PERFORM mail_report.
      ELSE.
        MESSAGE e015 WITH text-072.
      ENDIF.
      CLEAR : w_doc_chng,
              t_objpack,
              t_objhead,
              t_objbin,
              t_objtxt.
      REFRESH : t_objpack,
                t_objhead,
                t_objbin,
                t_objtxt,
                t_reclist.
    ENDFORM.                    " excelrep_criticaljobs
    *&      Form  mail_report
          text
    -->  p1        text
    <--  p2        text
    FORM mail_report .
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = w_doc_chng
          commit_work                = c_x
        TABLES
          packing_list               = t_objpack
          object_header              = t_objhead
          contents_bin               = t_objbin
          contents_txt               = t_objtxt
          receivers                  = t_reclist
        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.
      IF sy-subrc NE 0.
        CASE sy-subrc.
          WHEN 1.
            MESSAGE i015 WITH text-071.
          WHEN 2.
            MESSAGE i015 WITH text-072.
          WHEN 4.
            MESSAGE i015 WITH text-073.
          WHEN OTHERS.
            MESSAGE i015 WITH text-074.
        ENDCASE.
      ELSE.
        MESSAGE s015 WITH text-081.
      ENDIF.
    ENDFORM.                    " mail_report

Maybe you are looking for

  • Font issue in Photoshop CS2

    Hi! I just encountered a rather annoying problem I don't know how to solve. So far I couldn't find any solution on forums either. Recently I got the new Intel-based MacBook Pro. Although I had known about the problems beforehand as well as about perf

  • Compressor Droplet WON'T Work

    I made a droplet in Compressor to easily convert avi files for Apple TV. I selected the Apple TV setting in Compressor, saved it as a droplet on my desktop, but when I drag and drop the video file onto the droplet, nothing happens. The video file jus

  • Nokia 5800 XpressMusic Text Error

    Hi ,  for example  when i write a message i choose hand writing , when i write in the box nothing appears in the box ( i mean it appears in the message but it doesnt appear in the box) ,,,   and another problem , when i change the keyboard it has min

  • Sales order third party

    Hi, In third party sales order pr is generated and then the PO is done using same PR afterwards some how user managed to delete the PR from sales order  schedule lines  now  the issue is i am not able to  see the PR  number in schedule lines .because

  • What is the magic behind "recent files"?

    Hello, Usually file managers have implemented the feature to list and show recent files for quick navigation and finding. But what does "recent" exactly mean? Recently used, modified or created? I am asking because from my experience it only shows re