<?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 Create Dynamic Structure based on Field-Symbol in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-structure-based-on-field-symbol/m-p/8571648#M1659983</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to create a structure with dynamic structure included within.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a parameter on sel. screen in which we provide table name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: p_table TYPE tabname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;gt_data&amp;gt; TYPE ANY TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE DATA gr_data TYPE TABLE OF (p_table).&lt;/P&gt;&lt;P&gt;ASSIGN gr_data-* TO &amp;lt;gt_data&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I need a structure like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF type_test,&lt;/P&gt;&lt;P&gt;struct TYPE &amp;lt;gt_data&amp;gt;, " dynamic structure based on table name entered on sel. screen&lt;/P&gt;&lt;P&gt;fld1 TYPE c,&lt;/P&gt;&lt;P&gt;fld2 TYPE n,&lt;/P&gt;&lt;P&gt;END OF type_test.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can somebody suggest how to achieve this?&lt;/P&gt;&lt;P&gt;Your help is highly appreciated. Thanks a lot&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Feb 2012 08:47:57 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2012-02-23T08:47:57Z</dc:date>
    <item>
      <title>Create Dynamic Structure based on Field-Symbol</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-structure-based-on-field-symbol/m-p/8571648#M1659983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to create a structure with dynamic structure included within.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a parameter on sel. screen in which we provide table name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: p_table TYPE tabname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;gt_data&amp;gt; TYPE ANY TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE DATA gr_data TYPE TABLE OF (p_table).&lt;/P&gt;&lt;P&gt;ASSIGN gr_data-* TO &amp;lt;gt_data&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I need a structure like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF type_test,&lt;/P&gt;&lt;P&gt;struct TYPE &amp;lt;gt_data&amp;gt;, " dynamic structure based on table name entered on sel. screen&lt;/P&gt;&lt;P&gt;fld1 TYPE c,&lt;/P&gt;&lt;P&gt;fld2 TYPE n,&lt;/P&gt;&lt;P&gt;END OF type_test.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can somebody suggest how to achieve this?&lt;/P&gt;&lt;P&gt;Your help is highly appreciated. Thanks a lot&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2012 08:47:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-structure-based-on-field-symbol/m-p/8571648#M1659983</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-02-23T08:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: Create Dynamic Structure based on Field-Symbol</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-structure-based-on-field-symbol/m-p/8571649#M1659984</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 can achieve this with RTTS classes... mainly CL_ABAP_TYPEDESCR, CL_ABAP_STRUCDESCR &amp;amp; CL_ABAP_TABLEDESCR... There are a lot of examples on how to use them here or on the web.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Get back if you're still stuck&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kr,&lt;/P&gt;&lt;P&gt;Manu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2012 09:00:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-structure-based-on-field-symbol/m-p/8571649#M1659984</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-02-23T09:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: Create Dynamic Structure based on Field-Symbol</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-structure-based-on-field-symbol/m-p/8571650#M1659985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can view this thread where our friend Marcin rocks .. &lt;SPAN __jive_macro_name="thread" id="1725739"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FIELD-SYMBOLS: &amp;lt;gt_data&amp;gt; TYPE ANY TABLE.
FIELD-SYMBOLS: &amp;lt;gs_wa&amp;gt; TYPE ANY.
data:wf_ref type ref to data.
DATA:i_comp TYPE cl_abap_structdescr=&amp;gt;component_table,
     i_tot_comp TYPE cl_abap_structdescr=&amp;gt;component_table.

CREATE DATA gr_data TYPE TABLE OF (p_table).
ASSIGN gr_data-* TO &amp;lt;gt_data&amp;gt;.
create data wf_ref like line of &amp;lt;gt_data&amp;gt;.
assign wf_ref-&amp;gt;* to &amp;lt;gs_wa&amp;gt;.

*--Getting Compoents from existing type
  lf_struct ?= cl_abap_typedescr=&amp;gt;describe_by_name( '&amp;lt;GS_WA&amp;gt;' ).
  i_comp = lf_struct-&amp;gt;get_components( ).
  APPEND LINES OF i_comp TO i_tot_comp.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The idea is Get all the field details available it to i_tot_comp, then append individual fields manually to &lt;/P&gt;&lt;P&gt;i_tot_comp as explained in the link and create a dynamic structure and table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2012 09:00:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-structure-based-on-field-symbol/m-p/8571650#M1659985</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2012-02-23T09:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Create Dynamic Structure based on Field-Symbol</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-structure-based-on-field-symbol/m-p/8571651#M1659986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;for wa add the following code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; declare a field symbol&lt;/P&gt;&lt;P&gt; FIELD-SYMBOLS:  &amp;lt;fs_itab_line&amp;gt; TYPE ANY.&lt;/P&gt;&lt;P&gt;*create one data refrence&lt;/P&gt;&lt;P&gt;data: obj_itab_line TYPE REF TO data.&lt;/P&gt;&lt;P&gt;*wa instance&lt;/P&gt;&lt;P&gt;  CREATE DATA:obj_itab_line TYPE (p_tab).&lt;/P&gt;&lt;P&gt;*assigne FS to wa instance&lt;/P&gt;&lt;P&gt;  ASSIGN obj_itab_line-&amp;gt;* TO &amp;lt;fs_itab_line&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now this &amp;lt;fs_itab_line&amp;gt; will refer to wa of table which is entered in parameter.&lt;/P&gt;&lt;P&gt;I hope this will solve ur problem. if any issue please let me know..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rajeev Goswami&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2012 09:10:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-structure-based-on-field-symbol/m-p/8571651#M1659986</guid>
      <dc:creator>rajeevgoswami1</dc:creator>
      <dc:date>2012-02-23T09:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: Create Dynamic Structure based on Field-Symbol</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-structure-based-on-field-symbol/m-p/8571652#M1659987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try  ...............&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: obj TYPE REF TO data.&lt;/P&gt;&lt;P&gt;PARAMETERS: p_table TYPE tabname.&lt;/P&gt;&lt;P&gt;CREATE DATA:obj TYPE (p_table).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF type_test,&lt;/P&gt;&lt;P&gt;              struct like obj, &lt;/P&gt;&lt;P&gt;              fld1 TYPE c,&lt;/P&gt;&lt;P&gt;              fld2 TYPE n,&lt;/P&gt;&lt;P&gt;           END OF type_test.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2012 09:46:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-structure-based-on-field-symbol/m-p/8571652#M1659987</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-02-23T09:46:37Z</dc:date>
    </item>
  </channel>
</rss>

