<?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 dynamic DB table reference, how? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/rtts-dynamic-db-table-reference-how/m-p/972585#M70024</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your answer which solved my problem.  I awarded you points.  Have a good week.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bruce&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Jul 2005 18:26:00 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-07-25T18:26:00Z</dc:date>
    <item>
      <title>RTTS dynamic DB table reference, how?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rtts-dynamic-db-table-reference-how/m-p/972580#M70019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a very simple program that will capture and write a list of the fields and their definitions of a database table that I have explicitly assigned to a variable using the type statement.  I have been playing with this code and attempting to dynamically associate a database table structure with a variable, and then using that variable to assign it's structure to a &amp;lt;FS&amp;gt;.  Everything that I tried generated a syntax error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could somebody please tell me what syntax I need to dynamically associate a database structure with a variable, versus statically?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: dr_dref       type ref to data,&lt;/P&gt;&lt;P&gt;      rf_descr_ref  type ref to cl_abap_typedescr .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: &amp;lt;b&amp;gt;wa_vbap type vbak&amp;lt;/b&amp;gt;.          " DB table reference&lt;/P&gt;&lt;P&gt;field-symbols: &amp;lt;fs&amp;gt; type any.&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;  do.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Assign every field of this structure to the untyped  field symbol.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    assign component sy-index of structure &amp;lt;b&amp;gt;WA_vbap&amp;lt;/b&amp;gt; to &amp;lt;fs&amp;gt;.  &lt;/P&gt;&lt;P&gt;    if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;      exit.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    call method cl_abap_typedescr=&amp;gt;describe_by_data&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        p_data      = &amp;lt;fs&amp;gt;&lt;/P&gt;&lt;P&gt;      RECEIVING&lt;/P&gt;&lt;P&gt;        p_descr_ref = rf_descr_ref.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    write: / sy-index, rf_descr_ref-&amp;gt;type_kind,&lt;/P&gt;&lt;P&gt;             rf_descr_ref-&amp;gt;length, &lt;/P&gt;&lt;P&gt;             rf_descr_ref-&amp;gt;absolute_name+6.&lt;/P&gt;&lt;P&gt;  enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Bruce&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jul 2005 19:57:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rtts-dynamic-db-table-reference-how/m-p/972580#M70019</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-22T19:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: RTTS dynamic DB table reference, how?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rtts-dynamic-db-table-reference-how/m-p/972581#M70020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;here is the code sample. I guess this is what you wanted. right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  YRTTS.
type-pools : abap.
data: wa_vbak type vbak .
data : it_details type abap_compdescr_tab,
wa_comp type abap_compdescr.

data : ref_descr type ref to cl_abap_structdescr.

ref_descr ?= cl_abap_typedescr=&amp;gt;describe_by_data( wa_vbak ).
it_details[] = ref_descr-&amp;gt;components[].

break-point .&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Jul 2005 06:31:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rtts-dynamic-db-table-reference-how/m-p/972581#M70020</guid>
      <dc:creator>athavanraja</dc:creator>
      <dc:date>2005-07-24T06:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: RTTS dynamic DB table reference, how?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rtts-dynamic-db-table-reference-how/m-p/972582#M70021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Durairaj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your code is still explicitly associating a database tablename with a variable.  Your code populates an internal table with the database table fields and attributes, just the way I wanted.  But, I want to be able to associate the database table name at runtime rather than hard coding it in the program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What do I need to change in your code to dynamically associate a database table name?  Everything I tried previously failed the syntax check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: wa_vbak type vbak .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Bruce&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2005 15:35:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rtts-dynamic-db-table-reference-how/m-p/972582#M70021</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-25T15:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: RTTS dynamic DB table reference, how?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rtts-dynamic-db-table-reference-how/m-p/972583#M70022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Run this program,  enter the structure name that you want the components of and hit execute.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0003.


type-pools : abap.


data : it_details type abap_compdescr_tab,
       wa_comp type abap_compdescr.

parameters: p_type(10) type c.

data : ref_descr type ref to cl_abap_structdescr.

ref_descr ?= cl_abap_typedescr=&amp;gt;describe_by_name( p_type ).
it_details[] = ref_descr-&amp;gt;components[].

break-point .

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2005 16:42:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rtts-dynamic-db-table-reference-how/m-p/972583#M70022</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-07-25T16:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: RTTS dynamic DB table reference, how?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rtts-dynamic-db-table-reference-how/m-p/972584#M70023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2005 18:01:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rtts-dynamic-db-table-reference-how/m-p/972584#M70023</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-07-25T18:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: RTTS dynamic DB table reference, how?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rtts-dynamic-db-table-reference-how/m-p/972585#M70024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your answer which solved my problem.  I awarded you points.  Have a good week.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bruce&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2005 18:26:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rtts-dynamic-db-table-reference-how/m-p/972585#M70024</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-25T18:26:00Z</dc:date>
    </item>
  </channel>
</rss>

