<?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 Dynamic programming using cl_abap_typedescr in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programming-using-cl-abap-typedescr/m-p/963305#M67938</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have created a field catalog for an ALV grid dynamically using cl_alv_table_create=&amp;gt;create_dynamic_table (I am on 46B and cannot use the new version).  How do I create the structure and therefore internal table to pass into the it_outtab parameter of the ALV grid set_table_for_first_display&lt;/P&gt;&lt;P&gt;method?  I can create a blank table with the correct dynamic columns but now wish to populate it without much success!  I am retrieving the type using cl_abap_typedescr=&amp;gt;describe_by_data and can cycle through the key but how do I just obtain the structure?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Ian&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cl_abap_typedescr to retrieve the column names of a dynamic table I have created for using with an ALV grid&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Sep 2005 09:35:34 GMT</pubDate>
    <dc:creator>IanStubbings</dc:creator>
    <dc:date>2005-09-02T09:35:34Z</dc:date>
    <item>
      <title>Dynamic programming using cl_abap_typedescr</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programming-using-cl-abap-typedescr/m-p/963305#M67938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have created a field catalog for an ALV grid dynamically using cl_alv_table_create=&amp;gt;create_dynamic_table (I am on 46B and cannot use the new version).  How do I create the structure and therefore internal table to pass into the it_outtab parameter of the ALV grid set_table_for_first_display&lt;/P&gt;&lt;P&gt;method?  I can create a blank table with the correct dynamic columns but now wish to populate it without much success!  I am retrieving the type using cl_abap_typedescr=&amp;gt;describe_by_data and can cycle through the key but how do I just obtain the structure?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Ian&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cl_abap_typedescr to retrieve the column names of a dynamic table I have created for using with an ALV grid&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Sep 2005 09:35:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programming-using-cl-abap-typedescr/m-p/963305#M67938</guid>
      <dc:creator>IanStubbings</dc:creator>
      <dc:date>2005-09-02T09:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic programming using cl_abap_typedescr</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programming-using-cl-abap-typedescr/m-p/963306#M67939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Use ASSIGN r_dyn_table-&amp;gt;* TO &amp;lt;t_dyn_table&amp;gt; to get access to the dynamic table. To append rows to it, you should use ASSIGN COMPONENT idx/name OF STRUCTURE struc TO &amp;lt;fs&amp;gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;    data: tab_fields like table of wa_fields,&lt;/P&gt;&lt;P&gt;         r_dyn_table  TYPE REF TO data,&lt;/P&gt;&lt;P&gt;         r_wa_dyn_table   TYPE REF TO data,&lt;/P&gt;&lt;P&gt;         f_int type i.&lt;/P&gt;&lt;P&gt;&lt;/P&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           = F_TAB_FCAT&lt;/P&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;P&gt;        ep_table                  = r_dyn_table&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        generate_subpool_dir_full = 1&lt;/P&gt;&lt;P&gt;        OTHERS                    = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      ASSIGN r_dyn_table-&amp;gt;* TO &amp;lt;t_dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt;      CREATE DATA r_wa_dyn_table LIKE LINE OF &amp;lt;t_dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt;      ASSIGN r_wa_dyn_table-&amp;gt;* TO &amp;lt;wa_dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt;      DESCRIBE TABLE tab_fields lines f_int.&lt;/P&gt;&lt;P&gt;      do f_int times.&lt;/P&gt;&lt;P&gt;        READ TABLE tab_fields INDEX sy-index into wa_fields.&lt;/P&gt;&lt;P&gt;        ASSIGN wa_fields-field TO &amp;lt;w_field1&amp;gt;.&lt;/P&gt;&lt;P&gt;        check1 = sy-subrc.&lt;/P&gt;&lt;P&gt;        ASSIGN COMPONENT sy-index&lt;/P&gt;&lt;P&gt;               OF STRUCTURE &amp;lt;wa_dyn_table&amp;gt; TO &amp;lt;w_field2&amp;gt;.&lt;/P&gt;&lt;P&gt;        check2 = sy-subrc.&lt;/P&gt;&lt;P&gt;        if check1 = 0 and check2 = 0.&lt;/P&gt;&lt;P&gt;          &amp;lt;w_field2&amp;gt; = &amp;lt;w_field1&amp;gt;.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;      enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Svetlin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Sep 2005 09:52:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programming-using-cl-abap-typedescr/m-p/963306#M67939</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-09-02T09:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic programming using cl_abap_typedescr</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programming-using-cl-abap-typedescr/m-p/963307#M67940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Svetlin, I had got down to the Assign component on my own but that gave me the final nudge.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Ian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Sep 2005 10:20:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programming-using-cl-abap-typedescr/m-p/963307#M67940</guid>
      <dc:creator>IanStubbings</dc:creator>
      <dc:date>2005-09-02T10:20:17Z</dc:date>
    </item>
  </channel>
</rss>

