<?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 Re: get_component_list in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-component-list/m-p/1068658#M94116</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a sample program.  Implement it in your system.  Does it work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0003.

types: begin of type_item,
       f1(3),
       f2(3),
       f3(3),
       f4(3),
       end of type_item.

types: begin of type_data,
       data(800),
       end of type_data.

data:  lineitems type table of type_item with header line,
       t_output type table of type_data with header line,
       fieldlist type table of rstrucinfo with header line,
       fieldsym  type table of rfieldlist with header line.

data:  syrepid type sy-repid.

data:  fieldname like fieldlist-compname,
       data_line type type_data.

field-symbols : &amp;lt;fs1&amp;gt; type any,
                &amp;lt;fs2&amp;gt; type any.

lineitems-f1 = 'a1'.
lineitems-f2 = 'a2'.
lineitems-f3 = 'a3'.
lineitems-f4 = 'a4'.
append lineitems.

lineitems-f1 = 'b1'.
lineitems-f2 = 'b2'.
lineitems-f3 = 'b3'.
lineitems-f4 = 'b4'.
append lineitems.

lineitems-f1 = 'c1'.
lineitems-f2 = 'c2'.
lineitems-f3 = 'c3'.
lineitems-f4 = 'c4'.
append lineitems.

lineitems-f1 = 'd1'.
lineitems-f2 = 'd2'.
lineitems-f3 = 'd3'.
lineitems-f4 = 'd4'.
append lineitems.

syrepid = sy-repid.

* Gets all of the global data types.
call function 'GET_GLOBAL_SYMBOLS'
     exporting
          program   = syrepid
     tables
          fieldlist = fieldsym.

* gets all of the components of a structure
call function 'GET_COMPONENT_LIST'
     exporting
          program    = syrepid
          fieldname  = 'lineitems'
     tables
          components = fieldlist.

format color 3.

loop at lineitems assigning &amp;lt;fs2&amp;gt; .

  loop at fieldlist.
    fieldname = fieldlist-compname .
    assign component  fieldname  of structure &amp;lt;fs2&amp;gt; to &amp;lt;fs1&amp;gt;.
    concatenate data_line &amp;lt;fs1&amp;gt; into data_line .
  endloop.
  append data_line to t_output.
  clear data_line.
endloop.

loop at t_output.
  write:/ t_output.
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>Thu, 15 Dec 2005 15:57:57 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2005-12-15T15:57:57Z</dc:date>
    <item>
      <title>get_component_list</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-component-list/m-p/1068657#M94115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using the FM 'GET_COMPONENT_LIST' to get the fields of a IT, but it's not working, I'm in 4.7&lt;/P&gt;&lt;P&gt;Not even in SE37 it's working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there some restriction to use it in 4.7, or someone know another way to get the fields of a internal table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alexandre Nogueira&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Dec 2005 15:54:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-component-list/m-p/1068657#M94115</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-15T15:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: get_component_list</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-component-list/m-p/1068658#M94116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a sample program.  Implement it in your system.  Does it work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0003.

types: begin of type_item,
       f1(3),
       f2(3),
       f3(3),
       f4(3),
       end of type_item.

types: begin of type_data,
       data(800),
       end of type_data.

data:  lineitems type table of type_item with header line,
       t_output type table of type_data with header line,
       fieldlist type table of rstrucinfo with header line,
       fieldsym  type table of rfieldlist with header line.

data:  syrepid type sy-repid.

data:  fieldname like fieldlist-compname,
       data_line type type_data.

field-symbols : &amp;lt;fs1&amp;gt; type any,
                &amp;lt;fs2&amp;gt; type any.

lineitems-f1 = 'a1'.
lineitems-f2 = 'a2'.
lineitems-f3 = 'a3'.
lineitems-f4 = 'a4'.
append lineitems.

lineitems-f1 = 'b1'.
lineitems-f2 = 'b2'.
lineitems-f3 = 'b3'.
lineitems-f4 = 'b4'.
append lineitems.

lineitems-f1 = 'c1'.
lineitems-f2 = 'c2'.
lineitems-f3 = 'c3'.
lineitems-f4 = 'c4'.
append lineitems.

lineitems-f1 = 'd1'.
lineitems-f2 = 'd2'.
lineitems-f3 = 'd3'.
lineitems-f4 = 'd4'.
append lineitems.

syrepid = sy-repid.

* Gets all of the global data types.
call function 'GET_GLOBAL_SYMBOLS'
     exporting
          program   = syrepid
     tables
          fieldlist = fieldsym.

* gets all of the components of a structure
call function 'GET_COMPONENT_LIST'
     exporting
          program    = syrepid
          fieldname  = 'lineitems'
     tables
          components = fieldlist.

format color 3.

loop at lineitems assigning &amp;lt;fs2&amp;gt; .

  loop at fieldlist.
    fieldname = fieldlist-compname .
    assign component  fieldname  of structure &amp;lt;fs2&amp;gt; to &amp;lt;fs1&amp;gt;.
    concatenate data_line &amp;lt;fs1&amp;gt; into data_line .
  endloop.
  append data_line to t_output.
  clear data_line.
endloop.

loop at t_output.
  write:/ t_output.
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>Thu, 15 Dec 2005 15:57:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-component-list/m-p/1068658#M94116</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-12-15T15:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: get_component_list</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-component-list/m-p/1068659#M94117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeap Rich, your program worked Ok.&lt;/P&gt;&lt;P&gt;The FM 'GET_GLOBAL_SYMBOLS' have worked to MY program, but 'GET_COMPONENT_LIST' did not... In Se37.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is my report, to other reports it works, but I don't Know what is the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alexandre Nogueira&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Alexandre Nogueira&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Dec 2005 16:28:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-component-list/m-p/1068659#M94117</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-15T16:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: get_component_list</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-component-list/m-p/1068660#M94118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Interesting, can you post your code and I can check it in my system?  Or you can email it to me.  My email is on my business card.&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>Thu, 15 Dec 2005 16:30:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-component-list/m-p/1068660#M94118</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-12-15T16:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: get_component_list</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-component-list/m-p/1068661#M94119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh man, you won't believe what is the problem... I found it out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was trying the use the FM GET_COMPONENT_LIST passing a IT that does not have header line, and it does not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The IT HAVE TO have a header line.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Dec 2005 16:42:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-component-list/m-p/1068661#M94119</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-15T16:42:33Z</dc:date>
    </item>
    <item>
      <title>Re: get_component_list</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-component-list/m-p/1068662#M94120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hmmm.. That's funny.  Does it work if you pass a work area like the itab?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for telling us how you fixed it.&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>Thu, 15 Dec 2005 16:43:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-component-list/m-p/1068662#M94120</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-12-15T16:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: get_component_list</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-component-list/m-p/1068663#M94121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you pass only a work area, it works, but if you pass a itab that does't have header line, it, does not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try it in that sample program that you sent me today.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alexandre nogueira&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Dec 2005 17:02:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-component-list/m-p/1068663#M94121</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-15T17:02:49Z</dc:date>
    </item>
  </channel>
</rss>

