<?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: Dynamic Structure Creation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306621#M791911</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thing is that, The system generated table has components of a particular data type. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That table is of type hashed. I want to create another table by looking at this table modifying the keys plus data type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THe reason for modificatin of the data type is that when you perform a collect on hashed table the components that are not keys has to be of type C, I, P,N other wise it throws exception and thats why i am modifying the data type ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Feb 2008 13:28:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-02-12T13:28:13Z</dc:date>
    <item>
      <title>Dynamic Structure Creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306596#M791886</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;I want to create a structure during runtime. There are 3 fields A,B,C. &lt;/P&gt;&lt;P&gt;During Creation of Structure it MIGHT Have any combination of components A,B,C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do i create that structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For eg: Struct 1,&lt;/P&gt;&lt;P&gt;                  A Type ....&lt;/P&gt;&lt;P&gt;                  B Type ...&lt;/P&gt;&lt;P&gt;          End of Struct 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Struct 2&lt;/P&gt;&lt;P&gt;      B Type...&lt;/P&gt;&lt;P&gt;       C Type..&lt;/P&gt;&lt;P&gt;End Struct 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Struct 3&lt;/P&gt;&lt;P&gt;      B Type...&lt;/P&gt;&lt;P&gt;End Struct 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the Dynamically structure can have any components ?&lt;/P&gt;&lt;P&gt;PLEASE HELP URGENTLY.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2008 13:11:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306596#M791886</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-06T13:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Structure Creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306597#M791887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This seems to be easy:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you ever heard of RTTI (Run Time Type Interface)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To create a descriptor of a structure dynamically at run time, call the static method CREATE of class CL_ABAP_STRUCTDESCR and provide a list of the components to parameter P_COMPONENTS. The result is a descriptor of that structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Afterwards you may execute CREATE DATA ... TYPE HANDLE &lt;EM&gt;structure descriptor&lt;/EM&gt; to create a data object having this structure.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2008 13:21:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306597#M791887</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-06T13:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Structure Creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306598#M791888</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;use field-groups in stead of creating the structure.&lt;/P&gt;&lt;P&gt;REPORT demo_extract. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NODES: spfli, sflight. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-GROUPS: header, flight_info, flight_date. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  INSERT: spfli-carrid spfli-connid &lt;/P&gt;&lt;P&gt;          INTO header, &lt;/P&gt;&lt;P&gt;          spfli-cityfrom spfli-cityto &lt;/P&gt;&lt;P&gt;          INTO flight_info. &lt;/P&gt;&lt;P&gt;INSERT:sflight-fldate INTO header.&lt;/P&gt;&lt;P&gt;(after inserting the fields u want u can extract this will stop further insertion of the fields)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GET spfli. (instead u can use selection statements here)&lt;/P&gt;&lt;P&gt;  EXTRACT flight_info. &lt;/P&gt;&lt;P&gt;(move the values in the fields to some internal table)&lt;/P&gt;&lt;P&gt;GET sflight. &lt;/P&gt;&lt;P&gt;  EXTRACT flight_date. &lt;/P&gt;&lt;P&gt;(move the values in the fields to some internal table)&lt;/P&gt;&lt;P&gt;end-of-selection.&lt;/P&gt;&lt;P&gt;(u can print the data here)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds,&lt;/P&gt;&lt;P&gt;bharat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2008 13:23:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306598#M791888</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-06T13:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Structure Creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306599#M791889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think if you want the structure to be dynamic, you need to build it on the fly, in this case I think you need to create a dynamic internal table first, and then create structure or work area based off that.  Check this blog for the solution.  Check the part where &amp;lt;dyn_wa&amp;gt; is created, this is a field symbol for a dynamically built structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap&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>Wed, 06 Feb 2008 13:29:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306599#M791889</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2008-02-06T13:29:18Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Structure Creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306600#M791890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;good&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check this code of creating dynamic structure and work accordingly,hope this would give you the solution of your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT zmaschl_create_data_dynamic . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE-POOLS: slis. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: it_fcat TYPE slis_t_fieldcat_alv, &lt;/P&gt;&lt;P&gt;      is_fcat LIKE LINE OF it_fcat. &lt;/P&gt;&lt;P&gt;DATA: it_fieldcat TYPE lvc_t_fcat, &lt;/P&gt;&lt;P&gt;      is_fieldcat LIKE LINE OF it_fieldcat. &lt;/P&gt;&lt;P&gt;DATA: new_table TYPE REF TO data. &lt;/P&gt;&lt;P&gt;DATA: new_line  TYPE REF TO data. &lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;l_table&amp;gt; TYPE ANY TABLE, &lt;/P&gt;&lt;P&gt;               &amp;lt;l_line&amp;gt;  TYPE ANY, &lt;/P&gt;&lt;P&gt;               &amp;lt;l_field&amp;gt; TYPE ANY. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Build fieldcat &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE' &lt;/P&gt;&lt;P&gt;       EXPORTING &lt;/P&gt;&lt;P&gt;           i_structure_name = 'SYST' &lt;/P&gt;&lt;P&gt;       CHANGING &lt;/P&gt;&lt;P&gt;           ct_fieldcat      = it_fcat[]. &lt;/P&gt;&lt;P&gt;   LOOP AT it_fcat INTO is_fcat WHERE NOT reptext_ddic IS initial. &lt;/P&gt;&lt;P&gt;        MOVE-CORRESPONDING is_fcat TO is_fieldcat. &lt;/P&gt;&lt;P&gt;        is_fieldcat-fieldname = is_fcat-fieldname. &lt;/P&gt;&lt;P&gt;        is_fieldcat-ref_field = is_fcat-fieldname. &lt;/P&gt;&lt;P&gt;        is_fieldcat-ref_table = is_fcat-ref_tabname. &lt;/P&gt;&lt;P&gt;        APPEND is_fieldcat TO it_fieldcat. &lt;/P&gt;&lt;P&gt;   ENDLOOP. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create a new Table &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL METHOD cl_alv_table_create=&amp;gt;create_dynamic_table &lt;/P&gt;&lt;P&gt;       EXPORTING &lt;/P&gt;&lt;P&gt;        it_fieldcatalog = it_fieldcat &lt;/P&gt;&lt;P&gt;       IMPORTING &lt;/P&gt;&lt;P&gt;        ep_table        = new_table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create a new Line with the same structure of the table. &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ASSIGN new_table-&amp;gt;* TO &amp;lt;l_table&amp;gt;. &lt;/P&gt;&lt;P&gt;CREATE DATA new_line LIKE LINE OF &amp;lt;l_table&amp;gt;. &lt;/P&gt;&lt;P&gt;ASSIGN new_line-&amp;gt;* TO &amp;lt;l_line&amp;gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Test it... &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   DO 30 TIMES. &lt;/P&gt;&lt;P&gt;      ASSIGN COMPONENT 'SUBRC' OF STRUCTURE &amp;lt;l_line&amp;gt; TO &amp;lt;l_field&amp;gt;. &lt;/P&gt;&lt;P&gt;      &amp;lt;l_field&amp;gt; = sy-index. &lt;/P&gt;&lt;P&gt;      INSERT &amp;lt;l_line&amp;gt; INTO TABLE &amp;lt;l_table&amp;gt;. &lt;/P&gt;&lt;P&gt;   ENDDO. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   LOOP AT &amp;lt;l_table&amp;gt; ASSIGNING &amp;lt;l_line&amp;gt;. &lt;/P&gt;&lt;P&gt;      ASSIGN COMPONENT 'SUBRC' OF STRUCTURE &amp;lt;l_line&amp;gt; TO &amp;lt;l_field&amp;gt;. &lt;/P&gt;&lt;P&gt;      WRITE &amp;lt;l_field&amp;gt;. &lt;/P&gt;&lt;P&gt;   ENDLOOP. &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;mrutyun^&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2008 13:31:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306600#M791890</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-06T13:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Structure Creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306601#M791891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rich:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You don´t have to create an internal table first. You can create a structure descriptor using RTTI (CL_ABAP_STRUCTDESCR) and create an data object afterwards referencing this structure descriptor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2008 13:38:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306601#M791891</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-06T13:38:08Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Structure Creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306602#M791892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here an example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TYPE-POOLS:
  abap.

