<?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 Re: Problem when converting from spool to XLS file in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-converting-from-spool-to-xls-file/m-p/3876446#M931794</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you for your reply but the problem is that my internal table is built only from one column&lt;/P&gt;&lt;P&gt;(that is called 'line' with 1024 chars) - that is becaues i don't know which fields will be in the spool and &lt;/P&gt;&lt;P&gt;i need to be ready for any case...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is it possible in in this case?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Jun 2008 13:05:41 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-05T13:05:41Z</dc:date>
    <item>
      <title>Problem when converting from spool to XLS file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-converting-from-spool-to-xls-file/m-p/3876443#M931791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey.&lt;/P&gt;&lt;P&gt;I need to get table data from the spool and send it by mail in an xls file.&lt;/P&gt;&lt;P&gt;so this is what i have done:&lt;/P&gt;&lt;P&gt;I have used the FM 'RSPO_RETURN_ABAP_SPOOLJOB' to get the data table from the spool.&lt;/P&gt;&lt;P&gt;then i am sending the data table in an xls file via the FM 'SO_DOCUMENT_SEND_API1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the problem is that the xls file that i am getting through the mail is defected.&lt;/P&gt;&lt;P&gt;All the contents of the spool is located in the first row, first column.&lt;/P&gt;&lt;P&gt;How can i fix it?&lt;/P&gt;&lt;P&gt;Thanks, Barak.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2008 12:37:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-converting-from-spool-to-xls-file/m-p/3876443#M931791</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-05T12:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when converting from spool to XLS file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-converting-from-spool-to-xls-file/m-p/3876444#M931792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;After geting the data in a internal table.from spool......refer this report.....&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: p_email   type somlreci1-receiver&lt;/P&gt;&lt;P&gt;                               value 'MAIL ID'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of it001 occurs 0,&lt;/P&gt;&lt;P&gt;      bukrs type t001-bukrs,&lt;/P&gt;&lt;P&gt;      butxt type t001-butxt,&lt;/P&gt;&lt;P&gt;      end of it001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:   imessage type standard table of solisti1 with header line,&lt;/P&gt;&lt;P&gt;        iattach type standard table of solisti1 with header line,&lt;/P&gt;&lt;P&gt;        ipacking_list like sopcklsti1 occurs 0 with header line,&lt;/P&gt;&lt;P&gt;        ireceivers like somlreci1 occurs 0 with header line,&lt;/P&gt;&lt;P&gt;        iattachment like solisti1 occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  select bukrs butxt into table it001 from t001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Populate table with detaisl to be entered into .xls file&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  perform build_xls_data .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Populate message body text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  clear imessage.   refresh imessage.&lt;/P&gt;&lt;P&gt;  imessage = 'Please find attached excel file'.&lt;/P&gt;&lt;P&gt;  append imessage.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Send file by email as .xls speadsheet&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  perform send_email_with_xls tables imessage&lt;/P&gt;&lt;P&gt;                                      iattach&lt;/P&gt;&lt;P&gt;                                using p_email&lt;/P&gt;&lt;P&gt;                                      'Example Excel Attachment'&lt;/P&gt;&lt;P&gt;                                      'XLS'&lt;/P&gt;&lt;P&gt;                                      'TestFileName'&lt;/P&gt;&lt;P&gt;                                      'CompanyCodes'.&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;     Form  BUILD_XLS_DATA&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;form build_xls_data .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; constants: con_cret type x value '0D',  "OK for non Unicode&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            con_tab type x value '09'.   "OK for non Unicode&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*If you have Unicode check active in program attributes thnen you will&lt;/P&gt;&lt;P&gt;*need to declare constants as follows&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_tab  type c value cl_abap_char_utilities=&amp;gt;horizontal_tab,&lt;/P&gt;&lt;P&gt;    con_cret type c value cl_abap_char_utilities=&amp;gt;cr_lf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  concatenate 'BUKRS' 'BUTXT'&lt;/P&gt;&lt;P&gt;         into iattach separated by con_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  concatenate con_cret iattach into iattach.&lt;/P&gt;&lt;P&gt;  append  iattach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  loop at it001 .&lt;/P&gt;&lt;P&gt;    concatenate it001-bukrs it001-butxt&lt;/P&gt;&lt;P&gt;           into iattach separated by con_tab.&lt;/P&gt;&lt;P&gt;    concatenate con_cret iattach  into iattach.&lt;/P&gt;&lt;P&gt;    append  iattach.&lt;/P&gt;&lt;P&gt;  endloop .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.&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;     Form  SEND_EMAIL_WITH_XLS&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;form send_email_with_xls tables pit_message&lt;/P&gt;&lt;P&gt;                                          pit_attach&lt;/P&gt;&lt;P&gt;                                    using p_email&lt;/P&gt;&lt;P&gt;                                          p_mtitle&lt;/P&gt;&lt;P&gt;                                          p_format&lt;/P&gt;&lt;P&gt;                                          p_filename&lt;/P&gt;&lt;P&gt;                                          p_attdescription.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data: xdocdata like sodocchgi1,&lt;/P&gt;&lt;P&gt;        xcnt type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Fill the document data.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  xdocdata-doc_size = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Populate the subject/generic message attributes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  xdocdata-obj_langu = sy-langu .&lt;/P&gt;&lt;P&gt;  xdocdata-obj_name  = 'SAPRPT' .&lt;/P&gt;&lt;P&gt;  xdocdata-obj_descr = p_mtitle .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Fill the document data and get size of attachment&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  clear xdocdata.&lt;/P&gt;&lt;P&gt;  read table iattach index xcnt.&lt;/P&gt;&lt;P&gt;  xdocdata-doc_size =&lt;/P&gt;&lt;P&gt;     ( xcnt - 1 ) * 255 + strlen( iattach ).&lt;/P&gt;&lt;P&gt;  xdocdata-obj_langu  = sy-langu.&lt;/P&gt;&lt;P&gt;  xdocdata-obj_name   = 'SAPRPT'.&lt;/P&gt;&lt;P&gt;  xdocdata-obj_descr  = p_mtitle.&lt;/P&gt;&lt;P&gt;  clear iattachment.  refresh iattachment.&lt;/P&gt;&lt;P&gt;  iattachment[] = pit_attach[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Describe the body of the message&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  clear ipacking_list.  refresh ipacking_list.&lt;/P&gt;&lt;P&gt;  ipacking_list-transf_bin = space.&lt;/P&gt;&lt;P&gt;  ipacking_list-head_start = 1.&lt;/P&gt;&lt;P&gt;  ipacking_list-head_num = 0.&lt;/P&gt;&lt;P&gt;  ipacking_list-body_start = 1.&lt;/P&gt;&lt;P&gt;  describe table imessage lines ipacking_list-body_num.&lt;/P&gt;&lt;P&gt;  ipacking_list-doc_type = 'RAW'.&lt;/P&gt;&lt;P&gt;  append ipacking_list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create attachment notification&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ipacking_list-transf_bin = 'X'.&lt;/P&gt;&lt;P&gt;  ipacking_list-head_start = 1.&lt;/P&gt;&lt;P&gt;  ipacking_list-head_num   = 1.&lt;/P&gt;&lt;P&gt;  ipacking_list-body_start = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  describe table iattachment lines ipacking_list-body_num.&lt;/P&gt;&lt;P&gt;  ipacking_list-doc_type   =  p_format.&lt;/P&gt;&lt;P&gt;  ipacking_list-obj_descr  =  p_attdescription.&lt;/P&gt;&lt;P&gt;  ipacking_list-obj_name   =  p_filename.&lt;/P&gt;&lt;P&gt;  ipacking_list-doc_size   =  ipacking_list-body_num * 255.&lt;/P&gt;&lt;P&gt;  append ipacking_list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Add the recipients email address&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  clear ireceivers.  refresh ireceivers.&lt;/P&gt;&lt;P&gt;  ireceivers-receiver = p_email.&lt;/P&gt;&lt;P&gt;  ireceivers-rec_type = 'U'.&lt;/P&gt;&lt;P&gt;  ireceivers-com_type = 'INT'.&lt;/P&gt;&lt;P&gt;  ireceivers-notif_del = 'X'.&lt;/P&gt;&lt;P&gt;  ireceivers-notif_ndel = 'X'.&lt;/P&gt;&lt;P&gt;  append ireceivers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call function 'SO_DOCUMENT_SEND_API1'&lt;/P&gt;&lt;P&gt;       exporting&lt;/P&gt;&lt;P&gt;            document_data              = xdocdata&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;       tables&lt;/P&gt;&lt;P&gt;            packing_list               = ipacking_list&lt;/P&gt;&lt;P&gt;            contents_bin               = iattachment&lt;/P&gt;&lt;P&gt;            contents_txt               = imessage&lt;/P&gt;&lt;P&gt;            receivers                  = ireceivers&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;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward IF.........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anbu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2008 12:44:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-converting-from-spool-to-xls-file/m-p/3876444#M931792</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-05T12:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when converting from spool to XLS file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-converting-from-spool-to-xls-file/m-p/3876445#M931793</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;If your system is unicode then use below class and its constant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;--- Class defination -&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS cl_abap_char_utilities DEFINITION LOAD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Assign '#' to ascii_tab and carriage return parmeters&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CONSTANTS: ascii_tab TYPE c VALUE cl_abap_char_utilities=&amp;gt;horizontal_tab.&lt;/P&gt;&lt;P&gt;CONSTANTS: c_cr_lf   TYPE c VALUE cl_abap_char_utilities=&amp;gt;cr_lf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at end of each row of your internal table concatenate c_cr_lf which will server as enter in excel format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shravan G.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2008 12:46:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-converting-from-spool-to-xls-file/m-p/3876445#M931793</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-05T12:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when converting from spool to XLS file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-converting-from-spool-to-xls-file/m-p/3876446#M931794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you for your reply but the problem is that my internal table is built only from one column&lt;/P&gt;&lt;P&gt;(that is called 'line' with 1024 chars) - that is becaues i don't know which fields will be in the spool and &lt;/P&gt;&lt;P&gt;i need to be ready for any case...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is it possible in in this case?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2008 13:05:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-converting-from-spool-to-xls-file/m-p/3876446#M931794</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-05T13:05:41Z</dc:date>
    </item>
  </channel>
</rss>

