<?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: RTTS in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/rtts/m-p/4102787#M981093</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi check this..&lt;/P&gt;&lt;P&gt; RTTS (Run Time Type Services)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of building the fieldcatalog using the function module NAMETAB_GET and creating the dynamic table using cl_alv_table_create, you can use the following approach using the RTTS (Run Time Type Services):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;dref TYPE REF TO data,&lt;/P&gt;&lt;P&gt;gr_table TYPE REF TO cl_salv_table,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tab_name TYPE ddobjname VALUE 'SPFLI',&lt;/P&gt;&lt;P&gt;linetype TYPE REF TO cl_abap_structdescr,&lt;/P&gt;&lt;P&gt;tabletype TYPE REF TO cl_abap_tabledescr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS:&lt;/P&gt;&lt;P&gt;&amp;lt;newtab&amp;gt; TYPE STANDARD TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;linetype ?= cl_abap_typedescr=&amp;gt;describe_by_name( tab_name ).&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;CREATE DATA dref TYPE HANDLE tabletype.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ASSIGN dref-&amp;gt;* TO &amp;lt;newtab&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM spfli INTO TABLE &amp;lt;newtab&amp;gt;&lt;/P&gt;&lt;P&gt;UP TO 25 ROWS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*... Create Instance&lt;/P&gt;&lt;P&gt;TRY.&lt;/P&gt;&lt;P&gt;CALL METHOD cl_salv_table=&amp;gt;factory&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;r_salv_table = gr_table&lt;/P&gt;&lt;P&gt;CHANGING&lt;/P&gt;&lt;P&gt;t_table = &amp;lt;newtab&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CATCH cx_salv_msg.&lt;/P&gt;&lt;P&gt;ENDTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Display table&lt;/P&gt;&lt;P&gt;gr_table-&amp;gt;display( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here in the above code, you can also specify your own internal type (defined in your report) with fields of ABAP dictionary type like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES:&lt;/P&gt;&lt;P&gt;BEGIN OF my_own_type,&lt;/P&gt;&lt;P&gt;sample_field_1 TYPE spfli-carrid,&lt;/P&gt;&lt;P&gt;sample_field_2 TYPE spfli-connid,&lt;/P&gt;&lt;P&gt;END OF my_own_type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;linetype ?= cl_abap_typedescr=&amp;gt;describe_by_name( 'MY_OWN_TYPE' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The cl_salv_table=&amp;gt;factory method will automatically pickup the field descriptions from the ABAP Dictionary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course, you can also define your headings using the other methods of the SALV classes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;More information about the RTTS can be found in the class documentations. These are really useful when you have to create dynamic tables using your own types defined in your report.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 28 Jun 2008 09:57:16 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-28T09:57:16Z</dc:date>
    <item>
      <title>RTTS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rtts/m-p/4102785#M981091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is RTTS and RTTI?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jun 2008 09:49:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rtts/m-p/4102785#M981091</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-28T09:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: RTTS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rtts/m-p/4102786#M981092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Abhijeet,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;these are new design tool for ABAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just refer for more info:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/50456d27-0a01-0010-ed95-ba71d8f0d74b" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/50456d27-0a01-0010-ed95-ba71d8f0d74b&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Amit.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jun 2008 09:57:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rtts/m-p/4102786#M981092</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-28T09:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: RTTS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rtts/m-p/4102787#M981093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi check this..&lt;/P&gt;&lt;P&gt; RTTS (Run Time Type Services)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of building the fieldcatalog using the function module NAMETAB_GET and creating the dynamic table using cl_alv_table_create, you can use the following approach using the RTTS (Run Time Type Services):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;dref TYPE REF TO data,&lt;/P&gt;&lt;P&gt;gr_table TYPE REF TO cl_salv_table,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tab_name TYPE ddobjname VALUE 'SPFLI',&lt;/P&gt;&lt;P&gt;linetype TYPE REF TO cl_abap_structdescr,&lt;/P&gt;&lt;P&gt;tabletype TYPE REF TO cl_abap_tabledescr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS:&lt;/P&gt;&lt;P&gt;&amp;lt;newtab&amp;gt; TYPE STANDARD TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;linetype ?= cl_abap_typedescr=&amp;gt;describe_by_name( tab_name ).&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;CREATE DATA dref TYPE HANDLE tabletype.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ASSIGN dref-&amp;gt;* TO &amp;lt;newtab&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM spfli INTO TABLE &amp;lt;newtab&amp;gt;&lt;/P&gt;&lt;P&gt;UP TO 25 ROWS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*... Create Instance&lt;/P&gt;&lt;P&gt;TRY.&lt;/P&gt;&lt;P&gt;CALL METHOD cl_salv_table=&amp;gt;factory&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;r_salv_table = gr_table&lt;/P&gt;&lt;P&gt;CHANGING&lt;/P&gt;&lt;P&gt;t_table = &amp;lt;newtab&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CATCH cx_salv_msg.&lt;/P&gt;&lt;P&gt;ENDTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Display table&lt;/P&gt;&lt;P&gt;gr_table-&amp;gt;display( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here in the above code, you can also specify your own internal type (defined in your report) with fields of ABAP dictionary type like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES:&lt;/P&gt;&lt;P&gt;BEGIN OF my_own_type,&lt;/P&gt;&lt;P&gt;sample_field_1 TYPE spfli-carrid,&lt;/P&gt;&lt;P&gt;sample_field_2 TYPE spfli-connid,&lt;/P&gt;&lt;P&gt;END OF my_own_type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;linetype ?= cl_abap_typedescr=&amp;gt;describe_by_name( 'MY_OWN_TYPE' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The cl_salv_table=&amp;gt;factory method will automatically pickup the field descriptions from the ABAP Dictionary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course, you can also define your headings using the other methods of the SALV classes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;More information about the RTTS can be found in the class documentations. These are really useful when you have to create dynamic tables using your own types defined in your report.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jun 2008 09:57:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rtts/m-p/4102787#M981093</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-28T09:57:16Z</dc:date>
    </item>
  </channel>
</rss>

