<?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 Builder in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-builder/m-p/3309296#M792652</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;           Classes&lt;/P&gt;&lt;P&gt;It can be regarded as instruction for building an Object&lt;/P&gt;&lt;P&gt;The type of an object is known as its Class&lt;/P&gt;&lt;P&gt;Abstract description of an object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Classes contain components which describe state and behavior of an object.&lt;/P&gt;&lt;P&gt;Global classes can be defined using SE24(Class Builder) and local classes using SE38&lt;/P&gt;&lt;P&gt;Note : Instance of a Class is called Object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Complete definition includes : &lt;/P&gt;&lt;P&gt; Declaration part  &lt;/P&gt;&lt;P&gt; Implementation part (If required)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Class MyClass Definition.&lt;/P&gt;&lt;P&gt;&amp;#133;                                                   Declaration Part ( For attributes, Methods&lt;/P&gt;&lt;P&gt;EndClass.                                                                  and Events)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If Declaration part contains Methods, then these methods must be implemented in the Implementation part using statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Class MyClass Implementation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EndClass&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Components of Class can be :&lt;/P&gt;&lt;P&gt;Attributes &lt;/P&gt;&lt;P&gt;Methods &lt;/P&gt;&lt;P&gt;Events &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The declaration part can be divided  into three sections namely&lt;/P&gt;&lt;P&gt;PUBLIC SECTION, PROTECTED SECTION and PRIVATE SECTION&lt;/P&gt;&lt;P&gt;which controls the visibility.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each component of class must be explicitly assigned to one of these three&lt;/P&gt;&lt;P&gt;visibility sections&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Components Types&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instance Components : &lt;/P&gt;&lt;P&gt;Instance Dependent&lt;/P&gt;&lt;P&gt;Exist for each Object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Static Components : &lt;/P&gt;&lt;P&gt;Instance Independent&lt;/P&gt;&lt;P&gt;Exist only once for each class&lt;/P&gt;&lt;P&gt;They are retained for the entire Runtime&lt;/P&gt;&lt;P&gt;All objects of  a class can access the static attributes of the class&lt;/P&gt;&lt;P&gt;When a static attribute is changed, this change is reflected in all other objects of the class&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          Attributes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attributes are data fields in the Class&lt;/P&gt;&lt;P&gt;Can have any ABAP datatype&lt;/P&gt;&lt;P&gt;The contents of the Attribute determine the status of the object.&lt;/P&gt;&lt;P&gt;Can be Instance( DATA Statement) or &lt;/P&gt;&lt;P&gt;                Static    ( CLASS-DATA Statement)&lt;/P&gt;&lt;P&gt;Note : Within the Class, the addition LIKE can only be used for reference to other attributes of the class. For references to data types from the ABAP Dictionary, only  the addition TYPE can be used&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Methods &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal procedures in the Class&lt;/P&gt;&lt;P&gt;Determine behavior of an Object&lt;/P&gt;&lt;P&gt;Can access all attributes of the Class and can thus change the status of an Object&lt;/P&gt;&lt;P&gt;Similar to other ABAP procedures (Subroutines and Function Modules)&lt;/P&gt;&lt;P&gt;Can be Instance ( METHODS) or  Static (CLASS-METHODS)&lt;/P&gt;&lt;P&gt;They are declared in the Declaration part and implemented in the Implementation part using statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Method MyMethod.&lt;/P&gt;&lt;P&gt;&amp;#133;.&lt;/P&gt;&lt;P&gt;EndMethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calling a Method&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The additions to the above statement are &lt;/P&gt;&lt;P&gt;     1. ... EXPORTING&amp;nbsp;&amp;nbsp;p1 = f1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ... pn = fn  ( By Value/ By Reference) &lt;/P&gt;&lt;P&gt;     2. ... IMPORTING&amp;nbsp;&amp;nbsp;p1 = f1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ... pn = fn   ( By Value/ By Reference)&lt;/P&gt;&lt;P&gt;     3. ... CHANGING&amp;nbsp;&amp;nbsp; p1 = f1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ... pn = fn   ( By Value/ By Reference)&lt;/P&gt;&lt;P&gt;     4. ... RETURNING&amp;nbsp;p = f                             ( By Value)&lt;/P&gt;&lt;P&gt;     5. ... EXCEPTIONS except1 = rc1 ... exceptn = rcn&lt;/P&gt;&lt;P&gt;     6. ... PARAMETER-TABLE itab&lt;/P&gt;&lt;P&gt;     7. ... EXCEPTION-TABLE itab &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variant 2 : CALL METHOD meth( f ). &lt;/P&gt;&lt;P&gt;                 If it has only one input (IMPORTING) parameter and no other interface&lt;/P&gt;&lt;P&gt;                 parameters. Here f is actual parameter.&lt;/P&gt;&lt;P&gt;Variant 3 : CALL METHOD meth( p1 = f1 ... pn = fn ). &lt;/P&gt;&lt;P&gt;                 If the method has only input parameters(IMPORTING) parameter and no other &lt;/P&gt;&lt;P&gt;                 interface parameters. Here f1 &amp;#133;. fn are actual parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      Events&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Events enable objects or classes to trigger Event Handler Methods in other objects or Classes&lt;/P&gt;&lt;P&gt;Events are of two types : Instance and Static&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instance Events &lt;/P&gt;&lt;P&gt;Declared using the statement EVENTS.&lt;/P&gt;&lt;P&gt;Instance events can only be triggered in Instance Methods.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Static Events &lt;/P&gt;&lt;P&gt;Declared using statement CLASS-EVENTS&lt;/P&gt;&lt;P&gt;Static events can be triggered both by Instance Methods and Static Methods&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Registers and deregisters Event Handler Methods dynamically at Runtime&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   SET HANDLER&lt;/P&gt;&lt;P&gt;This statement can be used in three ways&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET HANDLER h1 &amp;#133;.hn FOR ref &lt;/P&gt;&lt;P&gt;This form is used for instance events and registers the Event Handler Methods for only one instance (i.e one object )&lt;/P&gt;&lt;P&gt;      ref stands for Class Reference Variable or Interface Reference Variable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET HANDLER h1&amp;#133;..hn FOR ALL INSTANCES&lt;/P&gt;&lt;P&gt;This form is used for instance events and registers the Event Handler Methods for all Instances&lt;/P&gt;&lt;P&gt;      ref stands for Class Reference Variable or Interface Reference Variable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET HANDLER h1&amp;#133;..hn. &lt;/P&gt;&lt;P&gt;This form is used for static events.&lt;/P&gt;&lt;P&gt;In case of Class Reference : It registers Event Handler Methods for triggering from class where the event has been declared.&lt;/P&gt;&lt;P&gt;In case of Interface Reference : It registers the event handler methods for all triggering classes that implement the interface intf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Creating Object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To create objects we have to use the CREATE OBJECT statement.&lt;/P&gt;&lt;P&gt;                     CREATE OBJECT cref.&lt;/P&gt;&lt;P&gt;   where, cref = Class Reference Variable&lt;/P&gt;&lt;P&gt;&lt;SPAN __jive_macro_name="data"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can have interface parameters like EXPORTING or EXCEPTIONS. &lt;/P&gt;&lt;P&gt;If the Class has instance constructor (CONSTRUCTOR), the CREATE OBJECT statement calls it after the object has been created completely&lt;/P&gt;&lt;P&gt;If the Class has static constructor (CLASS_CONSTRUCTOR), and it has not yet been executed, the CREATE OBJECT statement calls it before creating the Object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample Program:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Prg1:&lt;/P&gt;&lt;P&gt;   CLASS C1 DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    DATA: I_PUB_V1 TYPE I VALUE 10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PROTECTED SECTION.&lt;/P&gt;&lt;P&gt;    DATA: I_PRO_V1 TYPE I VALUE 20.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    DATA: I_PRI_V1 TYPE I VALUE 30.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.                    "C1 DEFINITION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  DATA: OBJ TYPE REF TO C1.&lt;/P&gt;&lt;P&gt;  CREATE OBJECT OBJ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WRITE:/ OBJ-&amp;gt;I_PUB_V1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Prog2:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS C1 DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    EVENTS: E1.&lt;/P&gt;&lt;P&gt;    METHODS: M1,&lt;/P&gt;&lt;P&gt;             M2 FOR EVENT E1 OF C1.&lt;/P&gt;&lt;P&gt;ENDCLASS.                    "C1 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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      CLASS C1 IMPLEMENTATION&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&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 C1 IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD M1.&lt;/P&gt;&lt;P&gt;    WRITE:/ 'IM M1 RAISING EVENT E1'.&lt;/P&gt;&lt;P&gt;    RAISE EVENT E1.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.                    "M1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD M2.&lt;/P&gt;&lt;P&gt;    WRITE:/ 'I M M2 EVENT HANDLER METHOD EXECUTED VIA EVENT E1'.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.                    "M2&lt;/P&gt;&lt;P&gt;ENDCLASS.                    "C1 IMPLEMENTATION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;DATA: OBJ TYPE REF TO C1.&lt;/P&gt;&lt;P&gt;  CREATE OBJECT OBJ.&lt;/P&gt;&lt;P&gt;  SET HANDLER OBJ-&amp;gt;M2 FOR OBJ.&lt;/P&gt;&lt;P&gt;  CALL METHOD OBJ-&amp;gt;M1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;prog3:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EPORT  ZLCL_IF                                 .&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      INTERFACE IF1&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&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;INTERFACE IF1.&lt;/P&gt;&lt;P&gt;  METHODS: M1 IMPORTING P1 TYPE I&lt;/P&gt;&lt;P&gt;                        P2 TYPE I&lt;/P&gt;&lt;P&gt;              EXPORTING P3 TYPE I.&lt;/P&gt;&lt;P&gt;ENDINTERFACE.                    "IF1&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      CLASS CL_ABS DEFINITION&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&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 CL_ABS DEFINITION ABSTRACT.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    METHODS: M1,&lt;/P&gt;&lt;P&gt;             M2 ABSTRACT IMPORTING P1 TYPE I&lt;/P&gt;&lt;P&gt;                                   P2 TYPE I&lt;/P&gt;&lt;P&gt;                         EXPORTING P3 TYPE I.&lt;/P&gt;&lt;P&gt;ENDCLASS.                    "CL_ABS DEFINITION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If these helpful rewards points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pratap.M&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 31 Jan 2008 11:44:57 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-31T11:44:57Z</dc:date>
    <item>
      <title>Class Builder</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-builder/m-p/3309295#M792651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello! I am beginner of Objects.&lt;/P&gt;&lt;P&gt;I've just started &lt;STRONG&gt;SE24&lt;/STRONG&gt; and what is:&lt;/P&gt;&lt;P&gt;friends? Interfaces? Events? etc....&lt;/P&gt;&lt;P&gt;Where can I read about? Pls, docus, tutorials...&lt;/P&gt;&lt;P&gt;As soon as I create my first class, how can I call up (=implement) it in my REPORT?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jan 2008 11:23:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-builder/m-p/3309295#M792651</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-31T11:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: Class Builder</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-builder/m-p/3309296#M792652</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;           Classes&lt;/P&gt;&lt;P&gt;It can be regarded as instruction for building an Object&lt;/P&gt;&lt;P&gt;The type of an object is known as its Class&lt;/P&gt;&lt;P&gt;Abstract description of an object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Classes contain components which describe state and behavior of an object.&lt;/P&gt;&lt;P&gt;Global classes can be defined using SE24(Class Builder) and local classes using SE38&lt;/P&gt;&lt;P&gt;Note : Instance of a Class is called Object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Complete definition includes : &lt;/P&gt;&lt;P&gt; Declaration part  &lt;/P&gt;&lt;P&gt; Implementation part (If required)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Class MyClass Definition.&lt;/P&gt;&lt;P&gt;&amp;#133;                                                   Declaration Part ( For attributes, Methods&lt;/P&gt;&lt;P&gt;EndClass.                                                                  and Events)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If Declaration part contains Methods, then these methods must be implemented in the Implementation part using statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Class MyClass Implementation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EndClass&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Components of Class can be :&lt;/P&gt;&lt;P&gt;Attributes &lt;/P&gt;&lt;P&gt;Methods &lt;/P&gt;&lt;P&gt;Events &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The declaration part can be divided  into three sections namely&lt;/P&gt;&lt;P&gt;PUBLIC SECTION, PROTECTED SECTION and PRIVATE SECTION&lt;/P&gt;&lt;P&gt;which controls the visibility.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each component of class must be explicitly assigned to one of these three&lt;/P&gt;&lt;P&gt;visibility sections&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Components Types&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instance Components : &lt;/P&gt;&lt;P&gt;Instance Dependent&lt;/P&gt;&lt;P&gt;Exist for each Object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Static Components : &lt;/P&gt;&lt;P&gt;Instance Independent&lt;/P&gt;&lt;P&gt;Exist only once for each class&lt;/P&gt;&lt;P&gt;They are retained for the entire Runtime&lt;/P&gt;&lt;P&gt;All objects of  a class can access the static attributes of the class&lt;/P&gt;&lt;P&gt;When a static attribute is changed, this change is reflected in all other objects of the class&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          Attributes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attributes are data fields in the Class&lt;/P&gt;&lt;P&gt;Can have any ABAP datatype&lt;/P&gt;&lt;P&gt;The contents of the Attribute determine the status of the object.&lt;/P&gt;&lt;P&gt;Can be Instance( DATA Statement) or &lt;/P&gt;&lt;P&gt;                Static    ( CLASS-DATA Statement)&lt;/P&gt;&lt;P&gt;Note : Within the Class, the addition LIKE can only be used for reference to other attributes of the class. For references to data types from the ABAP Dictionary, only  the addition TYPE can be used&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Methods &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal procedures in the Class&lt;/P&gt;&lt;P&gt;Determine behavior of an Object&lt;/P&gt;&lt;P&gt;Can access all attributes of the Class and can thus change the status of an Object&lt;/P&gt;&lt;P&gt;Similar to other ABAP procedures (Subroutines and Function Modules)&lt;/P&gt;&lt;P&gt;Can be Instance ( METHODS) or  Static (CLASS-METHODS)&lt;/P&gt;&lt;P&gt;They are declared in the Declaration part and implemented in the Implementation part using statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Method MyMethod.&lt;/P&gt;&lt;P&gt;&amp;#133;.&lt;/P&gt;&lt;P&gt;EndMethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calling a Method&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The additions to the above statement are &lt;/P&gt;&lt;P&gt;     1. ... EXPORTING&amp;nbsp;&amp;nbsp;p1 = f1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ... pn = fn  ( By Value/ By Reference) &lt;/P&gt;&lt;P&gt;     2. ... IMPORTING&amp;nbsp;&amp;nbsp;p1 = f1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ... pn = fn   ( By Value/ By Reference)&lt;/P&gt;&lt;P&gt;     3. ... CHANGING&amp;nbsp;&amp;nbsp; p1 = f1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ... pn = fn   ( By Value/ By Reference)&lt;/P&gt;&lt;P&gt;     4. ... RETURNING&amp;nbsp;p = f                             ( By Value)&lt;/P&gt;&lt;P&gt;     5. ... EXCEPTIONS except1 = rc1 ... exceptn = rcn&lt;/P&gt;&lt;P&gt;     6. ... PARAMETER-TABLE itab&lt;/P&gt;&lt;P&gt;     7. ... EXCEPTION-TABLE itab &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variant 2 : CALL METHOD meth( f ). &lt;/P&gt;&lt;P&gt;                 If it has only one input (IMPORTING) parameter and no other interface&lt;/P&gt;&lt;P&gt;                 parameters. Here f is actual parameter.&lt;/P&gt;&lt;P&gt;Variant 3 : CALL METHOD meth( p1 = f1 ... pn = fn ). &lt;/P&gt;&lt;P&gt;                 If the method has only input parameters(IMPORTING) parameter and no other &lt;/P&gt;&lt;P&gt;                 interface parameters. Here f1 &amp;#133;. fn are actual parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      Events&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Events enable objects or classes to trigger Event Handler Methods in other objects or Classes&lt;/P&gt;&lt;P&gt;Events are of two types : Instance and Static&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instance Events &lt;/P&gt;&lt;P&gt;Declared using the statement EVENTS.&lt;/P&gt;&lt;P&gt;Instance events can only be triggered in Instance Methods.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Static Events &lt;/P&gt;&lt;P&gt;Declared using statement CLASS-EVENTS&lt;/P&gt;&lt;P&gt;Static events can be triggered both by Instance Methods and Static Methods&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Registers and deregisters Event Handler Methods dynamically at Runtime&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   SET HANDLER&lt;/P&gt;&lt;P&gt;This statement can be used in three ways&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET HANDLER h1 &amp;#133;.hn FOR ref &lt;/P&gt;&lt;P&gt;This form is used for instance events and registers the Event Handler Methods for only one instance (i.e one object )&lt;/P&gt;&lt;P&gt;      ref stands for Class Reference Variable or Interface Reference Variable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET HANDLER h1&amp;#133;..hn FOR ALL INSTANCES&lt;/P&gt;&lt;P&gt;This form is used for instance events and registers the Event Handler Methods for all Instances&lt;/P&gt;&lt;P&gt;      ref stands for Class Reference Variable or Interface Reference Variable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET HANDLER h1&amp;#133;..hn. &lt;/P&gt;&lt;P&gt;This form is used for static events.&lt;/P&gt;&lt;P&gt;In case of Class Reference : It registers Event Handler Methods for triggering from class where the event has been declared.&lt;/P&gt;&lt;P&gt;In case of Interface Reference : It registers the event handler methods for all triggering classes that implement the interface intf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Creating Object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To create objects we have to use the CREATE OBJECT statement.&lt;/P&gt;&lt;P&gt;                     CREATE OBJECT cref.&lt;/P&gt;&lt;P&gt;   where, cref = Class Reference Variable&lt;/P&gt;&lt;P&gt;&lt;SPAN __jive_macro_name="data"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can have interface parameters like EXPORTING or EXCEPTIONS. &lt;/P&gt;&lt;P&gt;If the Class has instance constructor (CONSTRUCTOR), the CREATE OBJECT statement calls it after the object has been created completely&lt;/P&gt;&lt;P&gt;If the Class has static constructor (CLASS_CONSTRUCTOR), and it has not yet been executed, the CREATE OBJECT statement calls it before creating the Object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample Program:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Prg1:&lt;/P&gt;&lt;P&gt;   CLASS C1 DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    DATA: I_PUB_V1 TYPE I VALUE 10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PROTECTED SECTION.&lt;/P&gt;&lt;P&gt;    DATA: I_PRO_V1 TYPE I VALUE 20.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    DATA: I_PRI_V1 TYPE I VALUE 30.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.                    "C1 DEFINITION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  DATA: OBJ TYPE REF TO C1.&lt;/P&gt;&lt;P&gt;  CREATE OBJECT OBJ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WRITE:/ OBJ-&amp;gt;I_PUB_V1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Prog2:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS C1 DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    EVENTS: E1.&lt;/P&gt;&lt;P&gt;    METHODS: M1,&lt;/P&gt;&lt;P&gt;             M2 FOR EVENT E1 OF C1.&lt;/P&gt;&lt;P&gt;ENDCLASS.                    "C1 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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      CLASS C1 IMPLEMENTATION&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&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 C1 IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD M1.&lt;/P&gt;&lt;P&gt;    WRITE:/ 'IM M1 RAISING EVENT E1'.&lt;/P&gt;&lt;P&gt;    RAISE EVENT E1.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.                    "M1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD M2.&lt;/P&gt;&lt;P&gt;    WRITE:/ 'I M M2 EVENT HANDLER METHOD EXECUTED VIA EVENT E1'.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.                    "M2&lt;/P&gt;&lt;P&gt;ENDCLASS.                    "C1 IMPLEMENTATION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;DATA: OBJ TYPE REF TO C1.&lt;/P&gt;&lt;P&gt;  CREATE OBJECT OBJ.&lt;/P&gt;&lt;P&gt;  SET HANDLER OBJ-&amp;gt;M2 FOR OBJ.&lt;/P&gt;&lt;P&gt;  CALL METHOD OBJ-&amp;gt;M1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;prog3:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EPORT  ZLCL_IF                                 .&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      INTERFACE IF1&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&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;INTERFACE IF1.&lt;/P&gt;&lt;P&gt;  METHODS: M1 IMPORTING P1 TYPE I&lt;/P&gt;&lt;P&gt;                        P2 TYPE I&lt;/P&gt;&lt;P&gt;              EXPORTING P3 TYPE I.&lt;/P&gt;&lt;P&gt;ENDINTERFACE.                    "IF1&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      CLASS CL_ABS DEFINITION&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&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 CL_ABS DEFINITION ABSTRACT.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    METHODS: M1,&lt;/P&gt;&lt;P&gt;             M2 ABSTRACT IMPORTING P1 TYPE I&lt;/P&gt;&lt;P&gt;                                   P2 TYPE I&lt;/P&gt;&lt;P&gt;                         EXPORTING P3 TYPE I.&lt;/P&gt;&lt;P&gt;ENDCLASS.                    "CL_ABS DEFINITION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If these helpful rewards points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pratap.M&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jan 2008 11:44:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-builder/m-p/3309296#M792652</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-31T11:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: Class Builder</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-builder/m-p/3309297#M792653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andrei,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Classes and Interfaces &lt;/P&gt;&lt;P&gt;This section describes the definition of classes and interfaces and of their components. Classes and interfaces form the basis for ABAP Objects, the object-oriented part of the ABAP language. Classes and interfaces can be defined in ABAP programs of the following program types: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a class pool, you use the Class Builder tool of the ABAP Workbench to define exactly one global class of the class library, which can then be used in all other ABAP programs. In the global declaration section of a class pool, you can individually define local data types, classes and interfaces to tbe used in the class pool and make type groups known. Apart from the TYPES and TYPE-POOLS statements, in class pools no other statements are allowed outside of classes and interfaces. &lt;/P&gt;&lt;P&gt;In an interface pool, you use the Class Builder tool of the ABAP Workbench to define exactly one global interface of the class library to be used in all other ABAP programs. In the global declaration section of an interface pool, you are not allowed to define local data types, classes and interfaces. You can declare type groups. Apart from the statement TYPE-POOLS, in interface pools no other statements are allowed outside of the global interfaces. &lt;/P&gt;&lt;P&gt;In all other ABAP programs, except type groups, you can define local classes and interfaces to be used in the program itself. &lt;/P&gt;&lt;P&gt;Apart from the TYPES and TYPE-POOLS statements, in class and interface pools no other statements are allowed outside of CLASS - ENDCLASS or INTERFACE - ENDINTERFACE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An example of interface program:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES ZVIJIRANK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA IT LIKE TABLE OF ZVIJIRANK WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INTERFACE I1.&lt;/P&gt;&lt;P&gt;METHODS : GETDATA.&lt;/P&gt;&lt;P&gt;ENDINTERFACE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS CL1 DEFINITION.&lt;/P&gt;&lt;P&gt;PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;INTERFACES I1.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS CL2 DEFINITION.&lt;/P&gt;&lt;P&gt;PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;INTERFACES I1.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS CL1 IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;METHOD I1~GETDATA.&lt;/P&gt;&lt;P&gt;SELECT * FROM ZVIJIRANK INTO TABLE IT.&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 CL2 IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;METHOD I1~GETDATA.&lt;/P&gt;&lt;P&gt;SELECT * FROM ZVIJIRANK INTO TABLE IT WHERE REG_NO = '101'.&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;/P&gt;&lt;P&gt;DATA: OBJ1 TYPE REF TO CL1,&lt;/P&gt;&lt;P&gt;OBJ2 TYPE REF TO CL2.&lt;/P&gt;&lt;P&gt;&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: OBJ1 , OBJ2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD OBJ1-&amp;gt;I1~GETDATA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT IT.&lt;/P&gt;&lt;P&gt;WRITE : / IT-REG_NO , IT-NAME , IT-BRANCH.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD OBJ2-&amp;gt;I1~GETDATA.&lt;/P&gt;&lt;P&gt;LOOP AT IT.&lt;/P&gt;&lt;P&gt;WRITE : / IT-REG_NO , IT-NAME , IT-BRANCH.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have doubt means go through the following links.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm&lt;/A&gt; &lt;/P&gt;&lt;P&gt;hope this is helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;Hema.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jan 2008 15:18:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-builder/m-p/3309297#M792653</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-31T15:18:10Z</dc:date>
    </item>
  </channel>
</rss>