DATA:
  gr_structdescr    TYPE REF TO cl_abap_structdescr,
  gt_components     TYPE abap_component_tab,
  gw_component      TYPE LINE OF abap_component_tab,
  gr_wa             TYPE REF TO data.


START-OF-SELECTION.

* determine components of structure -&amp;gt; GT_COMPONENTS
  MOVE 'COMP1' TO gw_component-name.
  gw_component-type ?= cl_abap_elemdescr=&amp;gt;get_string( ).
  INSERT gw_component INTO TABLE gt_components.

  MOVE 'COMP2' TO gw_component-name.
  gw_component-type ?= cl_abap_elemdescr=&amp;gt;get_i( ).
  INSERT gw_component INTO TABLE gt_components.


* get structure descriptor -&amp;gt; GR_STRUCTDESCR
  gr_structdescr ?= cl_abap_structdescr=&amp;gt;create( gt_components ).


* create work area of structure GR_STRUCTDESCR -&amp;gt; GR_WA
  CREATE DATA gr_wa TYPE HANDLE gr_structdescr.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;lt;REMOVED BY MODERATOR&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alvaro Tejada Galindo on Feb 11, 2008 5:18 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2008 13:47:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306602#M791892</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-06T13:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Structure Creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306603#M791893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rich &lt;/P&gt;&lt;P&gt;how can you create internal table first. The fields that structure will have as an component will come from selection screens where users will select by checking the checkbox that i want these fields in the internal table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2008 14:23:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306603#M791893</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-06T14:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Structure Creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306604#M791894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mike.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do  you describe fields/components as KEY using RTTI&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Beacuase some components will act as a key in internal table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2008 14:25:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306604#M791894</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-06T14:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Structure Creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306605#M791895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here the enhanced coding, that also creates an internal table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TYPE-POOLS:
  abap.

