<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Excel Format Unrecognized in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/excel-format-unrecognized/m-p/2581322#M590263</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've managed to download data from internal table to excel using SO_NEW_DOCUMENT_ATT_SEND_API1 but once I open the file it prompted a message saying that the file is not recognizable. What did I do wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Jul 2007 02:09:09 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-24T02:09:09Z</dc:date>
    <item>
      <title>Excel Format Unrecognized</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/excel-format-unrecognized/m-p/2581322#M590263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've managed to download data from internal table to excel using SO_NEW_DOCUMENT_ATT_SEND_API1 but once I open the file it prompted a message saying that the file is not recognizable. What did I do wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 02:09:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/excel-format-unrecognized/m-p/2581322#M590263</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T02:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: Excel Format Unrecognized</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/excel-format-unrecognized/m-p/2581323#M590264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;Check these links&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="134618"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;mahesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 02:29:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/excel-format-unrecognized/m-p/2581323#M590264</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T02:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: Excel Format Unrecognized</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/excel-format-unrecognized/m-p/2581324#M590265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I open the excel file the "unrecognized" message prompted out, I clicked 'OK' and data in the file turns out fine. How do I get rid of the message from popping out?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 02:35:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/excel-format-unrecognized/m-p/2581324#M590265</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T02:35:05Z</dc:date>
    </item>
    <item>
      <title>Re: Excel Format Unrecognized</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/excel-format-unrecognized/m-p/2581325#M590266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can anyone help?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 07:44:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/excel-format-unrecognized/m-p/2581325#M590266</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T07:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: Excel Format Unrecognized</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/excel-format-unrecognized/m-p/2581326#M590267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the same problem and until now I don't know how to solve it.&lt;/P&gt;&lt;P&gt;When I open the original attachment I get the same error message "The file is not in a recognizable format" from excel.&lt;/P&gt;&lt;P&gt;When I save the attachment in a new file within excel the message disapears when reopening this xls-file.&lt;/P&gt;&lt;P&gt;Comparing both excel files one can see the difference with a hex editor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the original attachment every sign is separated by hex null.&lt;/P&gt;&lt;P&gt;E.g. the word 'Document':&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The original attachment has the hex code as it is created from a unicode system:&lt;/P&gt;&lt;P&gt;44 00 6F 00 63 00 75 00 6D 00 65 00 6E 00 74 00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;whereas the saved excel file has the the hex code:&lt;/P&gt;&lt;P&gt;44 6F 63 75 6D 65 6E 74&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I 'delete' the unicode hex 00 between every sign before sending the attachment?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Georg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My coding: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TOP-Include&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Mail&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;data: gt_message      type table of solisti1,&lt;/P&gt;&lt;P&gt;      gs_message      type solisti1,&lt;/P&gt;&lt;P&gt;      gs_doc_data     type sodocchgi1,&lt;/P&gt;&lt;P&gt;      gt_packing_list type table of sopcklsti1,&lt;/P&gt;&lt;P&gt;      gs_packing_list type sopcklsti1,&lt;/P&gt;&lt;P&gt;      gt_attachment   type table of solisti1,&lt;/P&gt;&lt;P&gt;      gs_attachment   type solisti1,&lt;/P&gt;&lt;P&gt;      gt_receivers    type table of somlreci1,&lt;/P&gt;&lt;P&gt;      gs_receivers    type somlreci1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  build_xls_data_table&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;form build_xls_data_table .&lt;/P&gt;&lt;P&gt;  class cl_abap_char_utilities definition load.&lt;/P&gt;&lt;P&gt;  constants:&lt;/P&gt;&lt;P&gt;         con_line type c value cl_abap_char_utilities=&amp;gt;newline,       "Hex '0A'&lt;/P&gt;&lt;P&gt;         con_tab  type c value cl_abap_char_utilities=&amp;gt;horizontal_tab,"Hex '09'&lt;/P&gt;&lt;P&gt;         con_cret type c value cl_abap_char_utilities=&amp;gt;cr_lf.         "Hex '0D'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get data for attachment&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  perform build_exdn_data tables gt_xls.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Table header&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  concatenate 'Document-ID' 'barcode'  'fieldname'  'old value' 'new value'&lt;/P&gt;&lt;P&gt;   into gs_attachment separated by con_tab.&lt;/P&gt;&lt;P&gt;  condense gs_attachment.&lt;/P&gt;&lt;P&gt;  append gs_attachment to gt_attachment.&lt;/P&gt;&lt;P&gt;  clear: gs_attachment.&lt;/P&gt;&lt;P&gt;  concatenate con_cret gs_attachment into gs_attachment.&lt;/P&gt;&lt;P&gt;  append gs_attachment to gt_attachment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;get table data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  clear: gs_attachment.&lt;/P&gt;&lt;P&gt;  loop at gt_xls into gs_xls.&lt;/P&gt;&lt;P&gt;    concatenate gs_xls-documentid&lt;/P&gt;&lt;P&gt;                gs_xls-barcode&lt;/P&gt;&lt;P&gt;                 gs_xls-fieldname&lt;/P&gt;&lt;P&gt;                gs_xls-value_old&lt;/P&gt;&lt;P&gt;                gs_xls-value_new&lt;/P&gt;&lt;P&gt;               into gs_attachment separated by con_tab.&lt;/P&gt;&lt;P&gt;    concatenate con_cret con_line gs_attachment  into gs_attachment.&lt;/P&gt;&lt;P&gt;    condense gs_attachment.&lt;/P&gt;&lt;P&gt;    append gs_attachment to gt_attachment.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " build_xls_data_table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form send_file_as_email_attachment .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data: lv_tablines    type p,&lt;/P&gt;&lt;P&gt;        lv_fieldlen    type p,&lt;/P&gt;&lt;P&gt;        lv_attachlines type p,&lt;/P&gt;&lt;P&gt;        lv_attachlen   type p,&lt;/P&gt;&lt;P&gt;        lv_sent_all(1) type c.&lt;/P&gt;&lt;P&gt;  clear: lv_tablines, lv_fieldlen, lv_attachlines, lv_attachlen, lv_sent_all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Message has been writen in gt_message.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Fill docment data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  gs_doc_data-obj_name   = 'EMAIL'.&lt;/P&gt;&lt;P&gt;  concatenate 'Message' gv_datum gv_zeit&lt;/P&gt;&lt;P&gt;       into gs_doc_data-obj_descr separated by space.&lt;/P&gt;&lt;P&gt;  gs_doc_data-obj_langu  = sy-langu.&lt;/P&gt;&lt;P&gt;  gs_doc_data-obj_expdat = sy-datum.&lt;/P&gt;&lt;P&gt;  gs_doc_data-sensitivty = 'F'.&lt;/P&gt;&lt;P&gt;  gs_doc_data-no_change  = 'X'.&lt;/P&gt;&lt;P&gt;  describe field gs_message-line length lv_fieldlen in byte mode.&lt;/P&gt;&lt;P&gt;  describe table gt_message lines lv_tablines.&lt;/P&gt;&lt;P&gt;  multiply lv_fieldlen by lv_tablines.&lt;/P&gt;&lt;P&gt;  gs_doc_data-doc_size = lv_fieldlen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Fill packing list for message text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  clear: gt_packing_list[].&lt;/P&gt;&lt;P&gt;  gs_packing_list-transf_bin = space.&lt;/P&gt;&lt;P&gt;  gs_packing_list-head_start = 1.&lt;/P&gt;&lt;P&gt;  gs_packing_list-head_num   = 0.&lt;/P&gt;&lt;P&gt;  gs_packing_list-body_start = 1.&lt;/P&gt;&lt;P&gt;  describe table gt_message lines gs_packing_list-body_num.&lt;/P&gt;&lt;P&gt;  gs_packing_list-doc_type   = 'RAW'.&lt;/P&gt;&lt;P&gt;  append gs_packing_list to gt_packing_list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Fill packing list for attachment&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;attachment is in table gt_attachment&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  gs_packing_list-transf_bin = 'X'.&lt;/P&gt;&lt;P&gt;  gs_packing_list-head_start = 1.&lt;/P&gt;&lt;P&gt;  gs_packing_list-head_num   = 1.&lt;/P&gt;&lt;P&gt;  gs_packing_list-body_start = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  describe field gs_attachment-line length lv_attachlen in byte mode.&lt;/P&gt;&lt;P&gt;  describe table gt_attachment lines lv_attachlines.&lt;/P&gt;&lt;P&gt;  gs_packing_list-body_num   = lv_attachlines.&lt;/P&gt;&lt;P&gt;  gs_packing_list-doc_type   =  'XLS'.&lt;/P&gt;&lt;P&gt;  gs_packing_list-obj_name   =  'attchement'.&lt;/P&gt;&lt;P&gt;  concatenate 'File_' gv_datum '_' gv_zeit '.xls'&lt;/P&gt;&lt;P&gt;      into gs_packing_list-obj_descr.&lt;/P&gt;&lt;P&gt;  multiply lv_attachlen by lv_attachlines.&lt;/P&gt;&lt;P&gt;  gs_packing_list-doc_size   =  lv_attachlen.&lt;/P&gt;&lt;P&gt;  append gs_packing_list to gt_packing_list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Hinzufügen der Empfänger-e-Mail-Adresse&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  clear: gt_receivers[], gs_receivers.&lt;/P&gt;&lt;P&gt;  gs_receivers-receiver = p_addr.&lt;/P&gt;&lt;P&gt;  gs_receivers-rec_type = 'U'.&lt;/P&gt;&lt;P&gt;  append gs_receivers to gt_receivers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'&lt;/P&gt;&lt;P&gt;    exporting&lt;/P&gt;&lt;P&gt;      document_data              = gs_doc_data&lt;/P&gt;&lt;P&gt;      put_in_outbox              = 'X'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     sender_address             = 'WF-BATCH'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     sender_address_type        = 'B'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      commit_work                = 'X'&lt;/P&gt;&lt;P&gt;    importing&lt;/P&gt;&lt;P&gt;      sent_to_all                = lv_sent_all&lt;/P&gt;&lt;P&gt;    tables&lt;/P&gt;&lt;P&gt;      packing_list               = gt_packing_list&lt;/P&gt;&lt;P&gt;      contents_bin               = gt_attachment&lt;/P&gt;&lt;P&gt;      contents_txt               = gt_message&lt;/P&gt;&lt;P&gt;      receivers                  = gt_receivers&lt;/P&gt;&lt;P&gt;    exceptions&lt;/P&gt;&lt;P&gt;      too_many_receivers         = 1&lt;/P&gt;&lt;P&gt;      document_not_sent          = 2&lt;/P&gt;&lt;P&gt;      document_type_not_exist    = 3&lt;/P&gt;&lt;P&gt;      operation_no_authorization = 4&lt;/P&gt;&lt;P&gt;      parameter_error            = 5&lt;/P&gt;&lt;P&gt;      x_error                    = 6&lt;/P&gt;&lt;P&gt;      enqueue_error              = 7&lt;/P&gt;&lt;P&gt;      others                     = 8.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;endform.                    " send_file_as_email_attachment&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2007 10:36:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/excel-format-unrecognized/m-p/2581326#M590267</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-28T10:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: Excel Format Unrecognized</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/excel-format-unrecognized/m-p/2581327#M590268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi *&lt;/P&gt;&lt;P&gt;I finaly found a solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of transfering the attachment as text-table to the FM SO_NEW_DOCUMENT_ATT_SEND_API1 just convert the table before to a hex-table and pass this over to the FM.&lt;/P&gt;&lt;P&gt;For the conversion use FM 'SCMS_STRING_TO_XSTRING' and use as mime type 'APPLICATION/MSEXCEL; charset=UTF-8', Important is UTF-8 as charset!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Find below the coding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;Georg-Stefan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TOP-Include&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Mail&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;data: gt_message type table of solisti1,&lt;/P&gt;&lt;P&gt;gs_message type solisti1,&lt;/P&gt;&lt;P&gt;gs_doc_data type sodocchgi1,&lt;/P&gt;&lt;P&gt;gt_packing_list type table of sopcklsti1,&lt;/P&gt;&lt;P&gt;gs_packing_list type sopcklsti1,&lt;/P&gt;&lt;P&gt;gt_attachment type table of solisti1,&lt;/P&gt;&lt;P&gt;gs_attachment type solisti1,&lt;/P&gt;&lt;P&gt;gt_x_attachment type table of solix,&lt;/P&gt;&lt;P&gt;gs_x_attachment type solix,&lt;/P&gt;&lt;P&gt;gt_receivers type table of somlreci1,&lt;/P&gt;&lt;P&gt;gs_receivers type somlreci1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: lv_mime_type type c value 'APPLICATION/MSEXCEL; charset=UTF-8',&lt;/P&gt;&lt;P&gt;        lv_row_text type string,&lt;/P&gt;&lt;P&gt;        lv_row_hex  type xstring.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear: gs_attachment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  loop at gt_attachment into gs_attachment.&lt;/P&gt;&lt;P&gt;    move gs_attachment to lv_row_text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    call function 'SCMS_STRING_TO_XSTRING'&lt;/P&gt;&lt;P&gt;      exporting&lt;/P&gt;&lt;P&gt;        text     = lv_row_text&lt;/P&gt;&lt;P&gt;        mimetype = lv_mime_type&lt;/P&gt;&lt;P&gt;      importing&lt;/P&gt;&lt;P&gt;        buffer   = lv_row_hex.&lt;/P&gt;&lt;P&gt;    move lv_row_hex to gs_x_attachment-line.&lt;/P&gt;&lt;P&gt;   append gs_x_attachment to gt_x_attachment.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &amp;#133;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; form send_file_as_email_attachment .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data: lv_tablines    type p,&lt;/P&gt;&lt;P&gt;        lv_fieldlen    type p,&lt;/P&gt;&lt;P&gt;        lv_attachlines type p,&lt;/P&gt;&lt;P&gt;        lv_attachlen   type p,&lt;/P&gt;&lt;P&gt;        lv_sent_all(1) type c.&lt;/P&gt;&lt;P&gt;  clear: lv_tablines, lv_fieldlen, lv_attachlines, lv_attachlen, lv_sent_all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Mainmessage is in gt_message.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Fill docment data &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  gs_doc_data-obj_name   = 'EMAIL'.&lt;/P&gt;&lt;P&gt;  concatenate 'Report from ' gv_datum gv_zeit&lt;/P&gt;&lt;P&gt;       into gs_doc_data-obj_descr separated by space.&lt;/P&gt;&lt;P&gt;  gs_doc_data-obj_langu  = sy-langu.&lt;/P&gt;&lt;P&gt;  gs_doc_data-obj_expdat = sy-datum.&lt;/P&gt;&lt;P&gt;  gs_doc_data-sensitivty = 'F'.&lt;/P&gt;&lt;P&gt;  gs_doc_data-no_change  = 'X'.&lt;/P&gt;&lt;P&gt;  describe field gs_message-line length lv_fieldlen in byte mode.&lt;/P&gt;&lt;P&gt;  describe table gt_message lines lv_tablines.&lt;/P&gt;&lt;P&gt;  multiply lv_fieldlen by lv_tablines.&lt;/P&gt;&lt;P&gt;  gs_doc_data-doc_size = lv_fieldlen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Fill packing list for message&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  clear: gt_packing_list[].&lt;/P&gt;&lt;P&gt;  gs_packing_list-transf_bin = space.&lt;/P&gt;&lt;P&gt;  gs_packing_list-head_start = 1.&lt;/P&gt;&lt;P&gt;  gs_packing_list-head_num   = 0.&lt;/P&gt;&lt;P&gt;  gs_packing_list-body_start = 1.&lt;/P&gt;&lt;P&gt;  describe table gt_message lines gs_packing_list-body_num.&lt;/P&gt;&lt;P&gt;  gs_packing_list-doc_type   = 'RAW'.&lt;/P&gt;&lt;P&gt;  append gs_packing_list to gt_packing_list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Fill packing list for attachment&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The attachment is in table gt_x_attachment&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  gs_packing_list-transf_bin = 'X'.&lt;/P&gt;&lt;P&gt; gs_packing_list-head_start = 1.&lt;/P&gt;&lt;P&gt;  gs_packing_list-head_num   = 1.&lt;/P&gt;&lt;P&gt;  gs_packing_list-body_start = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  describe field gs_attachment-line length lv_attachlen in byte mode.&lt;/P&gt;&lt;P&gt;  describe table gt_attachment lines lv_attachlines.&lt;/P&gt;&lt;P&gt;  gs_packing_list-body_num   = lv_attachlines.&lt;/P&gt;&lt;P&gt;  gs_packing_list-doc_type   =  'XLS'.&lt;/P&gt;&lt;P&gt;  gs_packing_list-obj_name   =  'Anlage'.&lt;/P&gt;&lt;P&gt;  concatenate 'File_' gv_datum '_' gv_zeit '.xls'&lt;/P&gt;&lt;P&gt;      into gs_packing_list-obj_descr.&lt;/P&gt;&lt;P&gt;  multiply lv_attachlen by lv_attachlines.&lt;/P&gt;&lt;P&gt;  gs_packing_list-doc_size   =  lv_attachlen.&lt;/P&gt;&lt;P&gt;  append gs_packing_list to gt_packing_list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Fill e-mail-adresses&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  clear: gt_receivers[], gs_receivers.&lt;/P&gt;&lt;P&gt;  gs_receivers-receiver = p_addr.&lt;/P&gt;&lt;P&gt;  gs_receivers-rec_type = 'U'.&lt;/P&gt;&lt;P&gt;  append gs_receivers to gt_receivers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'&lt;/P&gt;&lt;P&gt;   exporting&lt;/P&gt;&lt;P&gt;     document_data              = gs_doc_data&lt;/P&gt;&lt;P&gt;      put_in_outbox              = 'X'&lt;/P&gt;&lt;P&gt;      commit_work                = 'X'&lt;/P&gt;&lt;P&gt;    importing&lt;/P&gt;&lt;P&gt;      sent_to_all                = lv_sent_all&lt;/P&gt;&lt;P&gt;    tables&lt;/P&gt;&lt;P&gt;      packing_list               = gt_packing_list&lt;/P&gt;&lt;P&gt;      contents_txt               = gt_message&lt;/P&gt;&lt;P&gt;      contents_hex               = gt_x_attachment&lt;/P&gt;&lt;P&gt;      receivers                  = gt_receivers&lt;/P&gt;&lt;P&gt;    exceptions&lt;/P&gt;&lt;P&gt;      too_many_receivers         = 1&lt;/P&gt;&lt;P&gt;      document_not_sent          = 2&lt;/P&gt;&lt;P&gt;      document_type_not_exist    = 3&lt;/P&gt;&lt;P&gt;      operation_no_authorization = 4&lt;/P&gt;&lt;P&gt;      parameter_error            = 5&lt;/P&gt;&lt;P&gt;      x_error                    = 6&lt;/P&gt;&lt;P&gt;      enqueue_error              = 7&lt;/P&gt;&lt;P&gt;      others                     = 8.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2007 15:41:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/excel-format-unrecognized/m-p/2581327#M590268</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-29T15:41:40Z</dc:date>
    </item>
  </channel>
</rss>

