<?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: creating dynamic sorted internal table. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-sorted-internal-table/m-p/5866877#M1322602</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Veerendranath Pichikala,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you have to use method CREATE of class CL_ABAP_TABLEDESCR. Here you can define the type of the table via parameter P_TABLE_KIND (e.g.TABLEKIND_SORTED for sorted table).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As an example you can have a look at the following snippet from the article &lt;A href="http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/b332e090-0201-0010-bdbd-b735e96fe0ae"&gt;Advanced and Generic Programming in ABAP&lt;/A&gt; by Björn Mielenhausen and Gerd Kluger.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: lineType  TYPE REF TO cl_abap_structdescr,
      tableType TYPE REF TO cl_abap_tabledescr,
      key       TYPE abap_keydescr_tab.
      
lineType ?= cl_abap_typedescr=&amp;gt;describe_by_name( 'SPFLI' ).

APPEND 'CARRID' TO key. 
APPEND 'CONNID' TO key.

tableType = cl_abap_tabledescr=&amp;gt;create(
              p_line_type  = lineType
              p_table_kind = cl_abap_tabledescr=&amp;gt;tablekind_sorted
              p_unique     = abap_true
              p_key        = key ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alej&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Jul 2009 11:36:02 GMT</pubDate>
    <dc:creator>alejiandro_sensejl</dc:creator>
    <dc:date>2009-07-20T11:36:02Z</dc:date>
    <item>
      <title>creating dynamic sorted internal table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-sorted-internal-table/m-p/5866876#M1322601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;lt;l_table1&amp;gt; is defined as an sorted table and new_table from method create_dynamic_table is coming as standard table.&lt;/P&gt;&lt;P&gt;when we write a statement "ASSIGN new_table1-&amp;gt;* TO &amp;lt;l_table1&amp;gt;." Its giving runtime error type conflict.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please let me know how to create sorted internal table by using method create_dynamic_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 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_fieldcat1&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;ep_table = new_table1.&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_table1-&amp;gt;* TO &amp;lt;l_table1&amp;gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jul 2009 10:14:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-sorted-internal-table/m-p/5866876#M1322601</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-20T10:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: creating dynamic sorted internal table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-sorted-internal-table/m-p/5866877#M1322602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Veerendranath Pichikala,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you have to use method CREATE of class CL_ABAP_TABLEDESCR. Here you can define the type of the table via parameter P_TABLE_KIND (e.g.TABLEKIND_SORTED for sorted table).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As an example you can have a look at the following snippet from the article &lt;A href="http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/b332e090-0201-0010-bdbd-b735e96fe0ae"&gt;Advanced and Generic Programming in ABAP&lt;/A&gt; by Björn Mielenhausen and Gerd Kluger.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: lineType  TYPE REF TO cl_abap_structdescr,
      tableType TYPE REF TO cl_abap_tabledescr,
      key       TYPE abap_keydescr_tab.
      
lineType ?= cl_abap_typedescr=&amp;gt;describe_by_name( 'SPFLI' ).

APPEND 'CARRID' TO key. 
APPEND 'CONNID' TO key.

tableType = cl_abap_tabledescr=&amp;gt;create(
              p_line_type  = lineType
              p_table_kind = cl_abap_tabledescr=&amp;gt;tablekind_sorted
              p_unique     = abap_true
              p_key        = key ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alej&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jul 2009 11:36:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-sorted-internal-table/m-p/5866877#M1322602</guid>
      <dc:creator>alejiandro_sensejl</dc:creator>
      <dc:date>2009-07-20T11:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: creating dynamic sorted internal table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-sorted-internal-table/m-p/5866878#M1322603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the following (It's working and in 4.6 Version). The code is part of a Rich Heilman's Blog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field-symbols: &amp;lt;dyn_table&amp;gt; type standard table,&lt;/P&gt;&lt;P&gt;                     &amp;lt;dyn_wa&amp;gt;,&lt;/P&gt;&lt;P&gt;                     &amp;lt;dyn_field&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: dy_table type ref to data,&lt;/P&gt;&lt;P&gt;         dy_line  type ref to data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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 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 = (fieldcatalog)&lt;/P&gt;&lt;P&gt;               importing&lt;/P&gt;&lt;P&gt;                  ep_table        = dy_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  assign dy_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 dy_line like line of &amp;lt;dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt;  assign dy_line-&amp;gt;* to &amp;lt;dyn_wa&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With regards&lt;/P&gt;&lt;P&gt;George&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 18:40:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-sorted-internal-table/m-p/5866878#M1322603</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T18:40:08Z</dc:date>
    </item>
  </channel>
</rss>

