<?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: Interal table structure in runtime in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/interal-table-structure-in-runtime/m-p/4453571#M1055907</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; something like this.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;CODE&gt;
&amp;gt; data: l_ref type ref to data.
&amp;gt; field-symbols &amp;lt;fs&amp;gt; type table.
&amp;gt; 
&amp;gt; create data l_ref like it_generic.
&amp;gt; assign l_ref-&amp;gt;* to &amp;lt;fs&amp;gt;.
&amp;gt; &lt;/CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; something like this.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;CODE&gt;
&amp;gt; data: l_ref type ref to data.
&amp;gt; field-symbols &amp;lt;fs&amp;gt; type table.
&amp;gt; 
&amp;gt; create data l_ref like it_generic.
&amp;gt; assign l_ref-&amp;gt;* to &amp;lt;fs&amp;gt;.
&amp;gt; &lt;/CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ok now i have another problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;p_table_out is a CHANGING parameter in a Method. task is a public attribute in the class. This is the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Private Section.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;methods assign_structure
    changing
      p_table_out type table .


Method assign_structure.
 Case me-&amp;gt;task.

   when '01'.
     types: begin of ty_generic,
                  matnr type matnr,
                  fkimg type fkimg,
                  meins type meins,
                end of ty_generic.

    data: it_generic type table of ty_generic.

    p_table_out = it_generic
 endcase.

Endmethod.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see, if a have another value in the case statement, the parameter should have a different structure. I don't know if i can declare field-symbols as parameters in a method =S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Sep 2008 15:16:32 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-09-17T15:16:32Z</dc:date>
    <item>
      <title>Interal table structure in runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interal-table-structure-in-runtime/m-p/4453566#M1055902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello experts, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can i copy the structure of an internal table to another internal table?. Im trying to do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: p_table_out type table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of ty_generic,&lt;/P&gt;&lt;P&gt;             matnr type matnr,&lt;/P&gt;&lt;P&gt;             fkimg type fkimg,&lt;/P&gt;&lt;P&gt;             meins type meins,&lt;/P&gt;&lt;P&gt;         end of ty_generic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: it_generic type table of ty_generic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;p_table_out = it_generic. "At this point p_table_out should be exactly like it_generic, but it's not working&lt;/P&gt;&lt;P&gt;                                            " this way =(&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you help me with this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: marco hernandez on Sep 17, 2008 5:00 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Sep 2008 14:59:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interal-table-structure-in-runtime/m-p/4453566#M1055902</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-17T14:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: Interal table structure in runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interal-table-structure-in-runtime/m-p/4453567#M1055903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: l_ref type ref to data.
field-symbols &amp;lt;fs&amp;gt; type table.

create data l_ref like it_generic.
assign l_ref-&amp;gt;* to &amp;lt;fs&amp;gt;.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Sep 2008 15:02:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interal-table-structure-in-runtime/m-p/4453567#M1055903</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-17T15:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: Interal table structure in runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interal-table-structure-in-runtime/m-p/4453568#M1055904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ignore...my reply&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Sep 2008 15:02:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interal-table-structure-in-runtime/m-p/4453568#M1055904</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-17T15:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: Interal table structure in runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interal-table-structure-in-runtime/m-p/4453569#M1055905</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;you have to define the second internal table, like the first one:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;types: begin of ty_generic,
matnr type matnr,
fkimg type fkimg,
meins type meins,
end of ty_generic.

data: it_generic type table of ty_generic.

data: p_table_out table of ty_generic.
OR
data: p_table_out LIKE it_generic.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;ec&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Sep 2008 15:03:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interal-table-structure-in-runtime/m-p/4453569#M1055905</guid>
      <dc:creator>JozsefSzikszai</dc:creator>
      <dc:date>2008-09-17T15:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: Interal table structure in runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interal-table-structure-in-runtime/m-p/4453570#M1055906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do it this way &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;* CREATE STRUCTURE
FIELD-SYMBOLS: &amp;lt;fs_details&amp;gt; TYPE abap_compdescr.

  DATA : gt_details TYPE abap_compdescr_tab.

  DATA : ref_table_des TYPE REF TO cl_abap_structdescr.


* get structure
  ref_table_des ?= cl_abap_typedescr=&amp;gt;describe_by_name( 'Z_STRUCTURE' ).

  gt_details[] = ref_table_des-&amp;gt;components[].

  LOOP AT gt_details ASSIGNING &amp;lt;fs_details&amp;gt;.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = &amp;lt;fs_details&amp;gt;-name .
    wa_fieldcat-datatype = &amp;lt;fs_details&amp;gt;-type_kind.
    wa_fieldcat-inttype = &amp;lt;fs_details&amp;gt;-type_kind.
    wa_fieldcat-intlen = &amp;lt;fs_details&amp;gt;-length.
    wa_fieldcat-decimals = &amp;lt;fs_details&amp;gt;-decimals.
    APPEND wa_fieldcat TO gt_fieldcat.
  ENDLOOP.
  UNASSIGN &amp;lt;fs_details&amp;gt;.


* create dynamic internal table and assign to fs
  CALL METHOD cl_alv_table_create=&amp;gt;create_dynamic_table
               EXPORTING
                  it_fieldcatalog = gt_fieldcat[]
               IMPORTING
                  ep_table        = dy_table.
  ASSIGN dy_table-&amp;gt;* TO &amp;lt;dyn_table&amp;gt;.
* create dynamic work area and assign to fs
  CREATE DATA dy_line LIKE LINE OF &amp;lt;dyn_table&amp;gt;.
  ASSIGN dy_line-&amp;gt;* TO &amp;lt;dyn_wa&amp;gt;.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Filip Kouba on Sep 17, 2008 5:10 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Sep 2008 15:04:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interal-table-structure-in-runtime/m-p/4453570#M1055906</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-17T15:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: Interal table structure in runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interal-table-structure-in-runtime/m-p/4453571#M1055907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; something like this.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;CODE&gt;
&amp;gt; data: l_ref type ref to data.
&amp;gt; field-symbols &amp;lt;fs&amp;gt; type table.
&amp;gt; 
&amp;gt; create data l_ref like it_generic.
&amp;gt; assign l_ref-&amp;gt;* to &amp;lt;fs&amp;gt;.
&amp;gt; &lt;/CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; something like this.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;CODE&gt;
&amp;gt; data: l_ref type ref to data.
&amp;gt; field-symbols &amp;lt;fs&amp;gt; type table.
&amp;gt; 
&amp;gt; create data l_ref like it_generic.
&amp;gt; assign l_ref-&amp;gt;* to &amp;lt;fs&amp;gt;.
&amp;gt; &lt;/CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ok now i have another problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;p_table_out is a CHANGING parameter in a Method. task is a public attribute in the class. This is the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Private Section.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;methods assign_structure
    changing
      p_table_out type table .


Method assign_structure.
 Case me-&amp;gt;task.

   when '01'.
     types: begin of ty_generic,
                  matnr type matnr,
                  fkimg type fkimg,
                  meins type meins,
                end of ty_generic.

    data: it_generic type table of ty_generic.

    p_table_out = it_generic
 endcase.

Endmethod.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see, if a have another value in the case statement, the parameter should have a different structure. I don't know if i can declare field-symbols as parameters in a method =S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Sep 2008 15:16:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interal-table-structure-in-runtime/m-p/4453571#M1055907</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-17T15:16:32Z</dc:date>
    </item>
  </channel>
</rss>

