<?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: ABAP Descriptor Classes for Dynamic Local Declarations in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-descriptor-classes-for-dynamic-local-declarations/m-p/773296#M38565</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arunava&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure that I have exactly understand your requirement but will this information help? I guess it will be OK in case you have definite structure name in the ABAP dictionary or in the program. Otherwise, if you are talking about creating a table type where you never guess before runtime I think previos post will be closer to you solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*-- Generic variable
DATA gr_xxx TYPE REF TO DATA .
*-- Variable to hold name of the structure for casting
DATA gv_str_name(30) TYPE c .
*-- Variable to hold each component name of the structure
DATA gv_comp_name(30) TYPE c .
*-- Field symbol to get reference of the structure
FIELD-SYMBOLS: &amp;lt;fs&amp;gt; TYPE ANY .
*-- Field symbol to get reference of the component
FIELD-SYMBOLS: &amp;lt;comp&amp;gt; TYPE ANY .

*--Creating variable
CREATE DATA gr_xxx LIKE (gv_str_name) .
*--or CREATE DATA gr_xxx TYPE (gv_str_name) .

ASSIGN gr_xxx-&amp;gt;* TO &amp;lt;fs&amp;gt; CASTING LIKE (gv_str_name) .
*--or ASSIGN gr_xxx-&amp;gt;* TO &amp;lt;fs&amp;gt; CASTING LIKE (gv_str_name) .

.. ..

*--To reach each component
ASSIGN COMPONENT (gv_compname) OF STRUCTURE &amp;lt;fs&amp;gt; TO &amp;lt;comp&amp;gt; .
.. ..
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Serdar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Oct 2004 20:02:37 GMT</pubDate>
    <dc:creator>ssimsekler</dc:creator>
    <dc:date>2004-10-21T20:02:37Z</dc:date>
    <item>
      <title>ABAP Descriptor Classes for Dynamic Local Declarations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-descriptor-classes-for-dynamic-local-declarations/m-p/773287#M38556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friednds,&lt;/P&gt;&lt;P&gt;I need to create Local Internal table in my program. I had initially used cl_alv_table_create=&amp;gt;create_dynamic_table for my table creation. But due to a limitation I canot use this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Someone told me I can use Descriptor Classes for this.&lt;/P&gt;&lt;P&gt;But I dont know how to use it to create the local table..&lt;/P&gt;&lt;P&gt;I am having all the fieldnames and their Types at present in my program. How do I call these classes to crete my Local Tables and Structures.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Arunava&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2004 07:14:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-descriptor-classes-for-dynamic-local-declarations/m-p/773287#M38556</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2004-10-21T07:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Descriptor Classes for Dynamic Local Declarations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-descriptor-classes-for-dynamic-local-declarations/m-p/773288#M38557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arunava,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the class CL_ABAP_TABLEDESCR to do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. If you need don't have the row type available first create the row type by filling a table of components (type comp_tab) and create the type using class CL_ABAP_STRUCTDESCR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Then create the table like:&lt;/P&gt;&lt;P&gt;   zz_tabletype = cl_abap_tabledescr=&amp;gt;create(&lt;/P&gt;&lt;P&gt;          p_line_type = &amp;lt;type of the row&amp;gt;&lt;/P&gt;&lt;P&gt;          p_table_kind = (e.g. cl_abap_tablesdescr=&amp;gt;tablekind_sorted)&lt;/P&gt;&lt;P&gt;          p_key       = &amp;lt;key&amp;gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Then CREATE DATA dref TYPE HANdle zz_tabletype.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. And finally assign a the created table to a field symbol for further processing: ASSIGN dref-&amp;gt;* to &amp;lt;table&amp;gt;.   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;John.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2004 08:09:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-descriptor-classes-for-dynamic-local-declarations/m-p/773288#M38557</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2004-10-21T08:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Descriptor Classes for Dynamic Local Declarations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-descriptor-classes-for-dynamic-local-declarations/m-p/773289#M38558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May the requirement be fulfilled just using generic data decleration, i.e. &amp;lt;i&amp;gt;xxx TYPE REF TO DATA .&amp;lt;/i&amp;gt; and casting i.e. &amp;lt;i&amp;gt;CREATE DATA xxx CASTING LIKE yyy .&amp;lt;/i&amp;gt;?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Serdar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2004 10:26:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-descriptor-classes-for-dynamic-local-declarations/m-p/773289#M38558</guid>
      <dc:creator>ssimsekler</dc:creator>
      <dc:date>2004-10-21T10:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Descriptor Classes for Dynamic Local Declarations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-descriptor-classes-for-dynamic-local-declarations/m-p/773290#M38559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help...but I am not able to create the row type by filling each compoent...&lt;/P&gt;&lt;P&gt;Can you please help with regards to the data element type for filling the row type of the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cant find the type (comp_tab) that you have mentioned.This element is in which class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Arunava&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2004 10:37:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-descriptor-classes-for-dynamic-local-declarations/m-p/773290#M38559</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2004-10-21T10:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Descriptor Classes for Dynamic Local Declarations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-descriptor-classes-for-dynamic-local-declarations/m-p/773291#M38560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arunava,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check class CL_ABAP_STRUCTDESCR, you will find type COMPONENT_TABLE there.&lt;/P&gt;&lt;P&gt;So you can defines this table in your program like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;  COMP_TAB type CL_ABAP_STRUCTDESCR=&amp;gt;component_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To fill the component table you can use the following example (adding component of table VBAK):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;  comp_tab     TYPE cl_abap_structdescr=&amp;gt;component_table     &lt;/P&gt;&lt;P&gt;  comp_line    LIKE LINE OF comp_tab,&lt;/P&gt;&lt;P&gt;  new_linetype TYPE REF TO cl_abap_structdescr,&lt;/P&gt;&lt;P&gt;  tab_key      TYPE abap_keydescr_tab,&lt;/P&gt;&lt;P&gt;  vbak_type    TYPE REF TO cl_abap_structdescr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vbak_type ?= cl_abap_typedescr=&amp;gt;describe_by_name('VBAK')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;comp_tab = vbak_type-&amp;gt;get_Components( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table comp_tab&lt;/P&gt;&lt;P&gt;    with key name = 'VBELN'&lt;/P&gt;&lt;P&gt;    into comp_line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append comp_line to comp_tab.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;. (for each component you need)&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;new_linetype = cl_abap_structdescr=&amp;gt;create( comp_tab ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;zz_tabletype = cl_abap_tabledescr=&amp;gt;create(&lt;/P&gt;&lt;P&gt;   p_line_type  = new_linetype.&lt;/P&gt;&lt;P&gt;   p_table_kind = cl_abap_tablesdescr=&amp;gt;tablekind_sorted&lt;/P&gt;&lt;P&gt;   p_key        = tab_key)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;John.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2004 11:14:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-descriptor-classes-for-dynamic-local-declarations/m-p/773291#M38560</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2004-10-21T11:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Descriptor Classes for Dynamic Local Declarations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-descriptor-classes-for-dynamic-local-declarations/m-p/773292#M38561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Serdar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know the addition CASTING LIKE, but that could do the job. However I'm currently with a customer on a prehistorical SAP release (4.6C....), so I can't test this at the moment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;John.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2004 11:29:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-descriptor-classes-for-dynamic-local-declarations/m-p/773292#M38561</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2004-10-21T11:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Descriptor Classes for Dynamic Local Declarations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-descriptor-classes-for-dynamic-local-declarations/m-p/773293#M38562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;Thanks for your input...At present I am in WAS 6.2 ..and dont find the creet and other methods you have mentioned...I think they all exist for WAS 6.4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls correct if I am wrong..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Arunava&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2004 11:47:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-descriptor-classes-for-dynamic-local-declarations/m-p/773293#M38562</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2004-10-21T11:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Descriptor Classes for Dynamic Local Declarations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-descriptor-classes-for-dynamic-local-declarations/m-p/773294#M38563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arunava,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm sorry, the functionality is available as of 6.4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;John.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2004 13:49:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-descriptor-classes-for-dynamic-local-declarations/m-p/773294#M38563</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2004-10-21T13:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Descriptor Classes for Dynamic Local Declarations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-descriptor-classes-for-dynamic-local-declarations/m-p/773295#M38564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For 620 type creation is only possible by creating a subroutine-pool/program with the intended type. The number of subroutine-pool is limited ( 7 ? ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since the Cl_Alv_Table_Create Class is based on the technique I assume this is the limitation you mention in your first post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This limitation applies to the internal mode. Maybe you can use a submit or RFC call to act on this types. This would soften up this limitation to one execution of your logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need more types within one execution doing the subroutine-generation manually with several types might help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Klaus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2004 13:58:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-descriptor-classes-for-dynamic-local-declarations/m-p/773295#M38564</guid>
      <dc:creator>former_member183804</dc:creator>
      <dc:date>2004-10-21T13:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Descriptor Classes for Dynamic Local Declarations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-descriptor-classes-for-dynamic-local-declarations/m-p/773296#M38565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arunava&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure that I have exactly understand your requirement but will this information help? I guess it will be OK in case you have definite structure name in the ABAP dictionary or in the program. Otherwise, if you are talking about creating a table type where you never guess before runtime I think previos post will be closer to you solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*-- Generic variable
