<?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 dynamic internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/6623798#M1440814</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi everybody ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have an issue help me....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i want dynamic heading(size wise quandity)...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am having internal table like this&lt;/P&gt;&lt;P&gt;*material1    unit  35  100(this is quandity)&lt;/P&gt;&lt;P&gt;material1    unit  40  200&lt;/P&gt;&lt;P&gt;material2    unit  35  500*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i want following out put in internal table is it possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;material      uom  35   40&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------" /&gt;&lt;P&gt;material1    unit  100  200   &lt;/P&gt;&lt;P&gt;material2    unit  500&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;prabhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Feb 2010 14:00:16 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-02-09T14:00:16Z</dc:date>
    <item>
      <title>dynamic internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/6623798#M1440814</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi everybody ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have an issue help me....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i want dynamic heading(size wise quandity)...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am having internal table like this&lt;/P&gt;&lt;P&gt;*material1    unit  35  100(this is quandity)&lt;/P&gt;&lt;P&gt;material1    unit  40  200&lt;/P&gt;&lt;P&gt;material2    unit  35  500*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i want following out put in internal table is it possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;material      uom  35   40&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------" /&gt;&lt;P&gt;material1    unit  100  200   &lt;/P&gt;&lt;P&gt;material2    unit  500&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;prabhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Feb 2010 14:00:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/6623798#M1440814</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-09T14:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/6623799#M1440815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Prabhu,&lt;/P&gt;&lt;P&gt;if i got your request right, you might try somthing like the below.&lt;/P&gt;&lt;P&gt;I assumed, that your variety of size is not unlimited. In my example i took 16 different values for size as maximum.&lt;/P&gt;&lt;P&gt;additionaly, you have to think of means to suppress empty fields or maybe distinguish them from actual zero. &lt;/P&gt;&lt;P&gt;Alternatively, you could apply deep structure (table in table) for sizes. &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: begin of itab occurs 0,
       material(10),
       unit(5),
       size(2) type n,
       quant type i,
      end of itab,
      begin of wa_out,
        material(10),
        unit(4),
        size1(2) type n,
        size2(2) type n,
        size3(2) type n,
        size4(2) type n,
        size5(2) type n,
        size6(2) type n,
        size7(2) type n,
        size8(2) type n,
        size9(2) type n,
        sizea(2) type n,
        sizeb(2) type n,
        sizec(2) type n,
        sized(2) type n,
        sizee(2) type n,
        sizef(2) type n,
      end of wa_out,
      wa_head like wa_out,
      tab_out like table of wa_out.
data: begin of ftab occurs 0,
      s_val(2) type n,
      s_idx type i,
      end of ftab.
field-symbols: &amp;lt;col&amp;gt;.      

wa_head-material = 'Material'.
wa_head-unit = 'uom'.


SORT itab by size.
      ftab-s_idx = 2.      
LOOP AT itab.
  on change of itab-size.
    add 1 to ftab-idx.
    ftab-s_val = itab-size.
    append ftab.
    assign COMPONENT ftab-s_idx OF STRUCTURE wa_head to &amp;lt;col&amp;gt;.
    &amp;lt;col&amp;gt; = itab-size. 
  endon.
ENDLOOP.        
sort itab by material.
LOOP AT itab.
  on CHANGE OF itab-material.
    IF wa_out is not initial.
      append wa_out to tab_out.
    ENDIF.
    clear wa_out.
    wa_out-material = itab-material.
  endon.
  wa_out-unit = itab-unit.
  READ TABLE ftab WITH KEY s_val = itab-size.
  if sy-subrc ne 0.
*    do something awfully impressive
  endif.
  ASSIGN COMPONENT ftab-s_idx OF STRUCTURE wa_out to &amp;lt;col&amp;gt;.
  &amp;lt;col&amp;gt; = itab-quant.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Feb 2010 15:56:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/6623799#M1440815</guid>
      <dc:creator>jrg_wulf</dc:creator>
      <dc:date>2010-02-09T15:56:35Z</dc:date>
    </item>
  </channel>
</rss>

