<?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: Create dynamic variable with dynamic type in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-variable-with-dynamic-type/m-p/6773542#M1463510</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 do this in different ways&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. if you know the structure name (i.e. mara or marc etc,)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;directly you can create the internam table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: l_struc tyepe tabname value 'MARA'. -&lt;/P&gt;&lt;HR originaltext="------------" /&gt;&lt;P&gt;&amp;gt; This can be changed as per your requirement&lt;/P&gt;&lt;P&gt;         l_data tyepe ref to data.&lt;/P&gt;&lt;P&gt;field-symbols: &amp;lt;itab&amp;gt; type any table.&lt;/P&gt;&lt;P&gt;create data l_data type standard table of  (l_struct).&lt;/P&gt;&lt;P&gt;assign l_data-&amp;gt;* to &amp;lt;itab&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. If the structure you need to build programaically then you can do this using RTTS or creating field catalog then calling normal method cl_alv_table_create=&amp;gt;create_dynamic_table to create the dynamic table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Subhankar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Subhankar Garani on Apr 8, 2010 9:17 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Apr 2010 19:16:16 GMT</pubDate>
    <dc:creator>Subhankar</dc:creator>
    <dc:date>2010-04-08T19:16:16Z</dc:date>
    <item>
      <title>Create dynamic variable with dynamic type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-variable-with-dynamic-type/m-p/6773537#M1463505</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;how can i create dynamically a variable with a dynamic type. i know i can use the following instruction but my problem is too instantiate the TYPE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE DATA dref TYPE HANDLE struct_type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example i would like to create a new data with type P0001 (HR structure).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Apr 2010 11:47:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-variable-with-dynamic-type/m-p/6773537#M1463505</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-08T11:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: Create dynamic variable with dynamic type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-variable-with-dynamic-type/m-p/6773538#M1463506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why do you use TYPE HANDLE for structure ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should use TYPE or TYPE TABLE to create data &amp;amp; then dereference it to  a field symbol.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CREATE DATA dref TYPE struct_type.

ASSIGN dref-&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>Thu, 08 Apr 2010 11:51:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-variable-with-dynamic-type/m-p/6773538#M1463506</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-04-08T11:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: Create dynamic variable with dynamic type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-variable-with-dynamic-type/m-p/6773539#M1463507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, thanks but the struct_type must be dynamical.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Apr 2010 11:53:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-variable-with-dynamic-type/m-p/6773539#M1463507</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-08T11:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: Create dynamic variable with dynamic type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-variable-with-dynamic-type/m-p/6773540#M1463508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use a field catalog instead of any specific structure, while creating the dynamic internal table . The field catalog types can be modified as per logic/conditions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create dynamic internal table and assign to FS&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_fldcat&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;P&gt;  assign new_table-&amp;gt;* to &amp;lt;dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create dynamic work area and assign to FS&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  create data new_line like line of &amp;lt;dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt;  assign new_line-&amp;gt;* to &amp;lt;dyn_wa&amp;gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Apr 2010 12:01:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-variable-with-dynamic-type/m-p/6773540#M1463508</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-08T12:01:34Z</dc:date>
    </item>
    <item>
      <title>Re: Create dynamic variable with dynamic type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-variable-with-dynamic-type/m-p/6773541#M1463509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Tora Tora,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You structure is dynamic then you can use dynamic tokens for it :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA:
V_STRUC TYPE STRUKNAME,
DREF TYPE DATA.

FIELD-SYMBOL:
&amp;lt;TAB&amp;gt; TYPE STANDARD TABLE,
&amp;lt;WA&amp;gt; TYPE ANY.

V_STRUC = 'PA0001'.

CREATE DATA DREF TYPE STANDARD TABLE OF (V_STRUC).
ASSIGN DREF-&amp;gt;* TO &amp;lt;TAB&amp;gt;.
CLEAR DREF.

CREATE DATA DREF TYPE (V_STRUC).
ASSIGN DREF-&amp;gt;* TO &amp;lt;WA&amp;gt;.
CLEAR DREF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Apr 2010 13:15:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-variable-with-dynamic-type/m-p/6773541#M1463509</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-04-08T13:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: Create dynamic variable with dynamic type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-variable-with-dynamic-type/m-p/6773542#M1463510</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 do this in different ways&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. if you know the structure name (i.e. mara or marc etc,)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;directly you can create the internam table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: l_struc tyepe tabname value 'MARA'. -&lt;/P&gt;&lt;HR originaltext="------------" /&gt;&lt;P&gt;&amp;gt; This can be changed as per your requirement&lt;/P&gt;&lt;P&gt;         l_data tyepe ref to data.&lt;/P&gt;&lt;P&gt;field-symbols: &amp;lt;itab&amp;gt; type any table.&lt;/P&gt;&lt;P&gt;create data l_data type standard table of  (l_struct).&lt;/P&gt;&lt;P&gt;assign l_data-&amp;gt;* to &amp;lt;itab&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. If the structure you need to build programaically then you can do this using RTTS or creating field catalog then calling normal method cl_alv_table_create=&amp;gt;create_dynamic_table to create the dynamic table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Subhankar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Subhankar Garani on Apr 8, 2010 9:17 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Apr 2010 19:16:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-variable-with-dynamic-type/m-p/6773542#M1463510</guid>
      <dc:creator>Subhankar</dc:creator>
      <dc:date>2010-04-08T19:16:16Z</dc:date>
    </item>
  </channel>
</rss>

