<?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 and Internal table error in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-and-internal-table-error/m-p/5074962#M1178852</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;Refer to this link...&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="2879993"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 24 Jan 2009 05:01:59 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-01-24T05:01:59Z</dc:date>
    <item>
      <title>Dynamic structure and Internal table error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-and-internal-table-error/m-p/5074961#M1178851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a  requirement of creating a runtime ( dynamic ) strcuture and as well as the Internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Requirement: Need to create a strucutre and internal table at runtime.&lt;/P&gt;&lt;P&gt;Note: I should not use any underlying DB or structure type to create the RT structure or internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Ex: My strcture should have two columns of type string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error information: Exception condition "TYPE_NOT_FOUND" raised&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code written by me as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA lv_status TYPE string.&lt;/P&gt;&lt;P&gt;  DATA: columntype TYPE REF TO cl_abap_structdescr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: linetype TYPE REF TO cl_abap_structdescr,&lt;/P&gt;&lt;P&gt;        comp_tab TYPE cl_abap_structdescr=&amp;gt;component_table,&lt;/P&gt;&lt;P&gt;        comp LIKE LINE OF comp_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;  columntype ?= cl_abap_typedescr=&amp;gt;describe_by_name( lv_status ).  " Error is here.&lt;/P&gt;&lt;P&gt;  comp-name = 'COLUMN1'.&lt;/P&gt;&lt;P&gt;  comp-type = columntype.&lt;/P&gt;&lt;P&gt;  APPEND comp TO comp_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  comp-name = 'COLUMN2'.&lt;/P&gt;&lt;P&gt;  comp-type = columntype.&lt;/P&gt;&lt;P&gt;  APPEND comp TO comp_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  linetype = cl_abap_structdescr=&amp;gt;create( comp_tab ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt; dynamic internal table:&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: tabletype TYPE REF TO cl_abap_tabledescr,&lt;/P&gt;&lt;P&gt;        key TYPE abap_keydescr_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  tabletype = cl_abap_tabledescr=&amp;gt;create(&lt;/P&gt;&lt;P&gt;  p_line_type = linetype&lt;/P&gt;&lt;P&gt;  p_table_kind = cl_abap_tabledescr=&amp;gt;tablekind_std ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***********************************************************************&lt;/P&gt;&lt;P&gt;  FIELD-SYMBOLS : &amp;lt;f_itab&amp;gt; TYPE STANDARD TABLE, " Table type&lt;/P&gt;&lt;P&gt;                  &amp;lt;f_wa&amp;gt; TYPE ANY, " WA type&lt;/P&gt;&lt;P&gt;                  &amp;lt;fs&amp;gt; TYPE ANY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: l_handle TYPE REF TO data.&lt;/P&gt;&lt;P&gt;  DATA: l_handle_wa TYPE REF TO data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  TRY.&lt;/P&gt;&lt;P&gt;      CREATE DATA l_handle TYPE HANDLE tabletype.&lt;/P&gt;&lt;P&gt;    CATCH cx_sy_create_data_error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDTRY.&lt;/P&gt;&lt;P&gt;  ASSIGN l_handle-&amp;gt;* TO &amp;lt;f_itab&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  TRY.&lt;/P&gt;&lt;P&gt;      CREATE DATA l_handle_wa TYPE HANDLE linetype.&lt;/P&gt;&lt;P&gt;    CATCH cx_sy_create_data_error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDTRY.&lt;/P&gt;&lt;P&gt;  ASSIGN l_handle_wa-&amp;gt;* TO &amp;lt;f_wa&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One more question is will this code work in WD4A? I am trying to write this in WDDOINIT method of the view.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shashikanth. D&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Jan 2009 04:54:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-and-internal-table-error/m-p/5074961#M1178851</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-24T04:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic structure and Internal table error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-and-internal-table-error/m-p/5074962#M1178852</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;Refer to this link...&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="2879993"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Jan 2009 05:01:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-and-internal-table-error/m-p/5074962#M1178852</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-24T05:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic structure and Internal table error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-and-internal-table-error/m-p/5074963#M1178853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Avinash,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your prompt reply.&lt;/P&gt;&lt;P&gt;I am little bit confused as I am unable to get the appropriate information to my question.&lt;/P&gt;&lt;P&gt;Can you please give the information about the error which i am getting rather some links.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All the links talks about the ALV and its field catalog which does not suit the requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Awaiting your precious reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shashikanth. D&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Jan 2009 05:16:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-and-internal-table-error/m-p/5074963#M1178853</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-24T05:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic structure and Internal table error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-and-internal-table-error/m-p/5074964#M1178854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In your case, you must use :&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;columntype ?= cl_abap_typedescr=&amp;gt;describe_by_DATA( lv_status ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;instead of DESCRIBE_BY_NAME (because this last takes the type contained in variable lv_status, but it's space here).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may also use:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;comp-type ?= cl_abap_elemdescr=&amp;gt;get_string( ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Jan 2009 22:48:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-and-internal-table-error/m-p/5074964#M1178854</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2009-01-25T22:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic structure and Internal table error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-and-internal-table-error/m-p/5074965#M1178855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may have a look at my Wiki posting&lt;/P&gt;&lt;P&gt;[Creating Flat and Complex Internal Tables Dynamically using RTTI |https://wiki.sdn.sap.com/wiki/display/Snippets/Creating&lt;EM&gt;Flat&lt;/EM&gt;and&lt;EM&gt;Complex&lt;/EM&gt;Internal&lt;EM&gt;Tables&lt;/EM&gt;Dynamically&lt;EM&gt;using&lt;/EM&gt;RTTI]&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;   Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2009 04:59:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-and-internal-table-error/m-p/5074965#M1178855</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2009-01-26T04:59:49Z</dc:date>
    </item>
  </channel>
</rss>

