Problem in sending .doc file as an attachment.!

Hi SDN,
I am using FM 'SO_NEW_DOCUMENT_ATT_SEND_API1' to send a .doc file as an attachment i am filling the the table contents_hex with my internal table containing the data in hex format but the attachment coming to the SAP office inbox is not showing the actual data it's showing the file with all hex values.
can any one tell the reason?
Please give sample code if possible for sending a word file as an attachment..
Regards,
Rahul

Hi Rahul,
I am sending you the sample code I have written for TXT.
you can use the same code for .doc with small modification.
You use this code and check once and let me know.
Sample code:
Declaration:
DATA : w_name TYPE sos04-l_adr_name.
DATA: sent_to_all  LIKE  sonv-flag.
DATA:
  l_datum(10),
  ls_docdata TYPE sodocchgi1,
  lt_objpack TYPE TABLE OF sopcklsti1 WITH HEADER LINE,
  lt_objhead TYPE TABLE OF solisti1 WITH HEADER LINE,
  lt_objtxt TYPE TABLE OF solisti1 WITH HEADER LINE,
  lt_objbin TYPE TABLE OF solisti1 WITH HEADER LINE,
  lt_reclist TYPE TABLE OF somlreci1 WITH HEADER LINE,
  lt_listobject TYPE TABLE OF abaplist WITH HEADER LINE,
  l_tab_lines TYPE i,
  l_tab_lines1 TYPE i,
  l_tab_lines2 TYPE i,
  l_att_type LIKE soodk-objtp.
CONSTANTS : c_tab TYPE x VALUE '09'.     "tab delimiter between records.
CONSTANTS : c_line(2) TYPE x VALUE '0D'.
CONSTANTS : l_newline(2) TYPE x VALUE '0D0A'.        "To insert Newline.
DATA: v_str LIKE lt_objbin.
*Program logic
Main Text
  lt_objtxt = 'Dummy heading. ' .
    APPEND lt_objtxt.
    lt_objtxt = '' .
    APPEND lt_objtxt.
lt_objtxt = 'Dummy second line.'.
    APPEND lt_objtxt.
    lt_objtxt = '' .
    APPEND lt_objtxt.
    lt_objtxt = 'Regards,'.
     APPEND lt_objtxt.
    lt_objtxt = 'Field Service Team' .
    APPEND lt_objtxt.
    lt_objtxt = '----
    APPEND lt_objtxt.
lt_objtxt = 'This is system-generated email;please do not reply to this
message.'  .
    APPEND lt_objtxt.
lt_objtxt = 'If there are any questions regarding this error message'.
    APPEND lt_objtxt.
lt_objtxt = '----
    APPEND lt_objtxt.
Write Packing List (Main)
    DESCRIBE TABLE lt_objtxt LINES l_tab_lines.
    READ TABLE lt_objtxt INDEX l_tab_lines.
  ls_docdata-doc_size = ( l_tab_lines - 1 ) * 255 + STRLEN( lt_objtxt ).
    CLEAR lt_objpack-transf_bin.
    lt_objpack-head_start = 1.
    lt_objpack-head_num = 0.
    lt_objpack-body_start = 1.
    lt_objpack-body_num = l_tab_lines.
    lt_objpack-doc_type = 'RAW'.
    APPEND lt_objpack.
Create Message Attachment   "Attachmant of  file
    LOOP AT itab1.
      CONCATENATE itab1-bldat itab1-blart itab1-bukrs itab1-budat
                  itab1-monat itab1-waers itab1-xblnr itab1-bktxt
                   INTO lt_objbin SEPARATED BY c_tab .
      CONCATENATE  l_newline lt_objbin INTO lt_objbin.
      APPEND lt_objbin.
      CLEAR lt_objbin.
    ENDLOOP.
Write Packing List (Attachment)
    l_att_type = 'txt'.
    DESCRIBE TABLE lt_objbin LINES l_tab_lines.
    READ TABLE lt_objbin INDEX l_tab_lines.
    lt_objpack-doc_size = ( l_tab_lines - 1 ) * 255
                                    + STRLEN( lt_objbin ).
    lt_objpack-transf_bin = 'X'.
    lt_objpack-head_start = 1.
    lt_objpack-head_num = 0.
    lt_objpack-body_start = 1.
    lt_objpack-body_num = l_tab_lines.
    lt_objpack-doc_type = l_att_type.
    lt_objpack-obj_name = 'Header file name'.
    lt_objpack-obj_descr = 'Header file name'.
    APPEND lt_objpack.
