<?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 OOPS Concept in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/oops-concept/m-p/3331075#M798091</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How 2 create local Class in program&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Jan 2008 10:25:58 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-30T10:25:58Z</dc:date>
    <item>
      <title>OOPS Concept</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oops-concept/m-p/3331075#M798091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How 2 create local Class in program&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jan 2008 10:25:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oops-concept/m-p/3331075#M798091</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-30T10:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: OOPS Concept</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oops-concept/m-p/3331076#M798092</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;see this example.&lt;/P&gt;&lt;P&gt;REPORT  ZCLASS_EVENT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS counter DEFINITION.&lt;/P&gt;&lt;P&gt;PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    METHODS increment_counter.&lt;/P&gt;&lt;P&gt;    EVENTS  critical_value EXPORTING value(excess) TYPE i.&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    DATA: count     TYPE i,&lt;/P&gt;&lt;P&gt;          threshold TYPE i VALUE 10.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS counter IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;    METHOD increment_counter.&lt;/P&gt;&lt;P&gt;    DATA diff TYPE i.&lt;/P&gt;&lt;P&gt;    ADD 1 TO count.&lt;/P&gt;&lt;P&gt;    IF count &amp;gt; threshold.&lt;/P&gt;&lt;P&gt;      diff = count - threshold.&lt;/P&gt;&lt;P&gt;      RAISE EVENT critical_value EXPORTING excess = diff.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;ENDMETHOD.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS handler DEFINITION.&lt;/P&gt;&lt;P&gt;PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    METHODS handle_excess&lt;/P&gt;&lt;P&gt;            FOR EVENT critical_value OF counter&lt;/P&gt;&lt;P&gt;            IMPORTING excess.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS handler IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD handle_excess.&lt;/P&gt;&lt;P&gt;    WRITE: / 'Excess is', excess.&lt;/P&gt;&lt;P&gt;ENDMETHOD.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: r1 TYPE REF TO counter,&lt;/P&gt;&lt;P&gt;      h1 TYPE REF TO handler.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CREATE OBJECT: r1, h1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SET HANDLER h1-&amp;gt;handle_excess FOR ALL INSTANCES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DO 20 TIMES.&lt;/P&gt;&lt;P&gt;    CALL METHOD r1-&amp;gt;increment_counter.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***********************************************************************&lt;/P&gt;&lt;P&gt;REPORT  ZCLASS_EVENT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS counter DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    METHODS increment_counter.&lt;/P&gt;&lt;P&gt;    EVENTS  critical_value EXPORTING value(excess) TYPE i.&lt;/P&gt;&lt;P&gt;    METHODS handle_excess&lt;/P&gt;&lt;P&gt;            FOR EVENT critical_value OF counter&lt;/P&gt;&lt;P&gt;            IMPORTING excess.&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    DATA: count     TYPE i,&lt;/P&gt;&lt;P&gt;          threshold TYPE i VALUE 10.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS counter IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;    METHOD increment_counter.&lt;/P&gt;&lt;P&gt;    DATA diff TYPE i.&lt;/P&gt;&lt;P&gt;    ADD 1 TO count.&lt;/P&gt;&lt;P&gt;    IF count &amp;gt; threshold.&lt;/P&gt;&lt;P&gt;      diff = count - threshold.&lt;/P&gt;&lt;P&gt;      RAISE EVENT critical_value EXPORTING excess = diff.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    METHOD handle_excess.&lt;/P&gt;&lt;P&gt;      WRITE: / 'Excess is', excess.&lt;/P&gt;&lt;P&gt;    ENDMETHOD.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: r1 TYPE REF TO counter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CREATE OBJECT: r1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SET HANDLER r1-&amp;gt;handle_excess FOR ALL INSTANCES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DO 20 TIMES.&lt;/P&gt;&lt;P&gt;    CALL METHOD r1-&amp;gt;increment_counter.&lt;/P&gt;&lt;P&gt;  ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds,&lt;/P&gt;&lt;P&gt;bharat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jan 2008 10:31:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oops-concept/m-p/3331076#M798092</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-30T10:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: OOPS Concept</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oops-concept/m-p/3331077#M798093</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;CLASS lcl_airplane DEFINITION.&lt;/P&gt;&lt;P&gt;PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;METHODS: set_name importing&lt;/P&gt;&lt;P&gt;im_name TYPE string.&lt;/P&gt;&lt;P&gt;PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;METHODS: init_name.&lt;/P&gt;&lt;P&gt;DATA: name TYPE string.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS lcl_airplane IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;METHOD init_name.&lt;/P&gt;&lt;P&gt;name = &amp;#145;No Name&amp;#145;.&lt;/P&gt;&lt;P&gt;ENDMETHOD.&lt;/P&gt;&lt;P&gt;METHOD set_name.&lt;/P&gt;&lt;P&gt;IF im_name IS INITIAL.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Calling init_name&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;ELSE. name = im_name. ENDIF.&lt;/P&gt;&lt;P&gt;ENDMETHOD.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hope this is helpful, Do reward.&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jan 2008 10:31:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oops-concept/m-p/3331077#M798093</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-30T10:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: OOPS Concept</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oops-concept/m-p/3331078#M798094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pls refer the pgm: DEMO_ABAP_OBJECTS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jan 2008 10:34:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oops-concept/m-p/3331078#M798094</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-30T10:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: OOPS Concept</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oops-concept/m-p/3331079#M798095</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;The components of the class are defined in the definition part. The components are attributes, methods,&lt;/P&gt;&lt;P&gt;events, constants, types and implemented interfaces. Only methods are implemented in the&lt;/P&gt;&lt;P&gt;implementation part.&lt;/P&gt;&lt;P&gt;The CLASS statement cannot be nested, that is, you cannot define a class within a class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attributes describe the data that can be stored in the objects in a class.&lt;/P&gt;&lt;P&gt;Class attributes can be of any type:&lt;/P&gt;&lt;P&gt;Data types: scalar (for example, data element), structured, in tables&lt;/P&gt;&lt;P&gt;ABAP elementary types (C, I, ...)&lt;/P&gt;&lt;P&gt;Object references&lt;/P&gt;&lt;P&gt;Interface references&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In classes, you can only use the TYPE reference to refer to data types in the ABAP Dictionary.&lt;/P&gt;&lt;P&gt;You can only use the LIKE reference for local data objects.&lt;/P&gt;&lt;P&gt;The READ-ONLY addition means that a public attribute declared with DATA can be read from outside, but&lt;/P&gt;&lt;P&gt;can only be changed by methods within the class.&lt;/P&gt;&lt;P&gt;You can currently only use the READ-ONLY addition in the public visibility section (PUBLIC SECTION) of a&lt;/P&gt;&lt;P&gt;class declaration or in an interface definition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can protect attributes against access from outside by characterizing them as private attributes (defined&lt;/P&gt;&lt;P&gt;in the PRIVATE SECTION).&lt;/P&gt;&lt;P&gt;Attributes and their values that may be used directly by an external user are public attributes and are&lt;/P&gt;&lt;P&gt;defined in the PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;In the above example for class lcl_airplane, the name attribute is initially defined as a public attribute and&lt;/P&gt;&lt;P&gt;the weight attribute is defined as a private attribute.&lt;/P&gt;&lt;P&gt;Public attributes belong to the class &amp;#145;external point of contact&amp;#146; that is, their implementation is publicized. If&lt;/P&gt;&lt;P&gt;you want to hide the internal implementation from users, you must define internal and external views of&lt;/P&gt;&lt;P&gt;attributes.&lt;/P&gt;&lt;P&gt;As a general rule, you should define as few public attributes as possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hope this is helpful, Do reward.&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jan 2008 10:37:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oops-concept/m-p/3331079#M798095</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-30T10:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: OOPS Concept</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oops-concept/m-p/3331080#M798096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;good&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Global classes are the classes which we find in SE24 and call the methods of them into our program.&lt;/P&gt;&lt;P&gt;see the sample code&lt;/P&gt;&lt;P&gt;REPORT zs_class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION SCREEN &lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------" /&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.&lt;/P&gt;&lt;P&gt;PARAMETERS:p_var TYPE i,&lt;/P&gt;&lt;P&gt;p_var1 TYPE i.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF BLOCK b1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS d_class DEFINITION &lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------" /&gt;&lt;P&gt;CLASS d_class DEFINITION.&lt;/P&gt;&lt;P&gt;PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;METHODS:&lt;/P&gt;&lt;P&gt;add,&lt;/P&gt;&lt;P&gt;sub.&lt;/P&gt;&lt;P&gt;PROTECTED SECTION.&lt;/P&gt;&lt;P&gt;DATA : var2 TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS. "d_class DEFINITION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS d_class IMPLEMENTATION &lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------" /&gt;&lt;P&gt;CLASS d_class IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;METHOD add.&lt;/P&gt;&lt;P&gt;var2 = p_var + p_var1.&lt;/P&gt;&lt;P&gt;WRITE:/ var2.&lt;/P&gt;&lt;P&gt;ENDMETHOD. "add&lt;/P&gt;&lt;P&gt;METHOD sub.&lt;/P&gt;&lt;P&gt;var2 = p_var - p_var1.&lt;/P&gt;&lt;P&gt;WRITE:/ var2.&lt;/P&gt;&lt;P&gt;ENDMETHOD. "sub&lt;/P&gt;&lt;P&gt;ENDCLASS. "d_class IMPLEMENTATION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION &lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;DATA: obj TYPE REF TO d_class.&lt;/P&gt;&lt;P&gt;CREATE OBJECT: obj .&lt;/P&gt;&lt;P&gt;CALL METHOD: obj-&amp;gt;add, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;mrutyun^&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jan 2008 10:58:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oops-concept/m-p/3331080#M798096</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-30T10:58:13Z</dc:date>
    </item>
  </channel>
</rss>

