<?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: Class method returning any table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-returning-any-table/m-p/10333765#M1836647</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="short_text" lang="en"&gt;&lt;SPAN class="hps"&gt;Thank you for your&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;willingness to help but isuue of tables is already resolved (above).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 06 Jul 2014 14:51:24 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2014-07-06T14:51:24Z</dc:date>
    <item>
      <title>Class method returning any table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-returning-any-table/m-p/10333750#M1836632</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;Is there a way in ABAP to solve below problem?&lt;/P&gt;&lt;P&gt;I have a class CL with method METH which inside of itself CREATES an internal table.&lt;/P&gt;&lt;P&gt;Table structure and its data depends of various factors and its structure is always unexpected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Class definition:&lt;/P&gt;&lt;P&gt;* ...&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;methods&lt;SPAN class="L0S55"&gt;:&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; METH&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;importing&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; iv_filepath &lt;SPAN class="L0S52"&gt;type &lt;/SPAN&gt;string&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;changing et&lt;/SPAN&gt;_table &lt;SPAN class="L0S52"&gt;type &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;ref &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;to &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;data&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;Class implementation:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;method METH.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;* ... &lt;/SPAN&gt;&lt;/SPAN&gt;internal table itab already has a structure and data based on user choose&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; field-symbols&lt;SPAN class="L0S55"&gt;: &lt;/SPAN&gt;&amp;lt;fsym&amp;gt; &lt;SPAN class="L0S52"&gt;type &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;any&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;assign &lt;/SPAN&gt;itab &lt;SPAN class="L0S52"&gt;to &lt;/SPAN&gt;&amp;lt;fsym&amp;gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S52"&gt;et&lt;/SPAN&gt;_table&lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt; &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;&amp;lt;fsym&amp;gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;endmethod.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to call METH and get this table, eg.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;program ZPROG.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;data fname &lt;SPAN class="L0S52"&gt;type &lt;/SPAN&gt;string&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="L0S52"&gt;field-symbols&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;: &lt;/SPAN&gt;&amp;lt;fs_tab&amp;gt; &lt;SPAN class="L0S52"&gt;type any &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;table&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;CL=&amp;gt;METH( importing et_table = &amp;lt;fs_tab&amp;gt; )&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&amp;lt;fs_tab&amp;gt; = CL=&amp;gt;METH(&amp;nbsp; ).&lt;/P&gt;&lt;P&gt;or so on.&lt;/P&gt;&lt;P&gt;But &amp;lt;fs_tab&amp;gt; is not assigned (and I get error) but I cannot assign &amp;lt;fs&amp;gt; not knowing table structure first (like I wrote above, structure is not known at design-time).&lt;/P&gt;&lt;P&gt;I'm very new in ABAP. Usually I'm coding in C#, which easly allows to return, assign to variable and iterate on rows and columns of any table in memory.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 May 2014 21:29:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-returning-any-table/m-p/10333750#M1836632</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-05-24T21:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: Class method returning any table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-returning-any-table/m-p/10333751#M1836633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your method returns a data object, so inside you should have a statement like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;EM&gt;get reference of itab into et_table&lt;/EM&gt;, instead of ASSIGN...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Outside you should dereference your data object:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data: lo_tab type ref to data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lo_tab = cl=&amp;gt;meth( ).&amp;nbsp;&amp;nbsp; "with a RETURNING parameter instead of CHANGING&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; assign lo_tab-&amp;gt;* to &amp;lt;fs_tab&amp;gt;.&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;br,&lt;/P&gt;&lt;P&gt;Manu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 May 2014 22:02:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-returning-any-table/m-p/10333751#M1836633</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-05-24T22:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: Class method returning any table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-returning-any-table/m-p/10333752#M1836634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Very thanks. It works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunatelly I cannot assign:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field-symbols:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;fs&amp;gt; type standard table,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;wa&amp;gt; type any,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;fld&amp;gt; type any.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: lo_tab type ref to data.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lo_tab = cl=&amp;gt;meth( ).&amp;nbsp;&amp;nbsp; "with a RETURNING parameter instead of CHANGING&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; assign lo_tab-&amp;gt;* to &amp;lt;fs_tab&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; loop at &amp;lt;fs_tab&amp;gt; assigning &amp;lt;wa&amp;gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; assign component 'COLNAME' of structure &amp;lt;wa&amp;gt; to &amp;lt;fld&amp;gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; write:/ &amp;lt;fld&amp;gt;.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error is in line with '&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;' where I try to assign &amp;lt;wa&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Short text:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field symbol has not yet been assigned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS &lt;SPAN class="short_text" lang="en"&gt;&lt;SPAN class="hps"&gt;Please&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;be patient&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;for a beginner.&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 May 2014 22:44:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-returning-any-table/m-p/10333752#M1836634</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-05-24T22:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: Class method returning any table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-returning-any-table/m-p/10333753#M1836635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt; lo_tab = cl=&amp;gt;meth( ).&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&amp;nbsp;&amp;nbsp; assign lo_tab-&amp;gt;* to &amp;lt;fs_tab&amp;gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;IF sy-subrc IS NOT INITIAL:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt; write: / 'Something when wrong in CL=&amp;gt;METH() - no reference returned". &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt; exit.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;ENDIF.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;This is not the complete answer, but rather to guide you to where the error lies. HINT: read the ABAP Help on GET REFERENCE&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 May 2014 04:22:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-returning-any-table/m-p/10333753#M1836635</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2014-05-25T04:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: Class method returning any table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-returning-any-table/m-p/10333754#M1836636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I know that assigning is dead. I'm worrying about GET REFERENCE Help text:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"You must specify the data type of the object using the TYPE or LIKE addition."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem is (like I wrote in my first post in thread) the structure (type) reveals itself inside method and it is not known before method call.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 May 2014 21:00:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-returning-any-table/m-p/10333754#M1836636</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-05-25T21:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: Class method returning any table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-returning-any-table/m-p/10333755#M1836637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For a start your field symbol should not be type ANY, but ANY TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would be helpful if you would post your latest code attempt. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 May 2014 06:18:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-returning-any-table/m-p/10333755#M1836637</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2014-05-26T06:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: Class method returning any table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-returning-any-table/m-p/10333756#M1836638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I changed:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;fs&amp;gt; type standard table&lt;/P&gt;&lt;P&gt;to&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;fs&amp;gt; type any table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nothing changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To be sure I removed temporarily unused &amp;lt;wa&amp;gt; and &amp;lt;fld&amp;gt; (for the eventuality of some unplanned interaction) - of course nothing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result always is the same - dead assigning.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe this will matter: in method declaration i have return like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; returning value(et_table) type ref to data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and at the and of implementation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get reference of itab into et_table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 May 2014 18:08:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-returning-any-table/m-p/10333756#M1836638</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-05-26T18:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: Class method returning any table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-returning-any-table/m-p/10333757#M1836639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I discovered (using debugger) that reference which is returned to method call is 'FREED STACK".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the method the reference is Ok.&lt;/P&gt;&lt;P&gt;In my mind it marks that ABAP destroys memory before program get it back!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 May 2014 18:59:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-returning-any-table/m-p/10333757#M1836639</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-05-26T18:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: Class method returning any table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-returning-any-table/m-p/10333758#M1836640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, I found it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Class method that returns a reference needs to declare referenced variable (table in this case) in class-data (or data) of public section. I returned other simple table. Problem is that I need to return reference to other, more complex table, which I build in method body (implementation). Unfortunatelly ABAP significantly complicates programmers life. It would seem that they are a simple things but you need to do horrible stunts to reach them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks all for hints! (buttons for &lt;SPAN class="short_text" lang="en"&gt;&lt;SPAN class="hps"&gt;praise stopped showing /???/&lt;/SPAN&gt;&lt;/SPAN&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 May 2014 19:17:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-returning-any-table/m-p/10333758#M1836640</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-05-26T19:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: Class method returning any table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-returning-any-table/m-p/10333759#M1836641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The object that you create must persist. If you create a local object then return a reference to it, then as soon as the local object is out of scope, the reference is initialised.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I should have spotted that! &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro_emoticon jive_macro jive_emote" src="https://community.sap.com/868/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 May 2014 07:14:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-returning-any-table/m-p/10333759#M1836641</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2014-05-27T07:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: Class method returning any table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-returning-any-table/m-p/10333760#M1836642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You will surely lose your reference once you work with the local variable. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For this purpose you do not need to work with class-data defined object (variable, reference...). You can work with the returning parameter of the method itself for the whole time (&lt;SPAN class="L0S52" style="font-size: 12px; color: #333333; background: #ffffff;"&gt;et&lt;/SPAN&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;_table&lt;/SPAN&gt; from your first post, but with "returning" parameter type). E.g. create data et_table...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is one thing to remember here - returning variables are always returned by value (not referenced). So if in your case the returning parameter is a reference to an instance variable of the object, your method will always return a reference to a copy of the attribute, not the reference to the attribute itself. But other approach would ruin whole concept of OO, so you should never be trying to do that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 May 2014 08:00:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-returning-any-table/m-p/10333760#M1836642</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-05-27T08:00:17Z</dc:date>
    </item>
    <item>
      <title>Re: Class method returning any table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-returning-any-table/m-p/10333761#M1836643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This means that for each method returns whatever I need to have a separate variable in the "public section" and I have to watch to do not accidentally use this for another method?&lt;/P&gt;&lt;P&gt;Eg:&lt;/P&gt;&lt;P&gt;Public Section.&lt;/P&gt;&lt;P&gt;gt_xxxxx_for_method_returnTable1_only&lt;/P&gt;&lt;P&gt;gt_yyyyy_for_method_returnTable2_only&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;gt_zzzzz_for_method_returnTableN_only&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This promotes a mess!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;SPAN class="hps"&gt;What if&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;the method&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;returns&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;the&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;variable&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;will run&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;recursively&lt;/SPAN&gt;? &lt;SPAN class="hps"&gt;Do I have&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;to declare&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;100 variables&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;and reduce the number&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;of recursive calls&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;to&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;100?&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;&lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/906/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll try to use one variable and use local identical variables and assign them just before returning method.&lt;/P&gt;&lt;P&gt;However it is significal discomfort (for me accustomed to real OO) because every language I was used &lt;SPAN lang="en"&gt;&lt;SPAN class="hps"&gt;not&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;cause any problems&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;at this point&lt;/SPAN&gt; &lt;SPAN class="atn hps"&gt;(&lt;/SPAN&gt;returned &lt;SPAN class="hps"&gt;local value&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;or&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;reference&lt;/SPAN&gt;, and &lt;SPAN class="hps"&gt;I did not have&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;to care if&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;it still exists&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;or&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;is no longer&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;Regards.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Jun 2014 19:26:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-returning-any-table/m-p/10333761#M1836643</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-06-29T19:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: Class method returning any table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-returning-any-table/m-p/10333762#M1836644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;My sympathy...&lt;/P&gt;&lt;P&gt;For people coming from different programing environment it could be a quite an experience.....&lt;/P&gt;&lt;P&gt;You are not alone....&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jun 2014 04:47:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-returning-any-table/m-p/10333762#M1836644</guid>
      <dc:creator>rosenberg_eitan</dc:creator>
      <dc:date>2014-06-30T04:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: Class method returning any table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-returning-any-table/m-p/10333763#M1836645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="short_text" lang="en"&gt;&lt;SPAN class="hps"&gt;good to know that&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;I'm not alone&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;&lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/906/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2014 17:30:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-returning-any-table/m-p/10333763#M1836645</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-07-02T17:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: Class method returning any table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-returning-any-table/m-p/10333764#M1836646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am curious, can you tell us more about your use case, what are you trying to accomplish?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps there is an alternative approach that does not require dynamic tables?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2014 18:31:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-returning-any-table/m-p/10333764#M1836646</guid>
      <dc:creator>tom_demuyt</dc:creator>
      <dc:date>2014-07-02T18:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Class method returning any table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-returning-any-table/m-p/10333765#M1836647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="short_text" lang="en"&gt;&lt;SPAN class="hps"&gt;Thank you for your&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;willingness to help but isuue of tables is already resolved (above).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Jul 2014 14:51:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-returning-any-table/m-p/10333765#M1836647</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-07-06T14:51:24Z</dc:date>
    </item>
  </channel>
</rss>

