<?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 Split the file into multiple records in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-the-file-into-multiple-records/m-p/3768263#M906731</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I getting the file in the below format.........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;AAAA/BBBB/CC/DD/EEEEEEEEEEEEE/fffff/ABCD&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EFGH/1248376/...........&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can  anyone guide me how to split this file into multiple records at ' / '&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AAAA&lt;/P&gt;&lt;P&gt;BBBB.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the second one would be if the line ending with some string with out ' / ' then i should concatenate the next line string upto ' / ' symbol and pass as next record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone guide me how to do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I really appreciate your inputs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your anticipation&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Apr 2008 18:59:57 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-24T18:59:57Z</dc:date>
    <item>
      <title>Split the file into multiple records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-the-file-into-multiple-records/m-p/3768263#M906731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I getting the file in the below format.........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;AAAA/BBBB/CC/DD/EEEEEEEEEEEEE/fffff/ABCD&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EFGH/1248376/...........&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can  anyone guide me how to split this file into multiple records at ' / '&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AAAA&lt;/P&gt;&lt;P&gt;BBBB.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the second one would be if the line ending with some string with out ' / ' then i should concatenate the next line string upto ' / ' symbol and pass as next record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone guide me how to do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I really appreciate your inputs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your anticipation&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2008 18:59:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-the-file-into-multiple-records/m-p/3768263#M906731</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-24T18:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: Split the file into multiple records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-the-file-into-multiple-records/m-p/3768264#M906732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi check this example...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;      test(100) type c,&lt;/P&gt;&lt;P&gt;      end of itab .&lt;/P&gt;&lt;P&gt;data: begin of itab1 occurs 0,&lt;/P&gt;&lt;P&gt;      test1(10) type c,&lt;/P&gt;&lt;P&gt;      test2(20) type c,&lt;/P&gt;&lt;P&gt;      end of itab1 .&lt;/P&gt;&lt;P&gt;data: v_test1(10),&lt;/P&gt;&lt;P&gt;      v_test2(20) .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab-test  = 'fdfdfdffdffdf/wqwqwqwwwwq'.&lt;/P&gt;&lt;P&gt; append itab .&lt;/P&gt;&lt;P&gt;itab-test  =  'rererrere/ewewewewee'.&lt;/P&gt;&lt;P&gt;append itab .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; itab-test  = 'ltltltlt/ptptptptpt'.&lt;/P&gt;&lt;P&gt; append itab .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  itab-test  = 'oeoeoeoeoe/utytytytyt'.&lt;/P&gt;&lt;P&gt;append itab .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab .&lt;/P&gt;&lt;P&gt;split itab-test at '/' into v_test1 v_test2 .&lt;/P&gt;&lt;P&gt;itab1-test1 = v_test1.&lt;/P&gt;&lt;P&gt;itab1-test2 = v_test2 .&lt;/P&gt;&lt;P&gt;append itab1.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;venkat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2008 19:11:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-the-file-into-multiple-records/m-p/3768264#M906732</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-24T19:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: Split the file into multiple records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-the-file-into-multiple-records/m-p/3768265#M906733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Venkat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I really appreciate quick response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am unable to catch your point. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting huge amount of data like that in a file. I need  to split the file at that symbol into multiple records. It is not constant like I get only 2 times that symbol in a like, it varies I may get it mulitple time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you plzzzzzzzz guide me now&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2008 19:19:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-the-file-into-multiple-records/m-p/3768265#M906733</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-24T19:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: Split the file into multiple records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-the-file-into-multiple-records/m-p/3768266#M906734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LOOP AT I_ITAB INTO W_ITAB.&lt;/P&gt;&lt;P&gt;    SPLIT W_ITAB AT '/' INTO   W_REC-SEQNO&lt;/P&gt;&lt;P&gt;                                  W_REC-RECAC&lt;/P&gt;&lt;P&gt;                                  W_REC-TRADT&lt;/P&gt;&lt;P&gt;                                  W_REC-BUILD_ID&lt;/P&gt;&lt;P&gt;                                  W_REC-OWNER_ID&lt;/P&gt;&lt;P&gt;                                  W_REC-EBELN&lt;/P&gt;&lt;P&gt;                                  W_REC-ORD_TYP&lt;/P&gt;&lt;P&gt;                                  W_REC-EBELP&lt;/P&gt;&lt;P&gt;                                  W_REC-MATNR&lt;/P&gt;&lt;P&gt;                                  W_REC-LOT_NO&lt;/P&gt;&lt;P&gt;                                  W_REC-QTY_REC&lt;/P&gt;&lt;P&gt;                                  W_REC-SHP_NO&lt;/P&gt;&lt;P&gt;                                  W_REC-BOL_NO&lt;/P&gt;&lt;P&gt;                                  W_REC-CONT_NO&lt;/P&gt;&lt;P&gt;                                  W_REC-PFLAG&lt;/P&gt;&lt;P&gt;                                  W_REC-PDATE.&lt;/P&gt;&lt;P&gt;    APPEND W_REC TO I_REC.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then display the contents of the loop in your required format.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2008 19:27:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-the-file-into-multiple-records/m-p/3768266#M906734</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-24T19:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: Split the file into multiple records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-the-file-into-multiple-records/m-p/3768267#M906735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ramesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for your input. But how can we declare the final internal table. Because I don't know the number of times / symbols comes in a row.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2008 19:42:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-the-file-into-multiple-records/m-p/3768267#M906735</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-24T19:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: Split the file into multiple records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-the-file-into-multiple-records/m-p/3768268#M906736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You want this...&lt;/P&gt;&lt;P&gt;AAAA/BBBB/CC/DD/EEEEEEEEEEEEE/fffff/ABCD&lt;/P&gt;&lt;P&gt;EFGH/1248376/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to look like this&lt;/P&gt;&lt;P&gt;AAAA&lt;/P&gt;&lt;P&gt;BBBB&lt;/P&gt;&lt;P&gt;CC&lt;/P&gt;&lt;P&gt;DD&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AAAA BBBB CC DD EEEEEEEEEEEEE fffff ABCDEFGH 1248376&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2008 20:02:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-the-file-into-multiple-records/m-p/3768268#M906736</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-24T20:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: Split the file into multiple records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-the-file-into-multiple-records/m-p/3768269#M906737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Ramiro,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to make to look into..........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AAAA&lt;/P&gt;&lt;P&gt;BBBB&lt;/P&gt;&lt;P&gt;CC&lt;/P&gt;&lt;P&gt;DD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simply I need to split the entire record at / into multiple records........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will get the multiple lines AAAA/BBBB/CC/DD/EEEEEEEEEEEEE/fffff/ABCD&lt;/P&gt;&lt;P&gt;EFGH/1248376/&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;like this format.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or is there any possibility so that I can read the entire file into one record and then split at / into multiple records?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Guide me plzzzzzzzz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2008 20:07:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-the-file-into-multiple-records/m-p/3768269#M906737</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-24T20:07:26Z</dc:date>
    </item>
    <item>
      <title>Re: Split the file into multiple records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-the-file-into-multiple-records/m-p/3768270#M906738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is some logic to help you do that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe it's not the best way, but for the way you're working it may be the most flexible alternative,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can test this report to see the results:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