*refresh bdclm.     "Attachemnt of second file
   CLEAR lt_objbin.
    LOOP AT bdclm.
      CONCATENATE itab2-indate itab2-intime itab2-tcode
                  itab2-longtext
                  INTO lt_objbin SEPARATED BY c_tab.
      CONCATENATE  l_newline lt_objbin INTO lt_objbin.
      APPEND lt_objbin.
      CLEAR lt_objbin.
    ENDLOOP.
    CLEAR lt_objbin.
Write Packing List (Attachment)
    l_att_type = 'txt'.
    DESCRIBE TABLE lt_objbin LINES l_tab_lines1.
    l_tab_lines2 = l_tab_lines1 - l_tab_lines.
    READ TABLE lt_objbin INDEX l_tab_lines2.
lt_objpack-doc_size = ( l_tab_lines2 - 1 ) * 255 + STRLEN( lt_objbin ).
    lt_objpack-transf_bin = 'X'.
    lt_objpack-head_start = l_tab_lines2.
    lt_objpack-head_num = 0.
    lt_objpack-body_start = l_tab_lines + 1.
    lt_objpack-body_num = l_tab_lines2.
    lt_objpack-doc_type = l_att_type.
    lt_objpack-obj_name = 'file name '.
    lt_objpack-obj_descr = 'file name '.
    APPEND lt_objpack.
Create receiver list
    lt_reclist-receiver = '[email protected]'.
    lt_reclist-rec_type = 'U'.
    APPEND lt_reclist.
Send Message
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
         EXPORTING
            document_data = ls_docdata
            put_in_outbox = 'X'
             commit_work = 'X '
*put_in_outbox = ''
        IMPORTING
            sent_to_all = sent_to_all
VALUE(NEW_OBJECT_ID) LIKE  SOFOLENTI1-OBJECT_ID
         TABLES
             packing_list = lt_objpack
             object_header = lt_objhead
             contents_bin = lt_objbin
             contents_txt = lt_objtxt
             receivers = lt_reclist
*COMMIT_WORK = X
         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.
Thanks,
Yuvaraj

