<?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 Spliting the file in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/spliting-the-file/m-p/3366446#M807877</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;Iam getting one file as input i have to split the file based on the length of the fields.My input file format is &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plant = char(4)&lt;/P&gt;&lt;P&gt;material = char(18)&lt;/P&gt;&lt;P&gt;ship_to = char(10)&lt;/P&gt;&lt;P&gt;amount = curr(11)dec(2)(KONP-kbetr)&lt;/P&gt;&lt;P&gt;unit = cuky(5)&lt;/P&gt;&lt;P&gt;qty_per  = dec(5)&lt;/P&gt;&lt;P&gt;valid_from_date = dats(8)&lt;/P&gt;&lt;P&gt;valid_to_date = dats(8)&lt;/P&gt;&lt;P&gt;action_code = char(1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can any one provide the code for this.&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Jan 2008 09:40:18 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-28T09:40:18Z</dc:date>
    <item>
      <title>Spliting the file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/spliting-the-file/m-p/3366446#M807877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;Iam getting one file as input i have to split the file based on the length of the fields.My input file format is &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plant = char(4)&lt;/P&gt;&lt;P&gt;material = char(18)&lt;/P&gt;&lt;P&gt;ship_to = char(10)&lt;/P&gt;&lt;P&gt;amount = curr(11)dec(2)(KONP-kbetr)&lt;/P&gt;&lt;P&gt;unit = cuky(5)&lt;/P&gt;&lt;P&gt;qty_per  = dec(5)&lt;/P&gt;&lt;P&gt;valid_from_date = dats(8)&lt;/P&gt;&lt;P&gt;valid_to_date = dats(8)&lt;/P&gt;&lt;P&gt;action_code = char(1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can any one provide the code for this.&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jan 2008 09:40:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/spliting-the-file/m-p/3366446#M807877</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-28T09:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Spliting the file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/spliting-the-file/m-p/3366447#M807878</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;you need to work with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call function 'WS_UPLOAD'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            filename                = pa_file&lt;/P&gt;&lt;P&gt;            filetype                = 'DAT'&lt;/P&gt;&lt;P&gt;       TABLES&lt;/P&gt;&lt;P&gt;            data_tab                = it_record&lt;/P&gt;&lt;P&gt;       EXCEPTIONS&lt;/P&gt;&lt;P&gt;            conversion_error        = 1&lt;/P&gt;&lt;P&gt;            file_open_error         = 2&lt;/P&gt;&lt;P&gt;            file_read_error         = 3&lt;/P&gt;&lt;P&gt;            invalid_table_width     = 4&lt;/P&gt;&lt;P&gt;            invalid_type            = 5&lt;/P&gt;&lt;P&gt;            no_batch                = 6&lt;/P&gt;&lt;P&gt;            unknown_error           = 7&lt;/P&gt;&lt;P&gt;            gui_refuse_filetransfer = 8&lt;/P&gt;&lt;P&gt;            others                  = 9.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it_record is your internal table with all fields and length.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Nicole&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jan 2008 09:46:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/spliting-the-file/m-p/3366447#M807878</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-28T09:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: Spliting the file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/spliting-the-file/m-p/3366448#M807879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;If you mean that your file total length is 100 .&lt;/P&gt;&lt;P&gt;But you want data upto length 50 in one fiel/table and data from 51 to 100 in another table/file.&lt;/P&gt;&lt;P&gt;Use offsets to achieve this .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Foe eg :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at &amp;lt;input file&amp;gt; INTO g_r_input .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;workarea1 = g_r_input+0(50) .&lt;/P&gt;&lt;P&gt;append table1 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;workarea2 = g_r_input+51(100) .&lt;/P&gt;&lt;P&gt;append table2 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR : workarea1 , workarea2 .&lt;/P&gt;&lt;P&gt;ENDLOOP .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If u need something else let us know .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Praveen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jan 2008 09:54:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/spliting-the-file/m-p/3366448#M807879</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-28T09:54:40Z</dc:date>
    </item>
  </channel>
</rss>