REPORT  zteste.

TYPES: BEGIN OF tFILE,
         line(200),
       end of tfile.

DATA: file_line(200) TYPE c VALUE
      'aaa/bbb/ccc/ddd/eee'.

DATA: internal_table type STANDARD TABLE OF tfile,
      result_table   type STANDARD TABLE OF tfile.

DATA: wa1 type tfile,
      wa2 type tfile.

do 4 times.

  wa1-line = file_line.
  append wa1 to internal_table.

enddo.


DATA: record(200) type c.
DATA: vstart type i,
      vend   type i,
      voff   type i,
      variation   type i,
      v_first,
      v_exit.

LOOP AT internal_table into wa1.
  Clear: vstart,
        vend,
        voff,
        v_first,
        variation,
        v_exit.

  record = wa1-line.
  Do.
    if v_exit = 'X'.
      exit.
    endif.
    FIND FIRST OCCURRENCE OF '/' in record match OFFSET vend.
    if sy-subrc = 0.
*** If Found
      voff = vend - vstart.
      if v_first is initial.
        v_first = 'X'.
        wa2-line = record(voff).
      else.
        wa2-line = record+vstart(voff).
      endif.
    else.
*** Last record handling
      if record is not initial.
        if v_first is not initial.
          vend = STRLEN( record ).
          voff = vend - vstart.
          wa2-line = record+vstart(voff).
        else.
          wa2-line = record.
        endif.
        append wa2 to result_table.
        v_exit = 'X'.
        exit.
      endif.
    endif.
    append wa2 to result_table.
    vstart = vend + 1.
    replace first occurrence of '/' in record with '\'.
  enddo.
ENDLOOP.

loop at result_table into wa2.
  write:/ wa2-line.
endloop.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2008 20:40:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-the-file-into-multiple-records/m-p/3768270#M906738</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-24T20:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: Split the file into multiple records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-the-file-into-multiple-records/m-p/3768271#M906739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is some logic that may help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT ztestsplit .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: text TYPE char100.&lt;/P&gt;&lt;P&gt;DATA: l_len TYPE i.&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF itab OCCURS 0,&lt;/P&gt;&lt;P&gt;        text TYPE char10,&lt;/P&gt;&lt;P&gt;      END OF itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;text = 'AAAAA/BBBBB/CCCCC/DDDDD/EEEEE'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO.&lt;/P&gt;&lt;P&gt;  l_len = strlen( text ).&lt;/P&gt;&lt;P&gt;  IF l_len GT 0.&lt;/P&gt;&lt;P&gt;    SPLIT text AT '/' INTO itab-text text.&lt;/P&gt;&lt;P&gt;    APPEND itab.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    EXIT.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itab.&lt;/P&gt;&lt;P&gt;  WRITE:/ itab-text.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers...&lt;/P&gt;&lt;P&gt;Prasad.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2008 20:55:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-the-file-into-multiple-records/m-p/3768271#M906739</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-24T20:55:17Z</dc:date>
    </item>
  </channel>
</rss>

