<?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 Regarding Internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-internal-table/m-p/854275#M46871</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)..Is there any key word to find no of fields in an     &lt;/P&gt;&lt;P&gt;         Internal table.?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) There is a require ment like this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;User enters  5 names through select-options..&lt;/P&gt;&lt;P&gt;depending on that there must be that no of fields in the &lt;/P&gt;&lt;P&gt; internal tables...or more no of fields?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can we do this......? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any idea for that.......?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.......?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 31 Mar 2005 14:33:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-03-31T14:33:15Z</dc:date>
    <item>
      <title>Regarding Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-internal-table/m-p/854275#M46871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)..Is there any key word to find no of fields in an     &lt;/P&gt;&lt;P&gt;         Internal table.?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) There is a require ment like this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;User enters  5 names through select-options..&lt;/P&gt;&lt;P&gt;depending on that there must be that no of fields in the &lt;/P&gt;&lt;P&gt; internal tables...or more no of fields?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can we do this......? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any idea for that.......?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.......?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2005 14:33:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-internal-table/m-p/854275#M46871</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-03-31T14:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-internal-table/m-p/854276#M46872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Search the forum on "dynamic table" and you will find many postings on how to create a dynamic internal table.  Let us know if that does not meet your needs.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2005 14:51:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-internal-table/m-p/854276#M46872</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-03-31T14:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-internal-table/m-p/854277#M46873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a sample program showing use of dynamic internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0003
       no standard page heading.

type-pools: slis.

field-symbols: &amp;lt;dyn_table&amp;gt; type standard table,
               &amp;lt;dyn_wa&amp;gt;.

data: alv_fldcat type slis_t_fieldcat_alv,
      it_fldcat type lvc_t_fcat.


selection-screen begin of block b1 with frame title text-001.
parameters: p_check type c.
selection-screen end of block b1.

start-of-selection.

  perform build_dyn_itab.
  perform build_report.

  loop at &amp;lt;dyn_table&amp;gt; into &amp;lt;dyn_wa&amp;gt;.
    write:/ &amp;lt;dyn_wa&amp;gt;.
  endloop.


************************************************************************
*  Build_dyn_itab
************************************************************************
form build_dyn_itab.

  data: index(3) type c.

  data: new_table type ref to data,
        new_line  type ref to data,
        wa_it_fldcat type lvc_s_fcat.

* Create fields
  clear index.
  do 10 times.
    index = sy-index.
    clear wa_it_fldcat.
    concatenate 'Field' index into
             wa_it_fldcat-fieldname .
    condense  wa_it_fldcat-fieldname no-gaps.
    wa_it_fldcat-datatype = 'CHAR'.
    wa_it_fldcat-intlen = 5.
    append wa_it_fldcat to it_fldcat .
  enddo.

* Create dynamic internal table and assign to FS
  call method cl_alv_table_create=&amp;gt;create_dynamic_table
               exporting
                  it_fieldcatalog = it_fldcat
               importing
                  ep_table        = new_table.

  assign new_table-&amp;gt;* to &amp;lt;dyn_table&amp;gt;.

* Create dynamic work area and assign to FS
  create data new_line like line of &amp;lt;dyn_table&amp;gt;.
  assign new_line-&amp;gt;* to &amp;lt;dyn_wa&amp;gt;.

endform.

*********************************************************************
*      Form  build_report
*********************************************************************
form build_report.

  data: fieldname(20) type c.
  data: fieldvalue(5) type c.
  data: index(3) type c.
  field-symbols: &amp;lt;fs1&amp;gt;.

  do 10 times.

    index = sy-index.

* Set up fieldname
    concatenate 'FIELD' index into
             fieldname .
    condense   fieldname  no-gaps.

* Set up fieldvalue
    concatenate 'FLD' index into
             fieldvalue.
    condense   fieldvalue no-gaps.

    assign component  fieldname  of structure &amp;lt;dyn_wa&amp;gt; to &amp;lt;fs1&amp;gt;.
    &amp;lt;fs1&amp;gt; =  fieldvalue.

  enddo.

* Append to the dynamic internal table
  append &amp;lt;dyn_wa&amp;gt; to &amp;lt;dyn_table&amp;gt;.

endform.

&lt;/CODE&gt;&lt;/PRE&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>Thu, 31 Mar 2005 14:59:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-internal-table/m-p/854277#M46873</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-03-31T14:59:38Z</dc:date>
    </item>
  </channel>
</rss>

