<?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: Return Internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/return-internal-table/m-p/3808725#M916098</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- You have to declare a table type for the returning table, which must have the same visibility (PUBLIC / PROTECTED / PRIVATE) as the GET method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CLASS lcl_customer DEFINITION.
   PUBLIC SECTION.
      TYPES:
         tyt_ref_acc TYPE TABLE OF REF TO CL_ACCOUNT
                          WITH DEFAULT KEY.
      METHODS:
         get_cuentas
             RETURNING VALUE(rt_acc_refs)  TYPE tyt_ref_acc.
ENDCLASS.

CLASS lcl_customer IMPLEMENTATION.
   METHOD get_cuentas.
*     Append to rt_acc_refs your account references.
   ENDMETHOD.
ENDCLASS.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Declare oTable_Account as:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TYPE lcl_customer=&amp;gt;tyt_ref_acc.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- When you must use the method:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
oTable_Account = oCustomer-&amp;gt;get_cuentas( ).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that code hasn't been syntax checked but with minor adjustments you should be fine.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 May 2008 19:45:16 GMT</pubDate>
    <dc:creator>alejandro_bindi</dc:creator>
    <dc:date>2008-05-16T19:45:16Z</dc:date>
    <item>
      <title>Return Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/return-internal-table/m-p/3808724#M916097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;I need return from a method ( GET_XXX ) one Table ( Internal )  with references to another objects , for example:&lt;/P&gt;&lt;P&gt;thear is one relation between Customer and Account Object, ( one to Many )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: oCustomer TYPE REF TO CL_CUSTOMER.&lt;/P&gt;&lt;P&gt;DATA: oTable_Account  TYPE TABLE OF REF TO CL_ACCOUNT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;oTable_Account  = oCustomer.GET_CUENTAS ( )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can I to do some like this??? and how??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks !!!!!!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2008 16:30:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/return-internal-table/m-p/3808724#M916097</guid>
      <dc:creator>mariano_boni</dc:creator>
      <dc:date>2008-05-16T16:30:34Z</dc:date>
    </item>
    <item>
      <title>Re: Return Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/return-internal-table/m-p/3808725#M916098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- You have to declare a table type for the returning table, which must have the same visibility (PUBLIC / PROTECTED / PRIVATE) as the GET method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CLASS lcl_customer DEFINITION.
   PUBLIC SECTION.
      TYPES:
         tyt_ref_acc TYPE TABLE OF REF TO CL_ACCOUNT
                          WITH DEFAULT KEY.
      METHODS:
         get_cuentas
             RETURNING VALUE(rt_acc_refs)  TYPE tyt_ref_acc.
ENDCLASS.

CLASS lcl_customer IMPLEMENTATION.
   METHOD get_cuentas.
*     Append to rt_acc_refs your account references.
   ENDMETHOD.
ENDCLASS.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Declare oTable_Account as:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TYPE lcl_customer=&amp;gt;tyt_ref_acc.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- When you must use the method:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
oTable_Account = oCustomer-&amp;gt;get_cuentas( ).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that code hasn't been syntax checked but with minor adjustments you should be fine.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2008 19:45:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/return-internal-table/m-p/3808725#M916098</guid>
      <dc:creator>alejandro_bindi</dc:creator>
      <dc:date>2008-05-16T19:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: Return Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/return-internal-table/m-p/3808726#M916099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your  response !!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 May 2008 12:25:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/return-internal-table/m-p/3808726#M916099</guid>
      <dc:creator>mariano_boni</dc:creator>
      <dc:date>2008-05-22T12:25:26Z</dc:date>
    </item>
  </channel>
</rss>