DATA gr_xxx TYPE REF TO DATA .
*-- Variable to hold name of the structure for casting
DATA gv_str_name(30) TYPE c .
*-- Variable to hold each component name of the structure
DATA gv_comp_name(30) TYPE c .
*-- Field symbol to get reference of the structure
FIELD-SYMBOLS: &amp;lt;fs&amp;gt; TYPE ANY .
*-- Field symbol to get reference of the component
FIELD-SYMBOLS: &amp;lt;comp&amp;gt; TYPE ANY .

*--Creating variable
CREATE DATA gr_xxx LIKE (gv_str_name) .
*--or CREATE DATA gr_xxx TYPE (gv_str_name) .

ASSIGN gr_xxx-&amp;gt;* TO &amp;lt;fs&amp;gt; CASTING LIKE (gv_str_name) .
*--or ASSIGN gr_xxx-&amp;gt;* TO &amp;lt;fs&amp;gt; CASTING LIKE (gv_str_name) .

.. ..

*--To reach each component
ASSIGN COMPONENT (gv_compname) OF STRUCTURE &amp;lt;fs&amp;gt; TO &amp;lt;comp&amp;gt; .
.. ..
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Serdar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2004 20:02:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-descriptor-classes-for-dynamic-local-declarations/m-p/773296#M38565</guid>
      <dc:creator>ssimsekler</dc:creator>
      <dc:date>2004-10-21T20:02:37Z</dc:date>
    </item>
  </channel>
</rss>

