<?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 move data from static to dynamic itab in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/move-data-from-static-to-dynamic-itab/m-p/6498688#M1421394</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 was able to create a structure for dynamic internal table for the specific requirement below.&lt;/P&gt;&lt;P&gt;How ever. I am finding it hard to move data to this new dynamic table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any expert suggestions would be greatlt appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OP QUAN DATE&lt;/P&gt;&lt;P&gt;1      2        10/10/2009&lt;/P&gt;&lt;P&gt;2      3        10/10/2009&lt;/P&gt;&lt;P&gt;3      2        11/10/2009&lt;/P&gt;&lt;P&gt;4      1        12/10/2009&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output table should look like this ( there are 3 different dates in above input and my output should have 3 additional columns and quan should fall under date)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OP 10/10/2009 11/10/2009 12/10/2009&lt;/P&gt;&lt;P&gt;1         2        &lt;/P&gt;&lt;P&gt;2         3&lt;/P&gt;&lt;P&gt;3                             2 &lt;/P&gt;&lt;P&gt;4                                                  1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was able to move the OP field as this is common across 2 tables. But unable to find a logic to send QUAN field under specific date in the 2 nd table.&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;Bill&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Jan 2010 20:50:32 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-01-05T20:50:32Z</dc:date>
    <item>
      <title>move data from static to dynamic itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/move-data-from-static-to-dynamic-itab/m-p/6498688#M1421394</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 was able to create a structure for dynamic internal table for the specific requirement below.&lt;/P&gt;&lt;P&gt;How ever. I am finding it hard to move data to this new dynamic table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any expert suggestions would be greatlt appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OP QUAN DATE&lt;/P&gt;&lt;P&gt;1      2        10/10/2009&lt;/P&gt;&lt;P&gt;2      3        10/10/2009&lt;/P&gt;&lt;P&gt;3      2        11/10/2009&lt;/P&gt;&lt;P&gt;4      1        12/10/2009&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output table should look like this ( there are 3 different dates in above input and my output should have 3 additional columns and quan should fall under date)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OP 10/10/2009 11/10/2009 12/10/2009&lt;/P&gt;&lt;P&gt;1         2        &lt;/P&gt;&lt;P&gt;2         3&lt;/P&gt;&lt;P&gt;3                             2 &lt;/P&gt;&lt;P&gt;4                                                  1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was able to move the OP field as this is common across 2 tables. But unable to find a logic to send QUAN field under specific date in the 2 nd table.&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;Bill&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jan 2010 20:50:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/move-data-from-static-to-dynamic-itab/m-p/6498688#M1421394</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-05T20:50:32Z</dc:date>
    </item>
    <item>
      <title>Re: move data from static to dynamic itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/move-data-from-static-to-dynamic-itab/m-p/6498689#M1421395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry the tab delimitation in second table is out of sync in my previous post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is how the 2 nd table data should look like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OP 10/10/2009 11/10/2009 12/10/2009&lt;/P&gt;&lt;P&gt;1 2 - -&lt;/P&gt;&lt;P&gt;2 3 - -&lt;/P&gt;&lt;P&gt;3 - 2 -&lt;/P&gt;&lt;P&gt;4 - - 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;quan field value should follow under respective dates&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jan 2010 20:52:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/move-data-from-static-to-dynamic-itab/m-p/6498689#M1421395</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-05T20:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: move data from static to dynamic itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/move-data-from-static-to-dynamic-itab/m-p/6498690#M1421396</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;try the following logic. I could not verify it in the system, so I hope my syntax is okay...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: dates_itab TYPE [same type as source_itab],
      source_tab_iterator LIKE LINE OF source_itab,
      target_tab_line LIKE LINE OF target_tab,
      col_index TYPE i.

FIELD-SYMBOLS: &amp;lt;target_col&amp;gt; LIKE source_tab-quan.
                " ^ I assume the dynamic columns of the target itab
                "   have this data type...

* Get all the distinct dates of the source itab into table dates_itab
dates_itab = source_itab.
SORT dates_itab BY date.
DELETE ADJACENT DUPLICATES FROM dates_itab COMPARING date.

* Now iterate over the source itab and populate the target table
LOOP AT source_itab INTO source_tab_iterator.
  CLEAR target_tab_line.
  target_tab_line-op = source_tab_iterator-op.
  READ TABLE dates_itab TRANSPORTING NO FIELDS
        WITH KEY date = source_tab_iterator-date
        BINARY SEARCH.
  col_index = sy-index + 1.    "first date is column 2, second is colum 3, etc.
  ASSIGN COMPONENT col_index OF STRUCTURE target_tab_line TO &amp;lt;target_col&amp;gt;.
  &amp;lt;target_col&amp;gt; = source_tab_iterator-quan.
  APPEND target_tab_line TO target_itab.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jan 2010 23:01:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/move-data-from-static-to-dynamic-itab/m-p/6498690#M1421396</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-05T23:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: move data from static to dynamic itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/move-data-from-static-to-dynamic-itab/m-p/6498691#M1421397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi billbala,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this can be done creating a dynamic table using RTTS runtime type services cl_abap_typedesc and others.The column (field) names can't be like 10/10/2009, but D_20091010 would be possible. In ALV grid you could set the column header as 10/10/2009.&lt;/P&gt;&lt;P&gt;But I can't get your logic because everything is posted unformatted. Select with mouse, push above &amp;lt;_&amp;gt; code button and use preview to check.&lt;/P&gt;&lt;P&gt;Why 41 becomes 4--1?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jan 2010 23:07:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/move-data-from-static-to-dynamic-itab/m-p/6498691#M1421397</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2010-01-05T23:07:25Z</dc:date>
    </item>
  </channel>
</rss>

