<?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 and reformat single record into multiple records in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-and-reformat-single-record-into-multiple-records/m-p/1895453#M374273</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 need to split 1 record in to  2 records with 1 new field(event)&lt;/P&gt;&lt;P&gt;I have one internal table in this format&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No country stdate          enddate&lt;/P&gt;&lt;P&gt;1    us        12/01/2006  10/07/2007&lt;/P&gt;&lt;P&gt;i need to reformat this record like ;&lt;/P&gt;&lt;P&gt;NO country  event    pldate           acdate  &lt;/P&gt;&lt;P&gt;1     us          ga      12/01/2006   12/01/2006&lt;/P&gt;&lt;P&gt;1     us          es      10/07/2007   10/07/2007&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any one resolve this issue?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Jan 2007 19:56:00 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-01-17T19:56:00Z</dc:date>
    <item>
      <title>Split and reformat single record into multiple records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-and-reformat-single-record-into-multiple-records/m-p/1895453#M374273</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 need to split 1 record in to  2 records with 1 new field(event)&lt;/P&gt;&lt;P&gt;I have one internal table in this format&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No country stdate          enddate&lt;/P&gt;&lt;P&gt;1    us        12/01/2006  10/07/2007&lt;/P&gt;&lt;P&gt;i need to reformat this record like ;&lt;/P&gt;&lt;P&gt;NO country  event    pldate           acdate  &lt;/P&gt;&lt;P&gt;1     us          ga      12/01/2006   12/01/2006&lt;/P&gt;&lt;P&gt;1     us          es      10/07/2007   10/07/2007&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any one resolve this issue?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jan 2007 19:56:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-and-reformat-single-record-into-multiple-records/m-p/1895453#M374273</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-17T19:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: Split and reformat single record into multiple records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-and-reformat-single-record-into-multiple-records/m-p/1895454#M374274</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;check this example..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: ITAB_RESULT LIKE ITAB OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;Assuming the ITAB is having the values&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  MOVE ITAB TO ITAB_RESULT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ITAB_RESULT-ENDDATE = ITAB_RESULT-STDATE.&lt;/P&gt;&lt;P&gt;  APPEND ITAB_RESULT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ITAB_RESULT-STDATE = ITAB-ENDDATE.&lt;/P&gt;&lt;P&gt;  APPEND ITAB_RESULT.&lt;/P&gt;&lt;P&gt;&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;Thanks,&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jan 2007 20:00:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-and-reformat-single-record-into-multiple-records/m-p/1895454#M374274</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-17T20:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: Split and reformat single record into multiple records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-and-reformat-single-record-into-multiple-records/m-p/1895455#M374275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001 .

data: begin of itab occurs 0,
      no type i,
      country(3) type c,
      stdate  type sy-datum,
      enddate type sy-datum,
      end of itab.

data: begin of itab2 occurs 0,
      no type i,
      country(3) type c,
      event(2) type c,
      stdate  type sy-datum,
      enddate type sy-datum,
      end of itab2.


itab-no = 1.
itab-country = 'US'.
itab-stdate = '20061201'.
itab-enddate = '20071007'.
append itab.


loop at itab.

  clear itab2.
  move-corresponding itab to itab2.
  itab2-event = 'GA'.
  itab2-enddate = itab-stdate.
  append itab2.

  clear itab2.
  move-corresponding itab to itab2.
  itab2-event = 'ES'.
  itab2-stdate = itab-enddate.
  append itab2.

endloop.


loop at itab2.
  write:/ itab2-no, itab2-country, itab2-event,
          itab2-stdate, itab2-enddate.
endloop.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jan 2007 20:03:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-and-reformat-single-record-into-multiple-records/m-p/1895455#M374275</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-01-17T20:03:49Z</dc:date>
    </item>
  </channel>
</rss>

