Send attachment which can be opened in excel

Hello
I have an internal table, i want to send that through email (external) as an attachment
the attachment should be such that it can be opened in excel file. (.xls or tab delimited .txt)
I would be very thankful if someone can send me a sample code or guide me, how to use 'SO_DOCUMENT_SEND_API1' (may be)
Regards
Manu

hi,
"data decleration
DATA: docdata LIKE sodocchgi1,
      objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,      " internal tables declared for sending attachments to the mail
      objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
      objbin1 LIKE solisti1 OCCURS 10 WITH HEADER LINE,
      objbin2 LIKE solisti1 OCCURS 10 WITH HEADER LINE,
      objin3 LIKE solisti1 OCCURS 0 WITH HEADER LINE,
      objbin_final LIKE solisti1 OCCURS 10 WITH HEADER LINE,
      reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE,
      tab_lines TYPE sy-tabix.
  IF p_sender EQ space.
    gd_sender_type = space.
  ELSE.
    gd_sender_type = 'INT'.
  ENDIF.
*Body
  docdata-obj_name = 'Mail_Excel_File'.
  docdata-obj_descr = 'Excel file attachment'.
  objtxt = 'Attached is the sample Excel file'.
  APPEND objtxt.
  DESCRIBE TABLE objtxt LINES tab_lines.
  READ TABLE objtxt INDEX tab_lines.
  docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
  CLEAR objpack-transf_bin.
  objpack-head_start = 1.
  objpack-head_num = 0.
  objpack-body_start = 1.
  objpack-body_num = tab_lines.
  objpack-doc_type = 'RAW'.
  APPEND objpack.
*Attachment
  n = 1.                                    "for sending 1st attachment
  DESCRIBE TABLE objbin1 LINES tab_lines.
  objpack-doc_size = tab_lines * 255.
  objpack-transf_bin = 'X'.
  objpack-head_start = 1.
  objpack-head_num = 1.
  objpack-body_start = n.
  objpack-body_num = tab_lines.
  objpack-doc_type = 'XLS'.
  docdata-obj_name = 'Excel_File_Attachment1'.
  objpack-obj_descr = 'Excel File Attachment1'.
  APPEND objpack.
  n = n + tab_lines.                       "for sending 2nd attachment
  DESCRIBE TABLE objbin2 LINES tab_lines.
  objpack-doc_size = tab_lines * 255.
  objpack-transf_bin = 'X'.
  objpack-head_start = 1.
  objpack-head_num = 1.
  objpack-body_start = n.
  objpack-body_num = tab_lines.
  objpack-doc_type = 'XLS'.
  docdata-obj_name = 'Excel_File_Attachment2'.
  objpack-obj_descr = 'Excel File Attachment2'.
  APPEND objpack.
  n = n + tab_lines.                       "for sending 3rd attachment
  DESCRIBE TABLE objin3 LINES tab_lines.
  objpack-doc_size = tab_lines * 255.
  objpack-transf_bin = 'X'.
  objpack-head_start = 1.
  objpack-head_num = 1.
  objpack-body_start = n.
  objpack-body_num = tab_lines.
  objpack-doc_type = 'XLS'.
  docdata-obj_name = 'Excel_File_Attachment3'.
  objpack-obj_descr = 'Excel File Attachment3'.
  APPEND objpack.
*Create the list of recipients
  reclist-receiver = p_email1.
  reclist-rec_type = 'U'.
  reclist-express = 'X'.
  APPEND reclist.
*Send the e-mail by using this function module
  CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
      document_data              = docdata
      put_in_outbox              = 'X'
      commit_work                = 'X'
    TABLES
      packing_list               = objpack
      contents_bin               = objbin_final
      contents_txt               = objtxt
      receivers                  = 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.
hope this helps
regards
RItesh