DATA:
  gr_structdescr    TYPE REF TO cl_abap_structdescr,
  gr_tabledescr     TYPE REF TO cl_abap_tabledescr,
  gt_components     TYPE abap_component_tab,
  gw_component      TYPE LINE OF abap_component_tab,
  gt_keys           TYPE abap_keydescr_tab,
  gw_key            TYPE LINE OF abap_keydescr_tab,
  gr_wa             TYPE REF TO data,
  gr_itab           TYPE REF TO data.


FIELD-SYMBOLS:
  &amp;lt;gw_wa&amp;gt;           TYPE ANY,
  &amp;lt;gt_itab&amp;gt;         TYPE ANY TABLE.


START-OF-SELECTION.

* determine components of structure -&amp;gt; GT_COMPONENTS
  MOVE 'COMP1' TO gw_component-name.
  gw_component-type ?= cl_abap_elemdescr=&amp;gt;get_string( ).
  INSERT gw_component INTO TABLE gt_components.

  MOVE 'COMP2' TO gw_component-name.
  gw_component-type ?= cl_abap_elemdescr=&amp;gt;get_i( ).
  INSERT gw_component INTO TABLE gt_components.


* get structure descriptor -&amp;gt; GR_STRUCTDESCR
  gr_structdescr ?= cl_abap_structdescr=&amp;gt;create( gt_components ).


* create work area of structure GR_STRUCTDESCR -&amp;gt; GR_WA
  CREATE DATA gr_wa TYPE HANDLE gr_structdescr.

  ASSIGN gr_wa-&amp;gt;* TO &amp;lt;gw_wa&amp;gt;.


* determine key components -&amp;gt; GT_KEYS
  MOVE 'COMP1' TO gw_key-name.
  INSERT gw_key INTO TABLE gt_keys.


* create descriptor for internal table -&amp;gt; GR_TABLEDESCR
  gr_tabledescr ?= cl_abap_tabledescr=&amp;gt;create( p_line_type  = gr_structdescr
                                               p_table_kind = cl_abap_tabledescr=&amp;gt;tablekind_hashed
                                               p_unique     = abap_true
                                               p_key        = gt_keys
                                               p_key_kind   = cl_abap_tabledescr=&amp;gt;keydefkind_user ).


* create internal table -&amp;gt; GR_ITAB
  CREATE DATA gr_itab TYPE HANDLE gr_tabledescr.

  ASSIGN gr_itab-&amp;gt;* TO &amp;lt;gt_itab&amp;gt;.

  sy-subrc = sy-subrc.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;lt;REMOVED BY MODERATOR&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alvaro Tejada Galindo on Feb 11, 2008 5:19 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2008 14:36:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306605#M791895</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-06T14:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Structure Creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306606#M791896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Very nice Mike.  I like it.  I did not know that you could create a structure by adding the components like that.  Very nice.  Thanks.&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>Wed, 06 Feb 2008 14:44:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306606#M791896</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2008-02-06T14:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Structure Creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306607#M791897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mike.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thats a good one. Will assign points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May i have your email address in case i need to contact you please Mike ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2008 14:53:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306607#M791897</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-06T14:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Structure Creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306608#M791898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@AMC:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks. Have a look at my Profile here in SDN by clicking my name on the left side of this message, there you should find my eMail address, don´t you?!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--MIKE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2008 15:38:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306608#M791898</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-06T15:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Structure Creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306609#M791899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Matt,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a function module that has dynamic generation of internal table code. The generation has succesfully.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do i call the function module given the and get back a dynamic internal table given the above code in the function module&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2008 16:54:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306609#M791899</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-08T16:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Structure Creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306610#M791900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you please paste the code of your FM? That would make things easier&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Feb 2008 07:47:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306610#M791900</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-11T07:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Structure Creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306611#M791901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   I understood that part. Thats fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another challenge that i am facing now is that i want to use RTTC/RTTI to dynamically create a internal table looking at th e structure of another internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For eg: Table A is created dynamically by the system and then i want to create another Table B dynamically looking at the structure of Table A.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help. THis is very important to my work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Feb 2008 20:10:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306611#M791901</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-11T20:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Structure Creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306612#M791902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi AMC,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can use the RTTI type descriptor (table type) more than just one time. So it should be no problem to create another internal table of the same type...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--MIKE&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Feb 2008 21:23:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306612#M791902</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-11T21:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Structure Creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306613#M791903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have an example code please. The important thing to this is that the keys are different. Table A has 2 keys and Tale B has 3 keys&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please provide an code example&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Feb 2008 09:00:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306613#M791903</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-12T09:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Structure Creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306614#M791904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
