<?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: Object table confusion in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/object-table-confusion/m-p/3515549#M845549</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Even better would be a vector type table, that can store and retrieve any &lt;/P&gt;&lt;P&gt;object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone has the code for that? Should be long, maybe even write a nice class around it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Dylan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Feb 2008 14:56:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-02-28T14:56:21Z</dc:date>
    <item>
      <title>Object table confusion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/object-table-confusion/m-p/3515548#M845548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to store a number of ZCL_BDC_FIELD objects into an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the easiest eay to do this? Here's my attempt...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Types: begin of ty_field_itab,&lt;/P&gt;&lt;P&gt;  fld type ref to ZCL_BDC_FIELD,&lt;/P&gt;&lt;P&gt;end of ty_field_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;in the private section of another class&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; data: field_itab type table of ty_field_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*still in other class, &lt;/P&gt;&lt;P&gt;append &lt;U&gt;field to field&lt;/U&gt;itab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which gives an error! Cannot convert &lt;U&gt;field to field of type field&lt;/U&gt;itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Think I have to use create data? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Dylan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2008 14:29:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/object-table-confusion/m-p/3515548#M845548</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-28T14:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: Object table confusion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/object-table-confusion/m-p/3515549#M845549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Even better would be a vector type table, that can store and retrieve any &lt;/P&gt;&lt;P&gt;object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone has the code for that? Should be long, maybe even write a nice class around it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Dylan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2008 14:56:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/object-table-confusion/m-p/3515549#M845549</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-28T14:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: Object table confusion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/object-table-confusion/m-p/3515550#M845550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try to use  around your code... (take out the spaces after and before the bracket though! )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming the type in your first class is public.  I'll call your first class CL1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Types: begin of ty_field_itab,
         fld type ref to ZCL_BDC_FIELD,
        end of ty_field_itab.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;in the private section of another class &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: field_itab type table of CL1=&amp;gt;ty_field_itab,
      _field like line of field_itab.
...
* _field gets filled...

*still in other class, 
append _field to field_itab. &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Re, your idea of a vector table... yes you can do it.  Like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN OF ty_vector_entry,
       hdr TYPE ...some kind of header structure...
       ref TYPE REF TO DATA,
       END OF ty_vector,
     ty_vector TYPE STANDARD/SORTED/HASHED TABLE OF ty_vector_entry ... key defn.

DATA: l_entry TYPE ty_vector_entry,
      lt_vector TYPE ty_vector.
...
my_obj1 TYPE REF TO CL1,
* populate the l_entry-hdr appropriately
GET REFERENCE OF my_obj1 into l_entry-ref.
INSERT l_entry INTO TABLE lt_vector.

my_obj2 TYPE REF TO CL2,
* populate the l_entry-hdr appropriately
GET REFERENCE OF my_obj2 into l_entry-ref.
INSERT l_entry INTO TABLE lt_vector.

my_data TYPE string,
* populate the l_entry-hdr appropriately
GET REFERENCE OF my_data into l_entry-ref.
INSERT l_entry INTO TABLE lt_vector.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2008 15:29:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/object-table-confusion/m-p/3515550#M845550</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2008-02-28T15:29:52Z</dc:date>
    </item>
  </channel>
</rss>