Similar Messages

  • Can't open an excel spreadsheet attached to an s-mail - hotmail

    can't open an excel attachment to an e-mail v -- hotmail
    == This happened ==
    Just once or twice
    == only moved to firefox two days ago

    Ok,
    First Rick.
    When I get to the box where the choice of skins are, right
    above it, the choices are:
    Section 508 Compliant Output
    W3C Compliant Topics
    I double checked RoboHelps Help...and it says Robohelp for
    Word 6, Build 99.
    Colum...
    Here's what I did (I 'thought', I'd start off simple, lol)...
    1. Start Robo.
    2. Select New Project.
    3. The left panel contains all of the folders (I think its
    called Explorer).
    The right panel is the default Helpfile word document that
    contains the 'welcome' message.
    4. I added my spreadsheet to the Baggage folder.
    5. Back at the word document, I just added a simple word
    'excel'.
    6. Then I highlighted 'excel', Insert->Hyperlink...and
    pointed it to my excel spreadsheet.
    7. Saved it.
    8. Generated it.
    Everything opens up fine in IE. Excel is highlighted blue and
    underlined. But its not clickable.
    Doug

  • Is iWork's compatible with excel?  Can I create an iWork's spreadsheet that can be opened in excel?

    Is iWork's compatible with excel?  Can I create an iWork's spreadsheet that can be opened in excel?

    You will need to export it as an Excel spreadsheet.

  • When I install adobe acrobat XI PRO, it converts everything on my computer to an adobe icon, and when I try to open it, it open adobe acrobat. For example, I can't open word, excel, internet explorer, or any other document or program because it thinks its

    When I install adobe acrobat XI PRO, it converts everything on my computer to an adobe icon, and when I try to open it, it open adobe acrobat. For example, I can't open word, excel, internet explorer, or any other document or program because it thinks its acrobat.

    Hi Kate,
    Please refer to this KB doc. for the solution Application, file icons change to Acrobat/Reader icon
    Let me know if the issue persist.
    Regards,
    Aadesh

  • Can't open any excel files after installing Snow Leopard

    I can't open any excel files after installing Snow Leopard. Is anyone else having this problem?
    I have a standard iWork '08 install. Has anyone experienced? And better yet, know of a fix?

    Welcome to Apple Discussions
    Most users who have had a problem opening Office files with the iWork apps after upgrading to Snow Leopard have the problem fixed by updating to the latest versions. For iWork '08 that is Pages 3.0.3 & Numbers 1.0.3. For iWork '09 it's Pages 4.0.2 & Numbers 2.0.2. I don't use Keynote, but it should also be updated. If you're not running the latest versions & Software Update says your software is up to date, make sure the applications are where the installer initially put them. The updaters are very picky. If the location is not where the updater is programmed to look or if the folder doesn't have the name the updater looks for, it will not work. The applications cannot be renamed or moved. They must be in the iWork '08 or iWork '09 folder in Applications. That iWork folder must be named iWork '08 or iWork '09. If it doesn't have the '08 or '09 Software Update won't find them & the updaters won't work.

  • Can't open microsft excel or word in my apple macbook pro

    can't open microsft excel or word in my apple macbook pro.it is mirosfot 2011. it was all working fine till last saturday but suddenly today i can't open files and message comes that unexpectedly quit. pls open and message will be sent to apple

    help pls...anybody there to help

  • Can I open an excel spreadsheet in NUMBERS complete with formulas?

    Can I open an excel spreadsheet in NUMBERS complete with formulas?

    Problem solved.  I find that the excel file I was trying to convert was an .xlsx version and when I resaved it as an .xls file, I was then able to open it in NUMBERS complete with formulas.

  • After I Update to IOS 7.1 I can't open the excel file attached in  my email

    After I updated my Iphone 5s from IOS7.0.6 to IOS7.1 when i check my email i can't open excel file attached in my email i check with my frineds phone thy have same issoue

    David_PDX wrote:
    Hi Alex,
    The trick to this whole thing is to scroll to the bottom of the message. There should be a dashed line at the bottom of the email message with text underneath it that says, "This message was downloaded as plain text." Underneath that it should say (in blue hyperlink text) "Download full message". Select that hyperlink, and the Excel file should download completely. You should then be able to select the document and have it open correctly.
    I have had the same concern regardless of file format that is sent, so I do not believe your issue is with file format. Hope this helps.
    I've seen the same thing happen with images, which it displays in a corrupted form. It's fixed by downloading the full message.
    There's a more serious side effect of this, which I've now seen with several types of files. If one FORWARDS the email to someone else, the attached files it sends them are CORRUPTED and unopenable too. In the case of a Word files I looked at, it had dropped the last two bytes of the file.
    The workaround for that is to download the full message before forwarding.
    I'm seeing this happening with so many types of attachments that I'm assuming it affects them all. Please everyone report this to Apple feedback (http://www.apple.com/feedback/). It's one thing not being able to open a file on your device, it's another to have files corrupted permanently just by forwarding.

  • I can not open an Excel Spreadsheet

    I purchased my MacPro last November. I loaded NUMBERS on my macnine as well as PAGES, and KEYNOTE. I was determined to learn these programs and not rely on using MS OFFICE on my Mac. The rest of my office is still using PC/s and therefore when I am sent a document, it is with MS OFFICE. Up until the first of March, I was able to access all documents sent to me, but sometime in March, EXCEL files sent to me gets an error message:
    This document was created with an unsupported version of Excel. Only documents created with Excel ’97 or later can be opened.
    It seems to associate to the upgrade that came out for LION during that month. I have tried everything. My office has tried sending in every format without success. WHAT CAUSED THE CHANGE???
    I would appreciate any help that I can get.
    JACK

    just one specific app? which one? what happens when you tap on the app to open it?

  • How can I open an Excel template on the BPC 7.0 MS server?

    We would like to open an Excel template which is stored in the BPC 7.0 MS server.
    We could do that by using EVMNU("OPENFILE", "Open", "Input Schedules/HQ/H01 Currency Input.xlt")
    in OutlookSoft 4.2 environment, but we cannot do the same thing in BPC 7.0 MS SP7 environment.
    In BPC 7.0 MS, we can open the Excel template on the client PC only...
    Regards,
    Hiroshi Yaji

    Hi Hiroshi,
    Are you trying to open the template from a custom menu?
    You can open the templates on the server from the client system by going to data input and selecting "open an existing schedule". This will list you the templates available on the server.
    However, for the general purpoe, you can use the following MNU commands
    MNU_eTOOLS_OPENSTANDARD: opens the report template library
    MNU_eSUBMIT_OPENSTANDARD: opens the input schedule library
    MNU_eSUBMIT_OPENMY: opens my schedule folder
    Hope this helps.

  • Excel 2011 can't open old Excel 98 and Excel X files

    I have lots of old Excel workbooks that were created on my Mac that go back at least as far as 1999. They were created in 1998 Excel 8.0 (from Office 98), 2000 Excel 9.0 (from Office 2001), and 2001 Excel 10.0 (from Office v.X) (I'm assuming these were the versions I used way back then because I have always used Office since the beginning of time.) Excel 2011 will not open these files. When I try to open these files, I get the message:
    Excel could not open [filename] because some content is unreadable. Do you want to open and repair this workbook? If excel cannot repair the file, some data may be lost.
    If I click Open and Repair, Excel hangs.
    Of course, being a Mac user since 1983, these files do not have those ugly extensions hanging on the file name, but that really isn't the problem. I can add extensions (like .xls) to the file name, which changes the appearance of the icon, but Excel still hangs when trying to Open and Repair these files.
    Can someone explain what the problem is?

    Some of those are pretty ancient!
    Did you ever install the converter?
    Mac users using Word 2004 who receive a Word 2008 for Mac, (or Word 2007 for Windows) document, will not be able to read this without having the Open XML Converter installed, which can be downloaded from Microsoft.
    Go to this page:
    http://www.microsoft.com/mac/downloads.mspx
    and click on the right under Most Popular, 'Open XML File Format Converter for Mac 1.0.2'
    This opens a window at the bottom of the page. Scroll that to the bottom and click on English.dmg, and it will download for you as a disk image, which can be installed in the usual way.
    After installation you can open and read .xml formatted Word 2008 documents in Word 2004.
    Update: This link  http://support.microsoft.com/kb/976831  takes you to a newer version 1.1.3 (released Nov 10, 2009).

  • Can't open any Excel files.

    When I double click on an Excel icon to open a spreadsheet, Excel open to a blank page.
    Once I have Excel open, I can search for the file from within the programme and it opens fine. If I then do a "save as", and try to re-open the file from the desktop location, it still will not open.
    This has happened since installing Office 365
    What do I do now??

    Hi ErickWB,
    I agree with Michiel’s suggestion, and we can also try the methods below.
    1. Try uncheck the Ignore Other Applications that use Dynamic Data Exchange (DDE).
    Click File > Options > Advanced > General Section > Tick the option "Ignore other application that use Dynamic Data Exchange"
    http://support.microsoft.com/kb/211494/
    2. Choose Run and enter Excel.exe /regserver
    This will cause Excel to start up, re-register all of its registry keys, then quit. Now, try opening your Excel files.
    Best regards,
    Greta Ge
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Office 2013 can't open word, excel files from the network after upgrade to 8.1

    Hello,
    Recently, I upgraded all PCs from WIN 8 to Win 8.1. After the upgrade I noticed that I can't open any word documents and excel files. Before the upgraded I have no problem opened any files. All PCs have over 500GB free space on hard drive. Other PCs that
    run Win 7 have no problem open them only the one with Win 8.1. This is what I got:
    I right click--> property and there is no unblocked. All files resided on the network server.
    Please help.
    Jimmy

    Hi Jimmy,
    Did you get any error message when you try to open an Excel file/Word document?
    If so, you can post the error message and  event log here.Also ,if you had antivirus software installed, try to disable them to test this issue.
    In addition, what happens if you add the network server location as a trusted location?
    Wind Zhang
    TechNet Community Support

  • Can't open Word Excel or Powerpoint since upgrade to Yosemite

    Since upgrading to Yosemite I am unable to open Word Excel and Powerpoint

    I'm not sure if you exactly mean what you mean.
    Are you not able to save an attachement or are you not able to download a file?
    For the first case: is the attachement showing up in Mail? If so, what happens when simply clicking on the attachement?
    For the second case: check your download-location configured in Safari to ensure you save to a directory available for write-access.

  • Downloaded latest version of Firefox and now can't open any Excel files

    The problem started right after I downloaded the latest version of Firefox (4?). When I try to open my Excel files I get a Windows error message and then it says that Excel can not find the file.

    A possible cause is security software (firewall) that blocks or restricts Firefox or the plugin-container process without informing you, possibly after detecting changes (update) to the Firefox program.
    Remove all rules for Firefox from the permissions list in the firewall and let your firewall ask again for permission to get full unrestricted access to internet for Firefox and the plugin-container process.
    See:
    * https://support.mozilla.com/kb/Server+not+found
    * https://support.mozilla.com/kb/Firewalls
    * http://kb.mozillazine.org/Browser_will_not_start_up

Maybe you are looking for

  • Why did you break my phone w/ kitkat?

    Last week I loved my phone.  Since 4.4.2 update I'm about ready to throw it away. There are so many backward steps in the kit kat update I don't know where to begin... Someone decided customers would accept Swype substitutes.  I disagree.  Google key

  • Installing oracle 10gr2 and applying 10.2.0.3 patchset on sun sparc 64bit

    dear all, im planning to install oracle 10gr2 on sun solaris sparc(64bit). kindly provide the steps specific to configuring kernal parameters. details: On Solaris 10 sparc 64-bit uname -r 5.10 provide the steps to configure the kernal parameters with

  • Enabling the Perfomance Management for the first time

    Hi All , we have to enable the SAP standard functionality of peformance management on ESS MSS on portal ,i need the kick start steps to enable this functionaly and if there are useful documents that i can follow, i would need to know the staeps to be

  • JDWP exit error JVMTI_ERROR_INVALID_CLASS(21)

    I encounter a problem when I shutdown the (Plugin) tomcat5Server in MyEclipse6.5. My JDK is 1.5.17. The message shown in console is as follows: FATAL ERROR in native method: JDWP on getting class status, jvmtiError=JVMTI_ERROR_INVALID_CLASS(21) JDWP

  • Error #2032 attemting to set base rates

    When I select "set base rates" I immediately get a dialog box with  "RSL error 1 of 2  Error #2032"  with no further explanation.  I turned off (complertely) Windows Firewall - problem persists.  No further hints as to what's up.  Win 2K8 R2 w/ vChar