TYPE-POOLS:
  abap.
 
DATA:
  gr_structdescr    TYPE REF TO cl_abap_structdescr,
  gr_tabledescr1    TYPE REF TO cl_abap_tabledescr,
  gr_tabledescr2    TYPE REF TO cl_abap_tabledescr,
  gt_components     TYPE abap_component_tab,
  gw_component      TYPE LINE OF abap_component_tab,
  gt_keys           TYPE abap_keydescr_tab,
  gw_key            TYPE LINE OF abap_keydescr_tab,
  gr_wa             TYPE REF TO data,
  gr_itab1          TYPE REF TO data,
  gr_itab2			TYPE REF TO data.
 
 
FIELD-SYMBOLS:
  &amp;lt;gw_wa&amp;gt;           TYPE ANY,
  &amp;lt;gt_itab1&amp;gt;        TYPE ANY TABLE,
  &amp;lt;gt_itab2&amp;gt;		TYPE ANY TABLE.
 
 
START-OF-SELECTION.
 
* determine components of structure -&amp;gt; GT_COMPONENTS
  MOVE 'COMP1' TO gw_component-name.
  gw_component-type ?= cl_abap_elemdescr=&amp;gt;get_string( ).
  INSERT gw_component INTO TABLE gt_components.
 
  MOVE 'COMP2' TO gw_component-name.
  gw_component-type ?= cl_abap_elemdescr=&amp;gt;get_i( ).
  INSERT gw_component INTO TABLE gt_components.
 
 
* get structure descriptor -&amp;gt; GR_STRUCTDESCR
  gr_structdescr ?= cl_abap_structdescr=&amp;gt;create( gt_components ).
 
 
* create work area of structure GR_STRUCTDESCR -&amp;gt; GR_WA
  CREATE DATA gr_wa TYPE HANDLE gr_structdescr.
 
  ASSIGN gr_wa-&amp;gt;* TO &amp;lt;gw_wa&amp;gt;.
 
 
* determine key components -&amp;gt; GT_KEYS
  MOVE 'COMP1' TO gw_key-name.
  INSERT gw_key INTO TABLE gt_keys.
 
 
* create descriptor for internal table -&amp;gt; GR_TABLEDESCR1
  gr_tabledescr1 ?= cl_abap_tabledescr=&amp;gt;create( p_line_type  = gr_structdescr
                                               p_table_kind = cl_abap_tabledescr=&amp;gt;tablekind_hashed
                                               p_unique     = abap_true
                                               p_key        = gt_keys
                                               p_key_kind   = cl_abap_tabledescr=&amp;gt;keydefkind_user ).
 
 
* create internal table -&amp;gt; GR_ITAB1
  CREATE DATA gr_itab1 TYPE HANDLE gr_tabledescr1.
 
  ASSIGN gr_itab1-&amp;gt;* TO &amp;lt;gt_itab1&amp;gt;.
  
  
* determine key components -&amp;gt; GT_KEYS
  MOVE 'COMP2' TO gw_key-name.
  INSERT gw_key INTO TABLE gt_keys.
 
 
* create descriptor for internal table -&amp;gt; GR_TABLEDESCR2
  gr_tabledescr2 ?= cl_abap_tabledescr=&amp;gt;create( p_line_type  = gr_structdescr
                                               p_table_kind = cl_abap_tabledescr=&amp;gt;tablekind_hashed
                                               p_unique     = abap_true
                                               p_key        = gt_keys
                                               p_key_kind   = cl_abap_tabledescr=&amp;gt;keydefkind_user ).
 
 
* create internal table -&amp;gt; GR_ITAB2
  CREATE DATA gr_itab2 TYPE HANDLE gr_tabledescr2.
 
  ASSIGN gr_itab2-&amp;gt;* TO &amp;lt;gt_itab2&amp;gt;.
  
  
  
* &amp;lt;GT_ITAB1&amp;gt; has a key with 1 component
* &amp;lt;GT_ITAB2&amp;gt; has a key with 2 components
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Feb 2008 09:37:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306614#M791904</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-12T09:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Structure Creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306615#M791905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem is that i am not creating the structure from the scratch but i have the internal table of type hashed and i want to use that table to &lt;STRONG&gt;modify the keys&lt;/STRONG&gt; of the same hashed table or the new hashed table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help with code sample i am appreciating your every second here.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Feb 2008 09:50:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation/m-p/3306615#M791905</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-12T09:50:42Z</dc:date>
    </item>
  </channel>
</rss>

