<?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: passing a internal table from method in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-a-internal-table-from-method/m-p/1369433#M182214</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  Check this program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DEMO_ABAP_OBJECTS_METHODS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Give ur Id will send docs on OO ABAP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Manoj Gupta&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Jun 2006 13:14:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-06-07T13:14:46Z</dc:date>
    <item>
      <title>passing a internal table from method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-a-internal-table-from-method/m-p/1369432#M182213</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 am using Object Oriented Programming in my program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   I want to pass a Internal Table from a method calling statement written in a start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Can any one give me the syntax for &lt;/P&gt;&lt;P&gt; 1. Declaring a method with importing parameter as internal table.&lt;/P&gt;&lt;P&gt; 2. Syntax for Method Implementation &lt;/P&gt;&lt;P&gt; 3. Syntax for calling the method from start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; helpful answers are rewarded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Azaz Ali.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 13:10:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-a-internal-table-from-method/m-p/1369432#M182213</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-07T13:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: passing a internal table from method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-a-internal-table-from-method/m-p/1369433#M182214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  Check this program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DEMO_ABAP_OBJECTS_METHODS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Give ur Id will send docs on OO ABAP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Manoj Gupta&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 13:14:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-a-internal-table-from-method/m-p/1369433#M182214</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-07T13:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: passing a internal table from method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-a-internal-table-from-method/m-p/1369434#M182215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a simple example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

 report zrich_0001.

*---------------------------------------------------------------------*
*       CLASS lcl_app DEFINITION
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
 class lcl_app definition.

   public section.

     types: t_t001 type table of t001.

     class-data: it001 type table of t001,
                 xt001 type t001.

     class-methods: put_data importing im_t001 type t_t001,
                    write_data.

 endclass.


*---------------------------------------------------------------------*
*       CLASS lcl_app  IMPLEMENATION
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
 class lcl_app implementation.

   method put_data.
     it001[] = im_t001[].

   endmethod.

   method write_data.
     loop at it001 into xt001.
       write:/ xt001.
     endloop.

   endmethod.

 endclass.

 data: itab type table of t001.

 start-of-selection.

   select * into table itab from t001.

   call method lcl_app=&amp;gt;put_data( itab ).
   call method lcl_app=&amp;gt;write_data.

&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>Wed, 07 Jun 2006 13:16:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-a-internal-table-from-method/m-p/1369434#M182215</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-06-07T13:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: passing a internal table from method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-a-internal-table-from-method/m-p/1369435#M182216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Manoj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  In program which you have mentioned no where call method statement is using exporting statement with internal Table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Azaz Ali.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 13:23:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-a-internal-table-from-method/m-p/1369435#M182216</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-07T13:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: passing a internal table from method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-a-internal-table-from-method/m-p/1369436#M182217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Azaz,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Declare the parameter as follows in the parameter list of the method :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameter : t_table&lt;/P&gt;&lt;P&gt;Type : Exporting or Changing &lt;/P&gt;&lt;P&gt;Typing Method : Type &lt;/P&gt;&lt;P&gt;Associated Type : Table Type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Double Click the method name in SE24 and write the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. CALL METHOD CL_GUI_FRONTEND_SERVICES=&amp;gt;FILE_EXIST&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      FILE            = SOURCE&lt;/P&gt;&lt;P&gt;    RECEIVING&lt;/P&gt;&lt;P&gt;      RESULT          = RC&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      CNTL_ERROR      = 1&lt;/P&gt;&lt;P&gt;      ERROR_NO_GUI    = 2&lt;/P&gt;&lt;P&gt;      WRONG_PARAMETER = 3&lt;/P&gt;&lt;P&gt;      others          = 4.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward points if it helps.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 13:23:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-a-internal-table-from-method/m-p/1369436#M182217</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-07T13:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: passing a internal table from method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-a-internal-table-from-method/m-p/1369437#M182218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  Calling Method is similar to calling function Module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD cl_gui_frontend_services=&amp;gt;gui_download&lt;/P&gt;&lt;P&gt;   exporting&lt;/P&gt;&lt;P&gt;      filename    =&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   FILELENGTH                =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  changing&lt;/P&gt;&lt;P&gt;    data_tab                  = &amp;lt;b&amp;gt;( this is ur internal table name )&amp;lt;/b&amp;gt;*  EXCEPTIONS&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   FILE_WRITE_ERROR          = 1.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;In OO ABAP u avoid creating table with header line&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best way to call method is to use &amp;lt;b&amp;gt;PATTERN&amp;lt;/b&amp;gt; Button   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Click Pattern Button&lt;/P&gt;&lt;P&gt;2) Select Abap Object Pattern&lt;/P&gt;&lt;P&gt;3) Enter&lt;/P&gt;&lt;P&gt;4) Select Call Method&lt;/P&gt;&lt;P&gt;5) Enter instance name ( i. e  used for create object ) ( No need for static method like gui_download )&lt;/P&gt;&lt;P&gt;6) Enter Class / Interface name&lt;/P&gt;&lt;P&gt;7) Enter Method Name&lt;/P&gt;&lt;P&gt;done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;passing value to method is similar to FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Creating internal table for Method &lt;/P&gt;&lt;P&gt;any TYPE ........SAY  TY_Intern&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then Syntax Should Be&lt;/P&gt;&lt;P&gt;DATA : OO_INTERNAL_TABLe type table of TY_Intern.&lt;/P&gt;&lt;P&gt;pass this to the Method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope This will solve ur problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please Mark Helpful Answers&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Manoj Gupta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 13:40:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-a-internal-table-from-method/m-p/1369437#M182218</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-07T13:40:19Z</dc:date>
    </item>
  </channel>
</rss>