Similar Messages

  • Problem in sending the file as an attachment through mail

    Hi,
    I have developed a Zreport. The functionality is like on executing this report it should send an e-mail with an attachment of the data in the xcel format.
    So, while execting this report in background mode in ECC 5.0, it is able to send the mail as an attachment but the file doesn't contain the data in it But, the same report while trying to execute in back ground mode in ECC 6.0, it is able to send the mail with the attachment and the file also has the data.
    So, my question is like are there any patches that has to be installed in ECC 5.0 system to get this successfully done.
    Thanks in advance for your answers.
    Rohith

    Hello,
    Are you using the standad sap function module or using OLE objects to generate excel?
    First try creating the excel file in foreground and see if the data is being populated.
    Kind Regards,
    Niky.

  • AOL mail doesn't send .doc-files with Firefox

    When using Firefox AOL Mail doesn't send .doc-files. Instead a corrupted file with a different size is sent. Any other file type works aswell as sending .doc-files with other browsers works...

    I'm getting a similar problem. Snow Leopard Mail for me seems to be choking on large attachments - sending them, forwarding them, or even moving them from one IMAP folder to another.
    My mails are getting through, but it takes a long time and they are dragging the whole system to a crawl in the process.

  • Problem in sending a file

    Hello..
           i have a problem in sending a file with sender file adapter...
    In adapter monitor it gives error like...
    Last message processing started 15:58:36 2005-10-04, Error: Conversion of complete file content of 'fileinput.csv' to XML format failed around position 0 with java.lang.Exception: ERROR converting document line no. 3 according to structure 'substr':java.lang.Exception: Consistency error: field(s) missing - specify 'lastFieldsOptional' parameter to allow this
    last retry interval started 15:58:36 2005-10-04
    length 60,000 secs.
    Let me know what might be the problem.
    Thanks,
    Padma

    thanks for the reply and answering my question..
             I'm getting the error in SXMB_moni...while i'm sending the file from FTP to lagacy system.
    The error is in call adapter...at says like ....
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Call Adapter
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Category>XIProtocol</SAP:Category>
      <SAP:Code area="MESSAGE">NOT_AUTHORIZED_FOR_PROC</SAP:Code>
      <SAP:P1>XXXX</SAP:P1>
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>User XXXXXX has no authorization to process messages</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    Can tell me what might be the wrong here..
    Thanks.

  • How to send a file as an attachment using mailx

    Hi
    Can any one tel me how to send a file as an attachment using mailx command in shell script.
    Thanks,
    Suman.

    Wrong forum where to ask such questions.
    Check this one link:
    http://www.unix.com/shell-programming-scripting/18370-sending-email-text-attachment-using-mailx.html?t=18370#post70254

  • How do I scan a photo to a file and then send the file as an attachment via email.

    How do I scan a photo to a file and then send the file as an attachment  via email.

    All of this depends largely on what printer /software you have, which Email client you use and to some extent which OS you are running.
    Most HP printers have HP Solution Center which is used to set up scanning,choosing where to save,etc. Once a file/photo is scanned and saved to the folder, open the folder.Select the file and at the top of the window should be the option to 'Email'.
    ******Clicking the Thumbs-Up button is a way to say -Thanks!.******
    **Click Accept as Solution on a Reply that solves your issue to help others**

  • I have to send large files like 5MB or biger via mobile phone, but in that cases phone is telling mi to plug in power. And when I do that, there is no problem to send the file. For smaller files there is no problem. How can I solve the problem? Because wh

    I have to send large files like 5MB or biger via mobile phone, but in that cases phone is telling mi to plug in power. And when I do that, there is no problem to send the file. For smaller files there is no problem. How can I solve the problem? Because when I'm not at home I can't plug in the power.

    hi,
    I am sending file from server to client i.e client will request for a file and service will send it back....... no socket connection is there...I am using JBOSS and apache axis.
    pls help me out.....
    Rashi

  • Problem in sending table to excel in attach file .

    I want to send excel file in attachment ( build from my internal table ) .
    so i use func.  SO_DOCUMENT_SEND_API1 and it's ok.
    But when i want to send line bigger than 255 characters in the attach
    i can't do so  ,
    The table "CONTENTS_BIN" is type SOLISTI1 and can get line just
    in size of 255 characters .
    is there any solution for it  ?
    i need to send 500 characters in one line .
    i use this example to send the file  :
    *& Report  YTEST_EXCEL_MAIL1                                           *
    REPORT  YTEST_EXCEL_MAIL1                       .
    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.
      DATA: LD_STORE(50) TYPE C.  "Leading zeros
    CONSTANTS: CON_CRET(2) TYPE C VALUE '0D',  "OK for non Unicode
                CON_TAB(2) TYPE C VALUE ' '.   "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.
    *Modification to retain leading zeros
      inserts code for excell REPLACE command into ld_store
      =REPLACE("00100",1,5,"00100")
    CONCATENATE '=REPLACE("' WA_CHAREKPO-EBELP '",1,5,"'
                                 WA_CHAREKPO-EBELP '")' INTO LD_STORE .
      concatenate ld_store into .xls file instead of actual value(ebelp)
        CONCATENATE WA_CHAREKPO-EBELN LD_STORE
    *End of modification
                    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.                    "send_file_as_email_attachment

    hii
    in gui_download FM which file type you have given?
    suppose i have file type as DBF so it will consider all the data as text or string so it will print that green in excel sheet.and ya it will display that green mark only to those fields who will have leading zero like for text file  for other file it will not so it will not display that green mark.
    thx
    twinkal
    Edited by: twinkal patel on Jun 11, 2008 2:27 PM

  • I bought your program to convert PDF files to WORD doc. files. I did this and when I send the files as an attachment to recipients the recipients say the attachment is blank! I want a refund!!

    I bought this Adobe program to convert PDF files to Word doc. files so I could e-mail them as an attachment to people who do not have Adobe Reader. When the people got my e-mail with the attachment and opened it. The attachment was BLANK!! Is there a way to correct this?? or should I just get my money back and cancel this program?

    Hi bogy,
    How very frustrating! I'm sorry that your email attachment was blank. I'm sure this is a silly question, but did the Word file display as expected on your own machine? If not, then the issue is quite likely with the conversion from PDF to Word (but what you describe isn't a common issue that we're hearing about).
    If it looks OK for you, then I suspect the issue lies outside of ExportPDF. If the Word doc is blank when you open it, then please tell me a bit more about the PDF that you're trying to convert and we will take it from there.
    Best,
    Sara

  • Problem to send PDF file

    Hello,
    I try to send pdf file as attachments file to mail with XI.
    I use with this blog
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6d967fbc-0a01-0010-4fb4-91c6d38c5816
    My problems is:
    1. to all mails that I send have another e file Untiteld.doc, how I can avoid this file?
    2. When I received the pdf file I not succeed to open it I received the message:
    Adobe reader could not open 'elad.pdf' because it is either not supported
    File type or because the file has been damaged (for example, it was sent as an
    Email attachment and wasn't correctly decoded)
    Regards
    Elad Peleg

    hi
    ref this
    Receiver Mail Adapter message with PDF attachment
    PDF attachment in mail adapter
    File adapter with attachment to mail
    File with attachment to mail scenario
    File To Mail Scenario With An Attachment

  • Excel 2007 Problems while sending E-Mail with Excel Attachment

    Hello all,
    i wrote a small WD application for uploading a file and sending this file
    vie e-mail to some recipients.
    I'm using class "cl_document_bcs". No problem with ".doc", ".pdf", also no problem
    with ".xls" files generated by old Excel version. But when generating an .xls document with
    Excel 2007, the attached file is not readable (just non usable signs).
    For attaching the .xls file i use:
      TRY.
          lr_attachment =  cl_document_bcs=>create_document(
              i_type        = lv_filetype " --> 'XLS'
              i_subject     = 'excel document'
              i_hex         = lt_file_solix
        CATCH cx_document_bcs .
      ENDTRY.
    Are there any restrictions regarding Excel 2007?
    The data element of i_type is just char3, so XLSX
    wouldn't be possible.

    hello Christopher Linke ,
    if you Programatically generation a excel file and you have 2007 version you can use OLE automation to save file as .xls i.e. a 2003 work book ..
    if you have a excel file ready and you just want to send it across the you will have to convert the xlsx to xls and then send it you can do this as well using OLE automation
    (in 2007 in SAVE AS option you can save it excel 97 2003 workbook)
    Edited by: Anup Deshmukh on Mar 3, 2010 3:38 PM

  • How to send PDF file as an attachment in email?

    Hi Folks,
    I have successfully configured SMTP and by now I can successfully send normal text messages along with .TXT files. However, when I am trying to send an email along with .pdf file as an attachment, I am getting the mail in my inbox, but I cannot open the .pdf file! I am getting the following Acrobat error:
    Acrobat could not open 'abc.pdf' because it is either not a supported file type or because the file has been corrupted
    Can any help me in solving this problem?
    Thanks in advance
    Regards,
    Faisal

    Hi Vajha,
    Thanks alot for your kind reply. I also express my apologies for responding to your reply lately.
    I beleive all the links you have sent me are talking about ABAP coding. what I am interested in is,
    is there any configuration that I am missing in SCOT (Basis side)?
    Since I am not an ABAPER, so I carry out these activities.
    Can anyone please answer the following queries of mine:
    1. Can't we send any PDF attachment in a mail from R/3?
    2. Do we have to do it through coding only?
    3. In scot we have option "All formats except fllw". But it does not work for me. Any inputs?
    Thanks in advance.
    Regards,
    Faisal

  • Send text file as an attachment

    Hi All,
    We have a requirement wherein we need to send the contents of an
    internal table in a text pipe delimited file as an attachment in to an
    external mail id.
    The problem is that the total record length of the internal table is
    around 450 char while the structure SOLI accepts only 255 char.
    This causes the record to be split into 2 lines.
    Is it possible to send the entire 450 char in one line? If yes, how can
    this be done?
    Thanks,
    fractal

    I think u shd use this FM for line width change:-
    CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
       EXPORTING
         LINE_WIDTH_SRC                    = 134 "ur source width
         LINE_WIDTH_DST                    = 255
        TRANSFER_BIN                      = ' '
        TABLES
          CONTENT_IN                        = GT_PDF  "ur itab name
          CONTENT_OUT                       = LT_ATT
      EXCEPTIONS
        ERR_LINE_WIDTH_SRC_TOO_LONG       = 1
        ERR_LINE_WIDTH_DST_TOO_LONG       = 2
        ERR_CONV_FAILED                   = 3
        OTHERS                            = 4

  • Problem in sending mail with a xls attachment

    Hi,
    I have a problem in a program that I created.
    The program sends a email via internet to user with a excel attachment.
    In SOST its showing as a file with .xls attachment which opens in MS excel.
    But the actual mail which the user gets is a .dat file
    what can be the reason
    Edited by: ANURAG GOGOI on Oct 23, 2008 1:55 PM

    Anurag:
    You need to set the DOC_TYPE value to 'XLS' in the packing List header (structure SOPCKLSTI1).
    Note: The 'XLS' value isn't listed as a possible value in the domain value list for DOC_TYPE, but it will be allowed.
    Regards,
    D.

  • How to send doc files from one system to another using XI

    Hi All,
    I have a requirement to pick the word doc files from one file system and send these word document files to ECC system place in ECC application server.Can we achieve this requirement using XI. If so how we can do this. also let me know can we convert these doc files into proxy and send to ECC?. Please let me know. Thanks.
    Regards,
    Rajesh

    Yes You Can
    XI Converts Unstructured data(That is non -XML)Type- in your case word doc and maps it to Target structure.
    You can either use content conversion
    /people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
    /people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2
    /people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30
    /people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
    /people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
    /people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns
    /people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem
    /people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
    You can either built a adaptermodule for the same(U nedd to have Some Java knowledge)
    You can also convert without creating any objects in integration directory link for the same is
    /people/william.li/blog/2006/09/08/how-to-send-any-data-even-binary-through-xi-without-using-the-integration-repository
    ***********Please Reward Points If find Helpful*********

Maybe you are looking for