<?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 Restructure internal table and populate into database table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/restructure-internal-table-and-populate-into-database-table/m-p/3809980#M916469</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 have some &lt;/P&gt;&lt;P&gt;Account   Entity   Category  period1value   pd2value&lt;/P&gt;&lt;P&gt;10 A C 100 200&lt;/P&gt;&lt;P&gt;Now I need to populate it into database table having structure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Account Entity Category period Value&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;10               A        C         1    100&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;10               A        C          2    200&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;that means instead of having values of all the periods in the same row we insert a column period in the database table which means we denormalize the table and new rows are created for each entry.&lt;/P&gt;&lt;P&gt;Pleadse help&lt;/P&gt;&lt;P&gt;Ankit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 May 2008 14:16:36 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-23T14:16:36Z</dc:date>
    <item>
      <title>Restructure internal table and populate into database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/restructure-internal-table-and-populate-into-database-table/m-p/3809980#M916469</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 have some &lt;/P&gt;&lt;P&gt;Account   Entity   Category  period1value   pd2value&lt;/P&gt;&lt;P&gt;10 A C 100 200&lt;/P&gt;&lt;P&gt;Now I need to populate it into database table having structure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Account Entity Category period Value&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;10               A        C         1    100&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;10               A        C          2    200&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;that means instead of having values of all the periods in the same row we insert a column period in the database table which means we denormalize the table and new rows are created for each entry.&lt;/P&gt;&lt;P&gt;Pleadse help&lt;/P&gt;&lt;P&gt;Ankit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 May 2008 14:16:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/restructure-internal-table-and-populate-into-database-table/m-p/3809980#M916469</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-23T14:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: Restructure internal table and populate into database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/restructure-internal-table-and-populate-into-database-table/m-p/3809981#M916470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ankit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps you could try something like this:&lt;/P&gt;&lt;P&gt;(Please forgive the sytnax errors)&lt;/P&gt;&lt;P&gt;I am assuming that you will only produce 2 lines per each in the original table as per your example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Account Entity Category period Value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;10 A C 1 100&lt;/P&gt;&lt;P&gt;10 A C 2 200&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: itab1 type itab1type
        itab2 type itab2type.

loop at itab1 into wa1.
  wa2-acct = wa-acct. 
  wa2-entity = wa-entity
  wa2-category = wa-category
  wa2-period = 1.
  wa2-value = wa-period1value
  append wa2 to itab2.
  wa2-period = 2
  wa2-value = wa-period2value.
  append wa2 to itab2
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;Greg Kern&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 May 2008 17:47:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/restructure-internal-table-and-populate-into-database-table/m-p/3809981#M916470</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-23T17:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: Restructure internal table and populate into database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/restructure-internal-table-and-populate-into-database-table/m-p/3809982#M916471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kern,&lt;/P&gt;&lt;P&gt;Thanks a lot for the help.&lt;/P&gt;&lt;P&gt;can you please tell me&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: itab1 type itab1type&lt;/P&gt;&lt;P&gt;        itab2 type itab2type.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;loop at itab1 into wa1.&lt;/P&gt;&lt;P&gt;  wa2-acct = wa-acct. &lt;/P&gt;&lt;P&gt;  wa2-entity = wa-entity&lt;/P&gt;&lt;P&gt;  wa2-category = wa-category&lt;/P&gt;&lt;P&gt;  wa2-period = 1.&lt;/P&gt;&lt;P&gt;  wa2-value = wa-period1value&lt;/P&gt;&lt;P&gt;  append wa2 to itab2.&lt;/P&gt;&lt;P&gt;  wa2-period = 2&lt;/P&gt;&lt;P&gt;  wa2-value = wa-period2value.&lt;/P&gt;&lt;P&gt;  append wa2 to itab2&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what are u taking wa2 as?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ankit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 May 2008 06:38:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/restructure-internal-table-and-populate-into-database-table/m-p/3809982#M916471</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-26T06:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: Restructure internal table and populate into database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/restructure-internal-table-and-populate-into-database-table/m-p/3809983#M916472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa2 will have the same structure as a line of itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Greg Kern&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jun 2008 17:44:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/restructure-internal-table-and-populate-into-database-table/m-p/3809983#M916472</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-02T17:44:03Z</dc:date>
    </item>
  </channel>
</rss>

