<?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 contructor internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-contructor-internal-table/m-p/7306253#M1534906</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can I suggest that you get into the habit, right now, of using meaningful class, method and attribute names.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 Sep 2010 14:51:14 GMT</pubDate>
    <dc:creator>matt</dc:creator>
    <dc:date>2010-09-30T14:51:14Z</dc:date>
    <item>
      <title>class contructor internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-contructor-internal-table/m-p/7306251#M1534904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi epert,&lt;/P&gt;&lt;P&gt;I am new for abap objects and i am trying to change the standard program.Please refer below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CLASS a DEFINITION.
  CLASS-METHODS b.
  METHODS: constructor.
  METHODS: my,
           name.
ENDCLASS.                    "A DEFINITION

CLASS a IMPLEMENTATION.
  METHOD b.
    DATA screen TYPE REF TO a.
    CREATE OBJECT screen.
  ENDMETHOD.                    "B

  METHOD constructor.
    CALL METHOD : me-&amp;gt;my.
  ENDMETHOD.                    "Constructor

ENDCLASS.                    "A IMPLEMENTATION

START-OF-SELECTION.
  CALL METHOD a=&amp;gt;b.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How it is possbile for me to pass a internal table to the method MY. I have internal table and i need to assign to the method MY.&lt;/P&gt;&lt;P&gt;Please guide me.  standard program DEMO_ABAP_OBJECTS_SPLIT_SCREEN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Matt on Sep 30, 2010 4:47 PM - added  tags&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Matt on Sep 30, 2010 4:49 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Sep 2010 10:06:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-contructor-internal-table/m-p/7306251#M1534904</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-30T10:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: class contructor internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-contructor-internal-table/m-p/7306252#M1534905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; How it is possbile for me to pass a internal table to the method MY.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have to create a formal parameter for the method MY &amp;amp; pass your internal table to it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Class A definition.
class-methods B.
methods: constructor.
methods: my IMPORTING im_itab TYPE &amp;lt;line type of your internal table&amp;gt;,
name.
Endclass.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your CONSTRUCTOR pass the Internal Table value:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Method Constructor.
call method me-&amp;gt;my EXPORTING im_tab = itab[].
endmethod.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Sep 2010 10:49:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-contructor-internal-table/m-p/7306252#M1534905</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-09-30T10:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: class contructor internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-contructor-internal-table/m-p/7306253#M1534906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can I suggest that you get into the habit, right now, of using meaningful class, method and attribute names.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Sep 2010 14:51:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-contructor-internal-table/m-p/7306253#M1534906</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2010-09-30T14:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: class contructor internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-contructor-internal-table/m-p/7306254#M1534907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; In your CONSTRUCTOR pass the Internal Table value:&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;CODE&gt;Method Constructor.
&amp;gt; call method me-&amp;gt;my EXPORTING im_tab = itab[].
&amp;gt; endmethod.&lt;/CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In classes, we don't have the header line. So, there is no need to pass the "body" by []. Internal table name is enough to pass the data... Specifying it without the brackets avoids the confusion...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Sep 2010 16:53:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-contructor-internal-table/m-p/7306254#M1534907</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2010-09-30T16:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: class contructor internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-contructor-internal-table/m-p/7306255#M1534908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for pointing it out Naimesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Sep 2010 16:56:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-contructor-internal-table/m-p/7306255#M1534908</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-09-30T16:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: class contructor internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-contructor-internal-table/m-p/7306256#M1534909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suhas Saha.&lt;/P&gt;&lt;P&gt;Really thanks for your reply and i am trying my level best to try and error due i m new to this abap objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i have question.&lt;/P&gt;&lt;P&gt;Is it possible to pass the itab[] from   CALL METHOD a=&amp;gt;b.This is because my internal table is coming from other place.&lt;/P&gt;&lt;P&gt;I mean not in the class.&lt;/P&gt;&lt;P&gt;Basically it is coming from the screen 100 or main screen or previous screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please advice if i am doing a mistake.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HI Matt. Thanks a lot and i will follow your guide.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank  a lot everyone.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Oct 2010 06:41:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-contructor-internal-table/m-p/7306256#M1534909</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-01T06:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: class contructor internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-contructor-internal-table/m-p/7306257#M1534910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You define your CLASS-METHOD (also known as a static method) to have parameters, exactly in the way that Suhas showed you for method "my".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CLASS-METHODS b IMPORTING it_data TYPE &amp;lt;type of your internal table&amp;gt;.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suggest your read carefully, again, the documentation on the various keywords - CLASS-METHODS, METHODS etc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Oct 2010 08:11:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-contructor-internal-table/m-p/7306257#M1534910</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2010-10-01T08:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: class contructor internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-contructor-internal-table/m-p/7306258#M1534911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Matt and Suhas Saha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have done it. I used Sahas Saha tips and i did some search in SDN.&lt;/P&gt;&lt;P&gt;I got. It is good start for me in abap objects.&lt;/P&gt;&lt;P&gt;Thanks a lot everyone Matt and Suhas Saha.&lt;/P&gt;&lt;P&gt;I will close this thread.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Oct 2010 08:14:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-contructor-internal-table/m-p/7306258#M1534911</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-01T08:14:25Z</dc:date>
    </item>
  </channel>
</rss>

