<?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: Attributes in OO in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/attributes-in-oo/m-p/4092131#M978525</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Subramanian,&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if so, what i have to declare in Attributes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 06 Jul 2008 07:42:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-07-06T07:42:13Z</dc:date>
    <item>
      <title>Attributes in OO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/attributes-in-oo/m-p/4092129#M978523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i read that in Attributes  u have do declare global variables ,&lt;/P&gt;&lt;P&gt;in Function group i declare it in Top,but if i have lot of global Variables where i have to put it ? like table types below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF t_tab OCCURS 0,&lt;/P&gt;&lt;P&gt;     root(20)     TYPE c,&lt;/P&gt;&lt;P&gt;     description(20) TYPE c,&lt;/P&gt;&lt;P&gt;     field01(20)   TYPE c,&lt;/P&gt;&lt;P&gt;     field02(20)   TYPE c,&lt;/P&gt;&lt;P&gt;     field03(20)   TYPE c,&lt;/P&gt;&lt;P&gt;     field04(20)   TYPE c,&lt;/P&gt;&lt;P&gt;     field05(20)   TYPE c,&lt;/P&gt;&lt;P&gt;     field06(20)   TYPE c,&lt;/P&gt;&lt;P&gt;     field07(20)   TYPE c,&lt;/P&gt;&lt;P&gt;     field08(20)   TYPE c,&lt;/P&gt;&lt;P&gt;     field09(20)   TYPE c,&lt;/P&gt;&lt;P&gt;     field10(20)   TYPE c,&lt;/P&gt;&lt;P&gt;     field11(20)   TYPE c,&lt;/P&gt;&lt;P&gt;     field12(20)   TYPE c,&lt;/P&gt;&lt;P&gt;     field13(20)   TYPE c,&lt;/P&gt;&lt;P&gt;     field14(20)   TYPE c,&lt;/P&gt;&lt;P&gt;     field15(20)   TYPE c,&lt;/P&gt;&lt;P&gt;     field16(20)   TYPE c,&lt;/P&gt;&lt;P&gt;     field17(20)   TYPE c,&lt;/P&gt;&lt;P&gt;     field18(20)   TYPE c,&lt;/P&gt;&lt;P&gt;  END OF t_tab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Jul 2008 06:53:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/attributes-in-oo/m-p/4092129#M978523</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-06T06:53:50Z</dc:date>
    </item>
    <item>
      <title>Re: Attributes in OO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/attributes-in-oo/m-p/4092130#M978524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Create a program Z_TOP_DECLARATION of type I (Include), place all the global variables here and you can call in any program with the statement &lt;/P&gt;&lt;P&gt;INCLUDE Z_top_declaration.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Subramanina&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Jul 2008 07:15:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/attributes-in-oo/m-p/4092130#M978524</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-06T07:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Attributes in OO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/attributes-in-oo/m-p/4092131#M978525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Subramanian,&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if so, what i have to declare in Attributes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Jul 2008 07:42:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/attributes-in-oo/m-p/4092131#M978525</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-06T07:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: Attributes in OO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/attributes-in-oo/m-p/4092132#M978526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Type of the program will be "INCLUDE program"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Jul 2008 07:59:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/attributes-in-oo/m-p/4092132#M978526</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-06T07:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: Attributes in OO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/attributes-in-oo/m-p/4092133#M978527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ricardo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In classes "attributes" are similar to "variables" in a program. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a program variable has 2 scope &lt;/P&gt;&lt;P&gt;1.Local  &lt;/P&gt;&lt;P&gt;2.Global.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the Variable is defined in the program (what is called local), it can be accessed within the program and not outside. &lt;/P&gt;&lt;P&gt;If the Varibale is defined in the top (what is called global), it can is used in different programs that includes this top.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additionally, there is TYPES keyword which is used to define the definition of the structure/table that can be used in the program. Similarly, the TYPE can exists in the program or in the top depending on the scope local or global.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Similarly, you can define attributes of the class. The scope of the variable here is&lt;/P&gt;&lt;P&gt;1. Private ---&amp;gt; Can be accessed fron the class and not from outside.&lt;/P&gt;&lt;P&gt;2. Protected -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;&amp;gt; Can be accessed from the class and its child classes but not from outside&lt;/P&gt;&lt;P&gt;3. Public -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;&amp;gt; Can be accessed from the class and also from outside the class.&lt;/P&gt;&lt;P&gt;There is an additional scope:&lt;/P&gt;&lt;P&gt;1. Instance  ---&amp;gt; If the attribute is instance specific, you will the object of the class to access it.&lt;/P&gt;&lt;P&gt;2. Static  -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;&amp;gt; If you want a variable at class level (common to all objects) then you define them as static. Here you do not need the object of the class but the class name is sufficient.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additionally, you have the TYPES tab, where you can define types that can be used within the class. This is a global type definitation for the class attribute and all its method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this clarifies your question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Saurabh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Jul 2008 10:33:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/attributes-in-oo/m-p/4092133#M978527</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-06T10:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: Attributes in OO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/attributes-in-oo/m-p/4092134#M978528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ricardo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With respect to classes you should no longer talk about &lt;EM&gt;global / local&lt;/EM&gt; but in terms of &lt;STRONG&gt;public&lt;/STRONG&gt;, &lt;STRONG&gt;protected&lt;/STRONG&gt; or &lt;STRONG&gt;private&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;All attributes are "global" for an instance of the class but only the public ones are accessible from the outside.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are already working on ECC 6.0 you may define a public table type for your itab, e.g.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TYPES: begin of ty_s_itab,
root(20) TYPE c,
description(20) TYPE c,
field01(20) TYPE c,
field02(20) TYPE c,
field03(20) TYPE c,
field04(20) TYPE c,
field05(20) TYPE c,
field06(20) TYPE c,
field07(20) TYPE c,
field08(20) TYPE c,
field09(20) TYPE c,
field10(20) TYPE c,
field11(20) TYPE c,
field12(20) TYPE c,
field13(20) TYPE c,
field14(20) TYPE c,
field15(20) TYPE c,
field16(20) TYPE c,
field17(20) TYPE c,
field18(20) TYPE c,
END OF ty_s_itab.
TYPES: ty_t_itab        TYPE STANDARD TABLE OF ty_s_itab
                                 WITH GENERIC KEY. 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may define your public itab attribute as TYPE OF ty_t_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Jul 2008 20:45:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/attributes-in-oo/m-p/4092134#M978528</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-07-06T20:45:59Z</dc:date>
    </item>
  </channel>
</rss>

