<?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: object oriented abap in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/object-oriented-abap/m-p/2043997#M420596</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;please find the below material with examples,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward points if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Public attributes&lt;/P&gt;&lt;P&gt;Public attributes are defined in the PUBLIC section and can be viewed and changed from outside the class. There is direct access to public attributes. As a general rule, as few public attributes should be defined as possible.&lt;/P&gt;&lt;P&gt;PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;  DATA: Counter type i.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Private attributes&lt;/P&gt;&lt;P&gt;Private attributes are defined in the PRIVATE section. The can only be viewes and changed from within the class. There is no direct access from outside the class.&lt;/P&gt;&lt;P&gt;PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    DATA: name(25) TYPE c,&lt;/P&gt;&lt;P&gt;          planetype LIKE saplane-planetyp,&lt;/P&gt;&lt;P&gt;Instance attributes&lt;/P&gt;&lt;P&gt;There exist one instance attribute for each instance of the class, thus they exist seperately for each object. Instance attributes are declared with the DATA keyword.&lt;/P&gt;&lt;P&gt;Static attributes&lt;/P&gt;&lt;P&gt;Static attributes exist only once for each class. The data are the same for all instances of the class, and can be used e.g. for instance counters. Static attributes are defined with the keyword CLASS-DATA.&lt;/P&gt;&lt;P&gt;PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;  CLASS-DATA: counter type i,   &lt;/P&gt;&lt;P&gt;Public methods&lt;/P&gt;&lt;P&gt;Can called from outside the class&lt;/P&gt;&lt;P&gt;PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;  METHODS:  set_attributes IMPORTING p_name(25) TYPE c,&lt;/P&gt;&lt;P&gt;                                                            p_planetype LIKE saplane-planetyp,&lt;/P&gt;&lt;P&gt;Private methods&lt;/P&gt;&lt;P&gt;Can only be called from inside the class. They are placed in the PRIVATE section of the class.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Constructor method&lt;/P&gt;&lt;P&gt;Implicitly, each class has an instance constructor method with the reserved name constructor and a static constructor method with the reserved name class_constructor. &lt;/P&gt;&lt;P&gt;The instance constructor is executed each time you create an object (instance) with the CREATE OBJECT statement, while the class constructor is executed exactly once before you first access a class. &lt;/P&gt;&lt;P&gt;The constructors are always present. However, to implement a constructor you must declare it explicitly with the METHODS or CLASS-METHODS statements. An instance constructor can have IMPORTING parameters and exceptions. You must pass all non-optional parameters when creating an object. Static constructors have no parameters. &lt;/P&gt;&lt;P&gt;Static constructor&lt;/P&gt;&lt;P&gt;The static constructor is always called CLASS_CONSTRUCTER, and is called autmatically before the clas is first accessed, that is before any of the following actions are executed:&lt;/P&gt;&lt;P&gt;&amp;#149;	Creating an instance using CREATE_OBJECT &lt;/P&gt;&lt;P&gt;&amp;#149;	Adressing a static attribute using  &lt;/P&gt;&lt;P&gt;&amp;#149;	Calling a ststic attribute using CALL METHOD &lt;/P&gt;&lt;P&gt;&amp;#149;	Registering a static event handler &lt;/P&gt;&lt;P&gt;&amp;#149;	Registering an evetm handler method for a static event &lt;/P&gt;&lt;P&gt;The static constructor cannot be called explicitly.&lt;/P&gt;&lt;P&gt;Protected components&lt;/P&gt;&lt;P&gt;When we are talking subclassing and enheritance there is one more component than Public and Private, the Protected component. Protected components can be used by the superclass and all of the subclasses. Note that Subclasses cannot access Private components.&lt;/P&gt;&lt;P&gt;Polymorphism&lt;/P&gt;&lt;P&gt;Polymorphism: When the same method is implemented differently in different classes. This can be done using enheritance, by redefining a method from the superclass in subclasses and implement it differently.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Template for making a class&lt;/P&gt;&lt;P&gt;Delete the parts that should not be used&lt;/P&gt;&lt;P&gt;******************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Definition part&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;******************************************&lt;/P&gt;&lt;P&gt;CLASS xxx DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Public section&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------" /&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    TYPES:&lt;/P&gt;&lt;P&gt;    DATA: &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Static data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CLASS-DATA:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Methods&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Using the constructor to initialize parameters&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       constructor    IMPORTING xxx type yyy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Method with parameters&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      mm1 IMPORTING iii   TYPE ttt.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Method without parameters&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      mm2.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Static methods&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CLASS-METHODS:  &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;Protected section. Also accessable by subclasses&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------" /&gt;&lt;P&gt;  PROTECTED SECTION.&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Private section. Not accessable by subclasses&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------" /&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;******************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Implementation part&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;******************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_airplane IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD mm1.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD mm2.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&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;Template for calling a class&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create reference to class lcl_airplane&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA: airplane1 TYPE REF TO lcl_airplane.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create instance using parameters in the cosntructor method&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE OBJECT airplane1 exporting im_name = 'Hansemand'&lt;/P&gt;&lt;P&gt;                                    im_planetype = 'Boing 747'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Calling a method with parameters&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD: airplane1-&amp;gt;display_n_o_airplanes,&lt;/P&gt;&lt;P&gt;               airplane1-&amp;gt;display_attributes.&lt;/P&gt;&lt;P&gt;Subclass&lt;/P&gt;&lt;P&gt;CLASS xxx DEFINITION INHERITING FROM yyy.&lt;/P&gt;&lt;P&gt;Using af class as a parameter for a method&lt;/P&gt;&lt;P&gt;The class LCL_AIRPLANE is used as a parameter for method add_a_new_airplane:&lt;/P&gt;&lt;P&gt;METHODS:&lt;/P&gt;&lt;P&gt;  add_a_new_airplane importing im_airplane TYPE REF to lcl_airplane.&lt;/P&gt;&lt;P&gt;Interfaces&lt;/P&gt;&lt;P&gt;In ABAP interfaces are implemented in addition to, and independently of classes. An interface only has a declaration part, and do not have visibillity sections. Components (Attributes, methods, constants, types) can be defined the same way as in classes.&lt;/P&gt;&lt;P&gt;&amp;#149;	Interfaces are listed in the definition part lof the class, and must always be in the PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;&amp;#149;	Operations defined in the interface atre impemented as methods of the class. All methods of the interface must be present in the &lt;/P&gt;&lt;P&gt;&amp;#149;	implementation part of the class.&lt;/P&gt;&lt;P&gt;&amp;#149;	Attributes, events, constants and types defined in the interface are automatically available to the class carying out the implementation.&lt;/P&gt;&lt;P&gt;&amp;#149;	Interface components are adresse in the class by ]&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;Define, implement and use simple class&lt;/P&gt;&lt;P&gt;***INCLUDE ZBC404_HF_LCL_AIRPLANE .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;******************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Definition part&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;******************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_airplane DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Public section&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------" /&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    TYPES: t_name(25) TYPE c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;      constructor,&lt;/P&gt;&lt;P&gt;      set_attributes IMPORTING p_name       TYPE t_name&lt;/P&gt;&lt;P&gt;                               p_planetype  TYPE saplane-planetype,&lt;/P&gt;&lt;P&gt;      display_attributes,&lt;/P&gt;&lt;P&gt;      display_n_o_airplanes.&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;HR originaltext="------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Private section&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------" /&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Private attributes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: name(25) TYPE c,&lt;/P&gt;&lt;P&gt;          planetype TYPE saplane-planetype.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Private static attribute&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CLASS-DATA n_o_airplanes TYPE i.&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Implementation part&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;******************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_airplane IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Counts number of instances&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    n_o_airplanes = n_o_airplanes + 1.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD set_attributes.&lt;/P&gt;&lt;P&gt;    name      = p_name.&lt;/P&gt;&lt;P&gt;    planetype = p_planetype.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD display_attributes.&lt;/P&gt;&lt;P&gt;    WRITE:/ 'Name:', name, 'Planetype:', planetype.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD display_n_o_airplanes.&lt;/P&gt;&lt;P&gt;    WRITE: / 'No. planes:', n_o_airplanes.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;REPORT zbc404_hf_maintain_airplanes .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INCLUDE zbc404_hf_lcl_airplane.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create reference to class lcl_airplane&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA: airplane1 TYPE REF TO lcl_airplane,&lt;/P&gt;&lt;P&gt;      airplane2 TYPE REF TO lcl_airplane.&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create instance&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE OBJECT airplane1.&lt;/P&gt;&lt;P&gt;  CALL METHOD: airplane1-&amp;gt;display_n_o_airplanes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CREATE OBJECT airplane2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Setting attributes using a method with parameters&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD airplane1-&amp;gt;set_attributes EXPORTING p_name      = 'Kurt'&lt;/P&gt;&lt;P&gt;                                                  p_planetype = 'MD80'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Using methods &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD: airplane1-&amp;gt;display_n_o_airplanes,&lt;/P&gt;&lt;P&gt;               airplane1-&amp;gt;display_attributes.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;The resulting report:&lt;/P&gt;&lt;P&gt;Maintain airplanes                                                                                &lt;/P&gt;&lt;P&gt;No. planes:          1                                 &lt;/P&gt;&lt;P&gt;No. planes:          2                                 &lt;/P&gt;&lt;P&gt;Name: Kurt                      Planetype: MD80        &lt;/P&gt;&lt;P&gt;Use constructor to create an object with parameters&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;    TYPES: t_name(25) TYPE c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;      constructor    importing p2_name      type t_name&lt;/P&gt;&lt;P&gt;                               p2_planetype  TYPE saplane-planetype,&lt;/P&gt;&lt;P&gt;..... more code .......&lt;/P&gt;&lt;P&gt;CLASS lcl_airplane IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;P&gt;    name      = p2_name.&lt;/P&gt;&lt;P&gt;    planetype = p2_planetype.&lt;/P&gt;&lt;P&gt;..... more code .......&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  CREATE OBJECT airplane1 exporting p2_name = 'Hansemand'&lt;/P&gt;&lt;P&gt;                                    p2_planetype = 'Boing 747'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Subclassing&lt;/P&gt;&lt;P&gt;This example uses a superclass LCL_AIRPLANE and subclasses it into LCL_PASSENGER_AIRPLANE and LCL_CARGO_PLANE.&lt;/P&gt;&lt;P&gt;LCL_AIRPLANE has a method display_n_o_airplanes that displays the number of object instances.&lt;/P&gt;&lt;P&gt;LCL_PASSENGER_AIRPLANE has the private instance attribute n_o_seats, and redefines the superclass method display_attributes, so it also displays n_o_seats.&lt;/P&gt;&lt;P&gt;LCL_CARGO_PLANE has the private instance attribute cargomax, and redefines the superclass method display_attributes, so it also displays cargomax.&lt;/P&gt;&lt;P&gt;All instance attributes are provided by the cunstructor method.&lt;/P&gt;&lt;P&gt;Superclass LCL_AIRPLANE&lt;/P&gt;&lt;P&gt;***INCLUDE ZBC404_HF_LCL_AIRPLANE .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;******************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Definition part&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;******************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_airplane DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Public section&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------" /&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    TYPES: t_name(25) TYPE c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;      constructor    IMPORTING im_name      TYPE t_name&lt;/P&gt;&lt;P&gt;                               im_planetype  TYPE saplane-planetype,&lt;/P&gt;&lt;P&gt;      display_attributes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Static methods&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CLASS-METHODS:&lt;/P&gt;&lt;P&gt;      display_n_o_airplanes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Protected section&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------" /&gt;&lt;P&gt;  PROTECTED SECTION.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Private attributes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: name(25) TYPE c,&lt;/P&gt;&lt;P&gt;          planetype TYPE saplane-planetype.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Private static attribute&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CLASS-DATA n_o_airplanes TYPE i.&lt;/P&gt;&lt;P&gt;&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Implementation part&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;******************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_airplane IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;P&gt;    name      = im_name.&lt;/P&gt;&lt;P&gt;    planetype = im_planetype.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Counts number of instances&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    n_o_airplanes = n_o_airplanes + 1.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD display_attributes.&lt;/P&gt;&lt;P&gt;    WRITE:/ 'Name:', name, 'Planetype:', planetype.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD display_n_o_airplanes.&lt;/P&gt;&lt;P&gt;    WRITE: / 'No. planes:', n_o_airplanes.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;Sub class LCL_PASSENGER_AIRPLANE&lt;/P&gt;&lt;P&gt;***INCLUDE ZBC404_HF_LCL_PASSENGER_PLANE .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*******************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;This is a subclass of class lcl_airplane&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_passenger_airplane DEFINITION INHERITING FROM lcl_airplane.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  The constructor contains the parameters from the superclass&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  plus the parameters from the subclass&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;      constructor IMPORTING im_name      TYPE t_name&lt;/P&gt;&lt;P&gt;                            im_planetype TYPE saplane-planetype&lt;/P&gt;&lt;P&gt;                            im_n_o_seats TYPE sflight-seatsmax,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Redefinition of superclass method display_attributes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      display_attributes REDEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    DATA: n_o_seats TYPE sflight-seatsmax.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS lcl_passenger_airplane IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  The constructor method of the superclass MUST be called withing the&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  construtor&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL METHOD super-&amp;gt;constructor&lt;/P&gt;&lt;P&gt;                          EXPORTING im_name      = im_name&lt;/P&gt;&lt;P&gt;                                    im_planetype = im_planetype.&lt;/P&gt;&lt;P&gt;    n_o_seats = im_n_o_seats.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  The redefined  display_attributes method&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  METHOD display_attributes.&lt;/P&gt;&lt;P&gt;    CALL METHOD super-&amp;gt;display_attributes.&lt;/P&gt;&lt;P&gt;    WRITE: / 'No. seats:', n_o_seats.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;Sub class LCL_CARGO_PLANE&lt;/P&gt;&lt;P&gt;***INCLUDE ZBC404_HF_LCL_CARGO_PLANE .&lt;/P&gt;&lt;P&gt;*******************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;This is a subclass of class lcl_airplane&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_cargo_plane DEFINITION INHERITING FROM lcl_airplane.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    The constructor contains the parameters from the superclass&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    plus the parameters from the subclass&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      constructor IMPORTING im_name      TYPE t_name&lt;/P&gt;&lt;P&gt;                            im_planetype TYPE saplane-planetype&lt;/P&gt;&lt;P&gt;                            im_cargomax  type scplane-cargomax,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Redefinition of superclass method display_attributes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      display_attributes REDEFINITION.&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    DATA:cargomax TYPE scplane-cargomax.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;CLASS lcl_cargo_plane IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  The constructor method of the superclass MUST be called withing the&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  constructor&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL METHOD super-&amp;gt;constructor&lt;/P&gt;&lt;P&gt;                          EXPORTING im_name      = im_name&lt;/P&gt;&lt;P&gt;                                    im_planetype = im_planetype.&lt;/P&gt;&lt;P&gt;    cargomax = im_cargomax.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD display_attributes.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  The redefined  display_attributes method&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL METHOD super-&amp;gt;display_attributes.&lt;/P&gt;&lt;P&gt;    WRITE: / 'Cargo max:', cargomax.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&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;The Main program that uses the classes&lt;/P&gt;&lt;P&gt;REPORT zbc404_hf_main .&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Super class&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;INCLUDE zbc404_hf_lcl_airplane.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Sub classes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;INCLUDE zbc404_hf_lcl_passenger_plane.&lt;/P&gt;&lt;P&gt;INCLUDE zbc404_hf_lcl_cargo_plane.&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Type ref to sub classes. Note: It is not necesssary to make typeref to the superclass&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  o_passenger_airplane TYPE REF TO lcl_passenger_airplane,&lt;/P&gt;&lt;P&gt;  o_cargo_plane        TYPE REF TO lcl_cargo_plane.&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Display initial number of instances = 0&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD  lcl_airplane=&amp;gt;display_n_o_airplanes.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create objects&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE OBJECT o_passenger_airplane&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      im_name      = 'LH505'&lt;/P&gt;&lt;P&gt;      im_planetype = 'Boing 747'&lt;/P&gt;&lt;P&gt;      im_n_o_seats = 350.&lt;/P&gt;&lt;P&gt;  CREATE OBJECT o_cargo_plane&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      im_name      = 'AR13'&lt;/P&gt;&lt;P&gt;      im_planetype = 'DC 3'&lt;/P&gt;&lt;P&gt;      im_cargomax = 35.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Display attributes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD o_passenger_airplane-&amp;gt;display_attributes.&lt;/P&gt;&lt;P&gt;  CALL METHOD o_cargo_plane-&amp;gt;display_attributes.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Call static method display_n_o_airplanes&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Note: The syntax for calling a superclass method, differs from the syntax when calling a subclass method.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;When calling a superclass =&amp;gt; must be used instead of -&amp;gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD  lcl_airplane=&amp;gt;display_n_o_airplanes.&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;No. planes: 0 &lt;/P&gt;&lt;P&gt;Name: LH505 Planetype: Boing 747 &lt;/P&gt;&lt;P&gt;No. seats: 350 &lt;/P&gt;&lt;P&gt;Name: AR13 Planetype: DC 3 &lt;/P&gt;&lt;P&gt;Cargo max: 35,0000 &lt;/P&gt;&lt;P&gt;No. planes: 2 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Polymorphism&lt;/P&gt;&lt;P&gt;Polymorphism: When the same method is implemented differently in different classes. This can be done using enheritance, by redefining a method from the superclass in subclasses and implement it differently.&lt;/P&gt;&lt;P&gt;Classes: &lt;/P&gt;&lt;P&gt;&amp;#149;	lcl_airplane Superclass &lt;/P&gt;&lt;P&gt;&amp;#149;	lcl_cargo_airplane Subclass &lt;/P&gt;&lt;P&gt;&amp;#149;	lcl_passenger_airplane Subclass &lt;/P&gt;&lt;P&gt;The method estimate_fuel_consumption is implemented differently in the 3 classes, as it depends on the airplane type.&lt;/P&gt;&lt;P&gt;Object from different classes are stored in an internal table (plane_list) consisting of references to the superclass, and the processed &lt;/P&gt;&lt;P&gt;identically for all the classes. &lt;/P&gt;&lt;P&gt;What coding for the estimate_fuel_consumption method taht is actually executed, depends on the dynamic type of the plane reference variable,&lt;/P&gt;&lt;P&gt; that is, depends on which object plane points to.&lt;/P&gt;&lt;P&gt;DATA: cargo_plane            TYPE REF to lcl_cargo_airplane,&lt;/P&gt;&lt;P&gt;          passenger_plane    TYPE REF to lcl_passenger_airplane,&lt;/P&gt;&lt;P&gt;          plane_list                  TYPE TABLE OF REF TO lcl_airplane.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Creating the list of references&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CREATE OBJECT cargo_plane.&lt;/P&gt;&lt;P&gt;APPEND cargo_plane to plane_list.&lt;/P&gt;&lt;P&gt;CREATE OBJECT passenger_plane&lt;/P&gt;&lt;P&gt;APPEND passenger_plane to plane list.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Generic method for calucalting required fuel&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;METHOD calculate required_fuel.&lt;/P&gt;&lt;P&gt;  DATA: plane TYPE REF TO lcl_airplane.&lt;/P&gt;&lt;P&gt;  LOOP AT plane_list INTO plane.&lt;/P&gt;&lt;P&gt;    re_fuel = re_fuel + plane-&amp;gt;estimate_fuel_consumption( distance ).&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDMETHOD.&lt;/P&gt;&lt;P&gt;Working example:&lt;/P&gt;&lt;P&gt;This example assumes that the classes lcl_airplane,  lcl_passnger_airplane and lcl_cargo plane (Se Subcallsing)  exists.&lt;/P&gt;&lt;P&gt;Create objects of type lcl_cargo_plane and lcl_passenger_airplane, adds them to a list in lcl_carrier, and displays the list.  &lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp; Include  ZBC404_HF_LCL_CARRIER                                      *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp;----&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 lcl_carrier 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;CLASS lcl_carrier DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    TYPES: BEGIN OF flight_list_type,&lt;/P&gt;&lt;P&gt;              connid   TYPE sflight-connid,&lt;/P&gt;&lt;P&gt;              fldate   TYPE sflight-fldate,&lt;/P&gt;&lt;P&gt;              airplane TYPE REF TO lcl_airplane,&lt;/P&gt;&lt;P&gt;              seatsocc TYPE sflight-seatsocc,&lt;/P&gt;&lt;P&gt;              cargo(5) TYPE p DECIMALS 3,&lt;/P&gt;&lt;P&gt;           END OF flight_list_type.&lt;/P&gt;&lt;P&gt;    METHODS: constructor IMPORTING im_name TYPE string,&lt;/P&gt;&lt;P&gt;             get_name RETURNING value(ex_name) TYPE string,&lt;/P&gt;&lt;P&gt;             add_a_new_airplane IMPORTING&lt;/P&gt;&lt;P&gt;                                   im_airplane TYPE REF TO lcl_airplane,&lt;/P&gt;&lt;P&gt;    create_a_new_flight importing&lt;/P&gt;&lt;P&gt;                          im_connid   type sflight-connid&lt;/P&gt;&lt;P&gt;                          im_fldate   type sflight-fldate&lt;/P&gt;&lt;P&gt;                          im_airplane type ref to lcl_airplane&lt;/P&gt;&lt;P&gt;                          im_seatsocc type sflight-seatsocc&lt;/P&gt;&lt;P&gt;                                    optional&lt;/P&gt;&lt;P&gt;                        im_cargo    type p optional,&lt;/P&gt;&lt;P&gt;     display_airplanes.&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    DATA: name              TYPE string,&lt;/P&gt;&lt;P&gt;          list_of_airplanes TYPE TABLE OF REF TO lcl_airplane,&lt;/P&gt;&lt;P&gt;          list_of_flights   TYPE TABLE OF flight_list_type.&lt;/P&gt;&lt;P&gt;ENDCLASS.&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 lcl_carrier 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;CLASS lcl_carrier IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;P&gt;    name = im_name.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD get_name.&lt;/P&gt;&lt;P&gt;    ex_name = name.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD create_a_new_flight.&lt;/P&gt;&lt;P&gt;    DATA: wa_list_of_flights TYPE flight_list_type.&lt;/P&gt;&lt;P&gt;    wa_list_of_flights-connid   = im_connid.&lt;/P&gt;&lt;P&gt;    wa_list_of_flights-fldate   = im_fldate.&lt;/P&gt;&lt;P&gt;    wa_list_of_flights-airplane = im_airplane.&lt;/P&gt;&lt;P&gt;    IF im_seatsocc IS INITIAL.&lt;/P&gt;&lt;P&gt;      wa_list_of_flights-cargo = im_cargo.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      wa_list_of_flights-seatsocc = im_seatsocc.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    APPEND wa_list_of_flights TO list_of_flights.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD add_a_new_airplane.&lt;/P&gt;&lt;P&gt;    APPEND im_airplane TO list_of_airplanes.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD display_airplanes.&lt;/P&gt;&lt;P&gt;    DATA: l_airplane TYPE REF TO lcl_airplane.&lt;/P&gt;&lt;P&gt;    LOOP AT list_of_airplanes INTO l_airplane.&lt;/P&gt;&lt;P&gt;      CALL METHOD l_airplane-&amp;gt;display_attributes.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&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;REPORT zbc404_hf_main .&lt;/P&gt;&lt;P&gt;*******************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; This reprort uses class LCL_AIRPLNAE and subclasses&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; LCL_CARGO_PLANE and LCL_PASSENGER_AIRPLANE and class LCL_CARRIER&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Super class for airplanes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;INCLUDE zbc404_hf_lcl_airplane.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Sub classes for airplanes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;INCLUDE zbc404_hf_lcl_passenger_plane.&lt;/P&gt;&lt;P&gt;INCLUDE zbc404_hf_lcl_cargo_plane.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Carrier class&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;INCLUDE zbc404_hf_lcl_carrier.&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Type ref to classes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  o_passenger_airplane  TYPE REF TO lcl_passenger_airplane,&lt;/P&gt;&lt;P&gt;  o_passenger_airplane2 TYPE REF TO lcl_passenger_airplane,&lt;/P&gt;&lt;P&gt;  o_cargo_plane         TYPE REF TO lcl_cargo_plane,&lt;/P&gt;&lt;P&gt;  o_cargo_plane2        TYPE REF TO lcl_cargo_plane,&lt;/P&gt;&lt;P&gt;  o_carrier             TYPE REF TO lcl_carrier.&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create objects&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE OBJECT o_passenger_airplane&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      im_name      = 'LH505'&lt;/P&gt;&lt;P&gt;      im_planetype = 'Boing 747'&lt;/P&gt;&lt;P&gt;      im_n_o_seats = 350.&lt;/P&gt;&lt;P&gt;  CREATE OBJECT o_passenger_airplane2&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      im_name      = 'SK333'&lt;/P&gt;&lt;P&gt;      im_planetype = 'MD80'&lt;/P&gt;&lt;P&gt;      im_n_o_seats = 110.&lt;/P&gt;&lt;P&gt;  CREATE OBJECT o_cargo_plane&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      im_name      = 'AR13'&lt;/P&gt;&lt;P&gt;      im_planetype = 'DC 3'&lt;/P&gt;&lt;P&gt;      im_cargomax = 35.&lt;/P&gt;&lt;P&gt;  CREATE OBJECT o_cargo_plane2&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      im_name      = 'AFL124'&lt;/P&gt;&lt;P&gt;      im_planetype = 'Iljutsin 2'&lt;/P&gt;&lt;P&gt;      im_cargomax = 35000.&lt;/P&gt;&lt;P&gt;  CREATE OBJECT o_carrier&lt;/P&gt;&lt;P&gt;    EXPORTING im_name = 'Spritisch Airways'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Add passenger and cargo planes to the list of airplanes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD o_carrier-&amp;gt;add_a_new_airplane&lt;/P&gt;&lt;P&gt;     EXPORTING im_airplane = o_passenger_airplane.&lt;/P&gt;&lt;P&gt;  CALL METHOD o_carrier-&amp;gt;add_a_new_airplane&lt;/P&gt;&lt;P&gt;     EXPORTING im_airplane = o_passenger_airplane2.&lt;/P&gt;&lt;P&gt;  CALL METHOD o_carrier-&amp;gt;add_a_new_airplane&lt;/P&gt;&lt;P&gt;     EXPORTING im_airplane = o_cargo_plane.&lt;/P&gt;&lt;P&gt;  CALL METHOD o_carrier-&amp;gt;add_a_new_airplane&lt;/P&gt;&lt;P&gt;     EXPORTING im_airplane = o_cargo_plane2.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Display list of airplanes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call method o_carrier-&amp;gt;display_airplanes.&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;Name: LH505                     Planetype: Boing 747         &lt;/P&gt;&lt;P&gt;No. seats:       350                                         &lt;/P&gt;&lt;P&gt;Name: SK333                     Planetype: MD80              &lt;/P&gt;&lt;P&gt;No. seats:       110                                         &lt;/P&gt;&lt;P&gt;Name: AR13                      Planetype: DC 3              &lt;/P&gt;&lt;P&gt;Cargo max:             35,0000                               &lt;/P&gt;&lt;P&gt;Name: AFL124                    Planetype: Iljutsin 2        &lt;/P&gt;&lt;P&gt;Cargo max:         35.000,0000                               &lt;/P&gt;&lt;P&gt;Events &lt;/P&gt;&lt;P&gt;Below is a simple example of how to implement an event.&lt;/P&gt;&lt;P&gt;REPORT zbc404_hf_events_5.&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 lcl_dog 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;CLASS lcl_dog DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Declare events&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    EVENTS:&lt;/P&gt;&lt;P&gt;      dog_is_hungry&lt;/P&gt;&lt;P&gt;        EXPORTING value(ex_time_since_last_meal) TYPE i.&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;      constructor&lt;/P&gt;&lt;P&gt;          IMPORTING im_name TYPE string,&lt;/P&gt;&lt;P&gt;      set_time_since_last_meal&lt;/P&gt;&lt;P&gt;          IMPORTING im_time TYPE i,&lt;/P&gt;&lt;P&gt;      on_dog_is_hungry FOR EVENT dog_is_hungry OF lcl_dog&lt;/P&gt;&lt;P&gt;          IMPORTING ex_time_since_last_meal.&lt;/P&gt;&lt;P&gt;ENDCLASS.&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 lcl_dog 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;CLASS lcl_dog IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;P&gt;    WRITE: / 'I am a dog and my name is', im_name.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD set_time_since_last_meal.&lt;/P&gt;&lt;P&gt;    IF im_time &amp;lt; 4.&lt;/P&gt;&lt;P&gt;      SKIP 1.&lt;/P&gt;&lt;P&gt;      WRITE: / 'You fool, I am not hungry yet'.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   Subsrcribe for event:&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   set handler &amp;lt;Event handler method&amp;gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   FOR &amp;lt;ref_sender&amp;gt;!FOR ALL INSTANCES [ACTIVATION &amp;lt;var&amp;gt;]&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      SET HANDLER on_dog_is_hungry FOR ALL INSTANCES ACTIVATION 'X'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   Raise event&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      RAISE EVENT dog_is_hungry&lt;/P&gt;&lt;P&gt;        EXPORTING ex_time_since_last_meal = im_time.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD on_dog_is_hungry.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Event method, called when the event dog_is_hungry is raised&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    SKIP 1.&lt;/P&gt;&lt;P&gt;    WRITE: /  'You son of a ****. I have not eaten for more than',&lt;/P&gt;&lt;P&gt;              ex_time_since_last_meal, ' hours'.&lt;/P&gt;&lt;P&gt;    WRITE: / 'Give me something to eat NOW!'.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;ENDCLASS.&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;      R E P O R T&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;DATA: o_dog1 TYPE REF TO lcl_dog.&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  CREATE OBJECT o_dog1 EXPORTING im_name = 'Beefeater'.&lt;/P&gt;&lt;P&gt;  CALL METHOD o_dog1-&amp;gt;set_time_since_last_meal&lt;/P&gt;&lt;P&gt;    EXPORTING im_time = 2.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;This method call will raise the event dog_is_hungy&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;because time &amp;gt; 3&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD o_dog1-&amp;gt;set_time_since_last_meal&lt;/P&gt;&lt;P&gt;    EXPORTING im_time = 5.&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;I am a dog and my name is Beefeater &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You fool, I am not hungry yet &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You son of a ****. I have not eaten for more than 5 hours &lt;/P&gt;&lt;P&gt;Give me something to eat NOW! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Simple class&lt;/P&gt;&lt;P&gt;This example shows how to create a simple employee class. The constructor method is used to initialize number and name of thje employee when the object is created. A display_employee method can be called to show the attributes of the employee, and CLASS-METHOD dosplay_no_of_employees can be called to show the total number of employees (Number of instances of the employee class).&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;REPORT zbc404_hf_events_1.&lt;/P&gt;&lt;P&gt;*********************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;L C L _ E M P L O Y E E&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*********************************************************************&lt;/P&gt;&lt;P&gt;*---- LCL Employee - Definition&lt;/P&gt;&lt;P&gt;CLASS lcl_employee DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The public section is accesible from outside   &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------------" /&gt;&lt;P&gt;    TYPES:&lt;/P&gt;&lt;P&gt;      BEGIN OF t_employee,&lt;/P&gt;&lt;P&gt;        no  TYPE i,&lt;/P&gt;&lt;P&gt;        name TYPE string,&lt;/P&gt;&lt;P&gt;     END OF t_employee.&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;      constructor&lt;/P&gt;&lt;P&gt;        IMPORTING im_employee_no TYPE i&lt;/P&gt;&lt;P&gt;                  im_employee_name TYPE string,&lt;/P&gt;&lt;P&gt;      display_employee.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Class methods are global for all instances       &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CLASS-METHODS: display_no_of_employees.&lt;/P&gt;&lt;P&gt;  PROTECTED SECTION.&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The protecetd section is accesible from the class and its subclasses  &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Class data are global for all instances       &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CLASS-DATA: g_no_of_employees TYPE i.&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The private section is only accesible from within the classs  &lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;    DATA: g_employee TYPE t_employee.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*--- LCL Employee - Implementation&lt;/P&gt;&lt;P&gt;CLASS lcl_employee IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;P&gt;    g_employee-no = im_employee_no.&lt;/P&gt;&lt;P&gt;    g_employee-name = im_employee_name.&lt;/P&gt;&lt;P&gt;    g_no_of_employees = g_no_of_employees + 1.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD display_employee.&lt;/P&gt;&lt;P&gt;    WRITE:/ 'Employee', g_employee-no, g_employee-name.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD display_no_of_employees.&lt;/P&gt;&lt;P&gt;    WRITE: / 'Number of employees is:', g_no_of_employees.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;R E P O R T&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*********************************************************************&lt;/P&gt;&lt;P&gt;DATA: g_employee1 TYPE REF TO lcl_employee,&lt;/P&gt;&lt;P&gt;      g_employee2 TYPE REF TO lcl_employee.&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  CREATE OBJECT g_employee1&lt;/P&gt;&lt;P&gt;    EXPORTING im_employee_no = 1&lt;/P&gt;&lt;P&gt;              im_employee_name = 'John Jones'.&lt;/P&gt;&lt;P&gt;  CREATE OBJECT g_employee2&lt;/P&gt;&lt;P&gt;    EXPORTING im_employee_no = 2&lt;/P&gt;&lt;P&gt;              im_employee_name = 'Sally Summer'.&lt;/P&gt;&lt;P&gt;  CALL METHOD g_employee1-&amp;gt;display_employee.&lt;/P&gt;&lt;P&gt;  CALL METHOD g_employee2-&amp;gt;display_employee.&lt;/P&gt;&lt;P&gt;  CALL METHOD g_employee2-&amp;gt;display_no_of_employees.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;2. Inheritance and polymorphism&lt;/P&gt;&lt;P&gt;This example uses a superclass lcl_company_employees and two subclasses lcl_bluecollar_employee and lcl_whitecollar_employee to add employees to a list and then display a list of employees and there wages. The wages are calcukated in the method add_employee, but as the wages are calculated differently for blue collar employees and white collar emplyees, the superclass method add_employee is redeifined in the subclasses.&lt;/P&gt;&lt;P&gt;Principles:&lt;/P&gt;&lt;P&gt;Create super class LCL_CompanyEmployees. &lt;/P&gt;&lt;P&gt;The class has the methods:&lt;/P&gt;&lt;P&gt;&amp;#149;	Constructor &lt;/P&gt;&lt;P&gt;&amp;#149;	Add_Employee - Adds a new employee to the list of employees &lt;/P&gt;&lt;P&gt;&amp;#149;	Display_Employee_List - Displays all employees and there wage &lt;/P&gt;&lt;P&gt;&amp;#149;	Display_no_of_employees - Displays total number of employees &lt;/P&gt;&lt;P&gt;Note the use of CLASS-DATA to keep the list of employees and number of employees the same from instance to instance.&lt;/P&gt;&lt;P&gt;Create subclasses lcl_bluecollar_employee and lcl_whitecollar_employee. The calsses are identical, except for the redifinition of the add_employee method, where the caclculation of wage is different.&lt;/P&gt;&lt;P&gt;Methodes: &lt;/P&gt;&lt;P&gt;&amp;#149;	Constructor. The constructor is used to initialize the attributes of the employee. Note that the constructor in the supclasss has to be called from within the constructor of the subclass. &lt;/P&gt;&lt;P&gt;&amp;#149;	Add_Employee. This is a redinition of the same method in the superclass. In the redefined class the wage is calcuated, and the superclass method is called to add the employees to the emploee list.: &lt;/P&gt;&lt;P&gt;The program&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;REPORT zbc404_hf_events_2 .&lt;/P&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Super class LCL_CompanyEmployees&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_company_employees DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    TYPES:&lt;/P&gt;&lt;P&gt;      BEGIN OF t_employee,&lt;/P&gt;&lt;P&gt;        no  TYPE i,&lt;/P&gt;&lt;P&gt;        name TYPE string,&lt;/P&gt;&lt;P&gt;        wage TYPE i,&lt;/P&gt;&lt;P&gt;     END OF t_employee.&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;      constructor,&lt;/P&gt;&lt;P&gt;      add_employee&lt;/P&gt;&lt;P&gt;        IMPORTING im_no   TYPE i&lt;/P&gt;&lt;P&gt;                  im_name TYPE string&lt;/P&gt;&lt;P&gt;                  im_wage TYPE i,&lt;/P&gt;&lt;P&gt;      display_employee_list,&lt;/P&gt;&lt;P&gt;      display_no_of_employees.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    CLASS-DATA: i_employee_list TYPE TABLE OF t_employee,&lt;/P&gt;&lt;P&gt;                no_of_employees TYPE i.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*-- CLASS LCL_CompanyEmployees IMPLEMENTATION&lt;/P&gt;&lt;P&gt;CLASS lcl_company_employees IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;P&gt;    no_of_employees = no_of_employees + 1.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD add_employee.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Adds a new employee to the list of employees&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: l_employee TYPE t_employee.&lt;/P&gt;&lt;P&gt;    l_employee-no = im_no.&lt;/P&gt;&lt;P&gt;    l_employee-name = im_name.&lt;/P&gt;&lt;P&gt;    l_employee-wage = im_wage.&lt;/P&gt;&lt;P&gt;    APPEND l_employee TO i_employee_list.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD display_employee_list.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Displays all employees and there wage&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: l_employee TYPE t_employee.&lt;/P&gt;&lt;P&gt;    WRITE: / 'List of Employees'.&lt;/P&gt;&lt;P&gt;    LOOP AT i_employee_list INTO l_employee.&lt;/P&gt;&lt;P&gt;      WRITE: / l_employee-no, l_employee-name, l_employee-wage.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD display_no_of_employees.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Displays total number of employees&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    SKIP 3.&lt;/P&gt;&lt;P&gt;    WRITE: / 'Total number of employees:', no_of_employees.&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Sub class LCL_BlueCollar_Employee&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_bluecollar_employee DEFINITION&lt;/P&gt;&lt;P&gt;          INHERITING FROM lcl_company_employees.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;        constructor&lt;/P&gt;&lt;P&gt;          IMPORTING im_no             TYPE i&lt;/P&gt;&lt;P&gt;                    im_name           TYPE string&lt;/P&gt;&lt;P&gt;                    im_hours          TYPE i&lt;/P&gt;&lt;P&gt;                    im_hourly_payment TYPE i,&lt;/P&gt;&lt;P&gt;         add_employee REDEFINITION.&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    DATA:no             TYPE i,&lt;/P&gt;&lt;P&gt;         name           TYPE string,&lt;/P&gt;&lt;P&gt;         hours          TYPE i,&lt;/P&gt;&lt;P&gt;         hourly_payment TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*---- CLASS LCL_BlueCollar_Employee IMPLEMENTATION&lt;/P&gt;&lt;P&gt;CLASS lcl_bluecollar_employee IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  The superclass constructor method must be called from the subclass&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  constructor method&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL METHOD super-&amp;gt;constructor.&lt;/P&gt;&lt;P&gt;    no = im_no.&lt;/P&gt;&lt;P&gt;    name = im_name.&lt;/P&gt;&lt;P&gt;    hours = im_hours.&lt;/P&gt;&lt;P&gt;    hourly_payment = im_hourly_payment.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD add_employee.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Calculate wage an call the superclass method add_employee to add&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  the employee to the employee list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: l_wage TYPE i.&lt;/P&gt;&lt;P&gt;    l_wage = hours * hourly_payment.&lt;/P&gt;&lt;P&gt;    CALL METHOD super-&amp;gt;add_employee&lt;/P&gt;&lt;P&gt;      EXPORTING im_no = no&lt;/P&gt;&lt;P&gt;                im_name = name&lt;/P&gt;&lt;P&gt;                im_wage = l_wage.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Sub class LCL_WhiteCollar_Employee&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_whitecollar_employee DEFINITION&lt;/P&gt;&lt;P&gt;    INHERITING FROM lcl_company_employees.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;        constructor&lt;/P&gt;&lt;P&gt;          IMPORTING im_no                 TYPE i&lt;/P&gt;&lt;P&gt;                    im_name               TYPE string&lt;/P&gt;&lt;P&gt;                    im_monthly_salary     TYPE i&lt;/P&gt;&lt;P&gt;                    im_monthly_deductions TYPE i,&lt;/P&gt;&lt;P&gt;         add_employee REDEFINITION.&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    DATA:&lt;/P&gt;&lt;P&gt;      no                    TYPE i,&lt;/P&gt;&lt;P&gt;      name                  TYPE string,&lt;/P&gt;&lt;P&gt;      monthly_salary        TYPE i,&lt;/P&gt;&lt;P&gt;      monthly_deductions    TYPE i.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*---- CLASS LCL_WhiteCollar_Employee IMPLEMENTATION&lt;/P&gt;&lt;P&gt;CLASS lcl_whitecollar_employee IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  The superclass constructor method must be called from the subclass&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  constructor method&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL METHOD super-&amp;gt;constructor.&lt;/P&gt;&lt;P&gt;    no = im_no.&lt;/P&gt;&lt;P&gt;    name = im_name.&lt;/P&gt;&lt;P&gt;    monthly_salary = im_monthly_salary.&lt;/P&gt;&lt;P&gt;    monthly_deductions = im_monthly_deductions.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD add_employee.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Calculate wage an call the superclass method add_employee to add&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  the employee to the employee list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: l_wage TYPE i.&lt;/P&gt;&lt;P&gt;    l_wage = monthly_salary - monthly_deductions.&lt;/P&gt;&lt;P&gt;    CALL METHOD super-&amp;gt;add_employee&lt;/P&gt;&lt;P&gt;      EXPORTING im_no = no&lt;/P&gt;&lt;P&gt;                im_name = name&lt;/P&gt;&lt;P&gt;                im_wage = l_wage.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;R E P O R T&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Object references&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  o_bluecollar_employee1  TYPE REF TO lcl_bluecollar_employee,&lt;/P&gt;&lt;P&gt;  o_whitecollar_employee1 TYPE REF TO lcl_whitecollar_employee.&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create bluecollar employee obeject&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE OBJECT o_bluecollar_employee1&lt;/P&gt;&lt;P&gt;      EXPORTING im_no  = 1&lt;/P&gt;&lt;P&gt;                im_name  = 'Gylle Karen'&lt;/P&gt;&lt;P&gt;                im_hours = 38&lt;/P&gt;&lt;P&gt;                im_hourly_payment = 75.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Add bluecollar employee to employee list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD o_bluecollar_employee1-&amp;gt;add_employee&lt;/P&gt;&lt;P&gt;      EXPORTING im_no  = 1&lt;/P&gt;&lt;P&gt;                im_name  = 'Gylle Karen'&lt;/P&gt;&lt;P&gt;                im_wage = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create whitecollar employee obeject&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE OBJECT o_whitecollar_employee1&lt;/P&gt;&lt;P&gt;      EXPORTING im_no  = 2&lt;/P&gt;&lt;P&gt;                im_name  = 'John Dickens'&lt;/P&gt;&lt;P&gt;                im_monthly_salary = 10000&lt;/P&gt;&lt;P&gt;                im_monthly_deductions = 2500.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Add bluecollar employee to employee list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD o_whitecollar_employee1-&amp;gt;add_employee&lt;/P&gt;&lt;P&gt;      EXPORTING im_no  = 1&lt;/P&gt;&lt;P&gt;                im_name  = 'Karen Johnson'&lt;/P&gt;&lt;P&gt;                im_wage = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Display employee list and number of employees. Note that the result&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;will be the same when called from o_whitecollar_employee1 or&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;o_bluecolarcollar_employee1, because the methods are defined&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;as static (CLASS-METHODS)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD o_whitecollar_employee1-&amp;gt;display_employee_list.&lt;/P&gt;&lt;P&gt;  CALL METHOD o_whitecollar_employee1-&amp;gt;display_no_of_employees.&lt;/P&gt;&lt;P&gt;The resulting report&lt;/P&gt;&lt;P&gt;List of Employees &lt;/P&gt;&lt;P&gt;1 Karen Johnson 2.850 &lt;/P&gt;&lt;P&gt;2 John Dickens 7.500 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Total number of employees: 2 &lt;/P&gt;&lt;P&gt;3. Interfaces&lt;/P&gt;&lt;P&gt;This example is similiar to th eprevious example, however an interface is implemented with the method add_employee. Note that the interface is only implemented in the superclass ( The INTERFACE stament), but also used in the subclasses. &lt;/P&gt;&lt;P&gt;The interface in the example only contains a method, but an iterface can also contain attrbutes, constants, types and alias names.&lt;/P&gt;&lt;P&gt;The output from example 3 is similiar to the output in example 2.&lt;/P&gt;&lt;P&gt;All changes in the program compared to example 2 are marked with red.&lt;/P&gt;&lt;P&gt;REPORT zbc404_hf_events_3 .&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 lif_employee&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;INTERFACE lif_employee.&lt;/P&gt;&lt;P&gt;  METHODS:&lt;/P&gt;&lt;P&gt;    add_employee&lt;/P&gt;&lt;P&gt;       IMPORTING im_no   TYPE i&lt;/P&gt;&lt;P&gt;                  im_name TYPE string&lt;/P&gt;&lt;P&gt;                  im_wage TYPE i.&lt;/P&gt;&lt;P&gt;ENDINTERFACE.&lt;/P&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Super class LCL_CompanyEmployees&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_company_employees DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    INTERFACES lif_employee.&lt;/P&gt;&lt;P&gt;    TYPES:&lt;/P&gt;&lt;P&gt;      BEGIN OF t_employee,&lt;/P&gt;&lt;P&gt;        no  TYPE i,&lt;/P&gt;&lt;P&gt;        name TYPE string,&lt;/P&gt;&lt;P&gt;        wage TYPE i,&lt;/P&gt;&lt;P&gt;     END OF t_employee.&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;      constructor,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     add_employee      "Removed&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        IMPORTING im_no   TYPE i&lt;/P&gt;&lt;P&gt;                  im_name TYPE string&lt;/P&gt;&lt;P&gt;                  im_wage TYPE i,&lt;/P&gt;&lt;P&gt;      display_employee_list,&lt;/P&gt;&lt;P&gt;      display_no_of_employees.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    CLASS-DATA: i_employee_list TYPE TABLE OF t_employee,&lt;/P&gt;&lt;P&gt;                no_of_employees TYPE i.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*-- CLASS LCL_CompanyEmployees IMPLEMENTATION&lt;/P&gt;&lt;P&gt;CLASS lcl_company_employees IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;P&gt;    no_of_employees = no_of_employees + 1.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD lif_employee~add_employee.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Adds a new employee to the list of employees&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: l_employee TYPE t_employee.&lt;/P&gt;&lt;P&gt;    l_employee-no = im_no.&lt;/P&gt;&lt;P&gt;    l_employee-name = im_name.&lt;/P&gt;&lt;P&gt;    l_employee-wage = im_wage.&lt;/P&gt;&lt;P&gt;    APPEND l_employee TO i_employee_list.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD display_employee_list.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Displays all employees and there wage&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: l_employee TYPE t_employee.&lt;/P&gt;&lt;P&gt;    WRITE: / 'List of Employees'.&lt;/P&gt;&lt;P&gt;    LOOP AT i_employee_list INTO l_employee.&lt;/P&gt;&lt;P&gt;      WRITE: / l_employee-no, l_employee-name, l_employee-wage.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD display_no_of_employees.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Displays total number of employees&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    SKIP 3.&lt;/P&gt;&lt;P&gt;    WRITE: / 'Total number of employees:', no_of_employees.&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Sub class LCL_BlueCollar_Employee&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_bluecollar_employee DEFINITION&lt;/P&gt;&lt;P&gt;          INHERITING FROM lcl_company_employees.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;        constructor&lt;/P&gt;&lt;P&gt;          IMPORTING im_no             TYPE i&lt;/P&gt;&lt;P&gt;                    im_name           TYPE string&lt;/P&gt;&lt;P&gt;                    im_hours          TYPE i&lt;/P&gt;&lt;P&gt;                    im_hourly_payment TYPE i,&lt;/P&gt;&lt;P&gt;         lif_employee~add_employee REDEFINITION..&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    DATA:no             TYPE i,&lt;/P&gt;&lt;P&gt;         name           TYPE string,&lt;/P&gt;&lt;P&gt;         hours          TYPE i,&lt;/P&gt;&lt;P&gt;         hourly_payment TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*---- CLASS LCL_BlueCollar_Employee IMPLEMENTATION&lt;/P&gt;&lt;P&gt;CLASS lcl_bluecollar_employee IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  The superclass constructor method must be called from the subclass&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  constructor method&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL METHOD super-&amp;gt;constructor.&lt;/P&gt;&lt;P&gt;    no = im_no.&lt;/P&gt;&lt;P&gt;    name = im_name.&lt;/P&gt;&lt;P&gt;    hours = im_hours.&lt;/P&gt;&lt;P&gt;    hourly_payment = im_hourly_payment.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD lif_employee~add_employee.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Calculate wage an call the superclass method add_employee to add&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  the employee to the employee list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: l_wage TYPE i.&lt;/P&gt;&lt;P&gt;    l_wage = hours * hourly_payment.&lt;/P&gt;&lt;P&gt;    CALL METHOD super-&amp;gt;lif_employee~add_employee&lt;/P&gt;&lt;P&gt;      EXPORTING im_no = no&lt;/P&gt;&lt;P&gt;                im_name = name&lt;/P&gt;&lt;P&gt;                im_wage = l_wage.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Sub class LCL_WhiteCollar_Employee&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_whitecollar_employee DEFINITION&lt;/P&gt;&lt;P&gt;    INHERITING FROM lcl_company_employees.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;        constructor&lt;/P&gt;&lt;P&gt;          IMPORTING im_no                 TYPE i&lt;/P&gt;&lt;P&gt;                    im_name               TYPE string&lt;/P&gt;&lt;P&gt;                    im_monthly_salary     TYPE i&lt;/P&gt;&lt;P&gt;                    im_monthly_deductions TYPE i,&lt;/P&gt;&lt;P&gt;         lif_employee~add_employee REDEFINITION.&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    DATA:&lt;/P&gt;&lt;P&gt;      no                    TYPE i,&lt;/P&gt;&lt;P&gt;      name                  TYPE string,&lt;/P&gt;&lt;P&gt;      monthly_salary        TYPE i,&lt;/P&gt;&lt;P&gt;      monthly_deductions    TYPE i.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*---- CLASS LCL_WhiteCollar_Employee IMPLEMENTATION&lt;/P&gt;&lt;P&gt;CLASS lcl_whitecollar_employee IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  The superclass constructor method must be called from the subclass&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  constructor method&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL METHOD super-&amp;gt;constructor.&lt;/P&gt;&lt;P&gt;    no = im_no.&lt;/P&gt;&lt;P&gt;    name = im_name.&lt;/P&gt;&lt;P&gt;    monthly_salary = im_monthly_salary.&lt;/P&gt;&lt;P&gt;    monthly_deductions = im_monthly_deductions.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD lif_employee~add_employee.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Calculate wage an call the superclass method add_employee to add&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  the employee to the employee list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: l_wage TYPE i.&lt;/P&gt;&lt;P&gt;    l_wage = monthly_salary - monthly_deductions.&lt;/P&gt;&lt;P&gt;    CALL METHOD super-&amp;gt;lif_employee~add_employee&lt;/P&gt;&lt;P&gt;      EXPORTING im_no = no&lt;/P&gt;&lt;P&gt;                im_name = name&lt;/P&gt;&lt;P&gt;                im_wage = l_wage.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;R E P O R T&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Object references&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  o_bluecollar_employee1  TYPE REF TO lcl_bluecollar_employee,&lt;/P&gt;&lt;P&gt;  o_whitecollar_employee1 TYPE REF TO lcl_whitecollar_employee.&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create bluecollar employee obeject&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE OBJECT o_bluecollar_employee1&lt;/P&gt;&lt;P&gt;      EXPORTING im_no  = 1&lt;/P&gt;&lt;P&gt;                im_name  = 'Gylle Karen'&lt;/P&gt;&lt;P&gt;                im_hours = 38&lt;/P&gt;&lt;P&gt;                im_hourly_payment = 75.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Add bluecollar employee to employee list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD o_bluecollar_employee1-&amp;gt;lif_employee~add_employee&lt;/P&gt;&lt;P&gt;      EXPORTING im_no  = 1&lt;/P&gt;&lt;P&gt;                im_name  = 'Karen Johnson'&lt;/P&gt;&lt;P&gt;                im_wage = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create whitecollar employee obeject&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE OBJECT o_whitecollar_employee1&lt;/P&gt;&lt;P&gt;      EXPORTING im_no  = 2&lt;/P&gt;&lt;P&gt;                im_name  = 'John Dickens'&lt;/P&gt;&lt;P&gt;                im_monthly_salary = 10000&lt;/P&gt;&lt;P&gt;                im_monthly_deductions = 2500.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Add bluecollar employee to employee list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD o_whitecollar_employee1-&amp;gt;lif_employee~add_employee&lt;/P&gt;&lt;P&gt;      EXPORTING im_no  = 1&lt;/P&gt;&lt;P&gt;                im_name  = 'Gylle Karen'&lt;/P&gt;&lt;P&gt;                im_wage = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Display employee list and number of employees. Note that the result&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;will be the same when called from o_whitecollar_employee1 or&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;o_bluecolarcollar_employee1, because the methods are defined&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;as static (CLASS-METHODS)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD o_whitecollar_employee1-&amp;gt;display_employee_list.&lt;/P&gt;&lt;P&gt;  CALL METHOD o_whitecollar_employee1-&amp;gt;display_no_of_employees.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;4. Events&lt;/P&gt;&lt;P&gt;This is the same example as example 4. All changes are marked with red. There have been no canges to the subclasses, only to the superclass and the report, sp the code for th esubclasses is not shown.&lt;/P&gt;&lt;P&gt;For a simple example refer to Events in Examples.&lt;/P&gt;&lt;P&gt;REPORT zbc404_hf_events_4 .&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 lif_employee&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;INTERFACE lif_employee.&lt;/P&gt;&lt;P&gt;  METHODS:&lt;/P&gt;&lt;P&gt;    add_employee&lt;/P&gt;&lt;P&gt;       IMPORTING im_no   TYPE i&lt;/P&gt;&lt;P&gt;                  im_name TYPE string&lt;/P&gt;&lt;P&gt;                  im_wage TYPE i.&lt;/P&gt;&lt;P&gt;ENDINTERFACE.&lt;/P&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Super class LCL_CompanyEmployees&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_company_employees DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    TYPES:&lt;/P&gt;&lt;P&gt;    BEGIN OF t_employee,&lt;/P&gt;&lt;P&gt;      no  TYPE i,&lt;/P&gt;&lt;P&gt;      name TYPE string,&lt;/P&gt;&lt;P&gt;      wage TYPE i,&lt;/P&gt;&lt;P&gt;   END OF t_employee.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Declare event. Note that declaration could also be placed in the&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  interface&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    EVENTS: employee_added_to_list&lt;/P&gt;&lt;P&gt;        EXPORTING value(ex_employee_name) TYPE string.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; CLASS-EVENTS: Events can also be defined as class-events&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    INTERFACES lif_employee.&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;      constructor,&lt;/P&gt;&lt;P&gt;      display_employee_list,&lt;/P&gt;&lt;P&gt;      display_no_of_employees,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Declare event method&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      on_employee_added_to_list FOR EVENT employee_added_to_list OF lcl_company_employees&lt;/P&gt;&lt;P&gt;         IMPORTING ex_employee_name sender.&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    CLASS-DATA:&lt;/P&gt;&lt;P&gt;      i_employee_list TYPE TABLE OF t_employee,&lt;/P&gt;&lt;P&gt;      no_of_employees TYPE i.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*-- CLASS LCL_CompanyEmployees IMPLEMENTATION&lt;/P&gt;&lt;P&gt;CLASS lcl_company_employees IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;P&gt;    no_of_employees = no_of_employees + 1.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD lif_employee~add_employee.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Adds a new employee to the list of employees&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: l_employee TYPE t_employee.&lt;/P&gt;&lt;P&gt;    l_employee-no = im_no.&lt;/P&gt;&lt;P&gt;    l_employee-name = im_name.&lt;/P&gt;&lt;P&gt;    l_employee-wage = im_wage.&lt;/P&gt;&lt;P&gt;    APPEND l_employee TO i_employee_list.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Raise event employee_added_to_list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    RAISE EVENT employee_added_to_list&lt;/P&gt;&lt;P&gt;       EXPORTING ex_employee_name =  l_employee-name.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD display_employee_list.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Displays all employees and there wage&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: l_employee TYPE t_employee.&lt;/P&gt;&lt;P&gt;    WRITE: / 'List of Employees'.&lt;/P&gt;&lt;P&gt;    LOOP AT i_employee_list INTO l_employee.&lt;/P&gt;&lt;P&gt;      WRITE: / l_employee-no, l_employee-name, l_employee-wage.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD display_no_of_employees.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Displays total number of employees&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    SKIP 3.&lt;/P&gt;&lt;P&gt;    WRITE: / 'Total number of employees:', no_of_employees.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD on_employee_added_to_list.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Event method&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    WRITE: / 'Employee added to list', ex_employee_name.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Sub class LCL_BlueCollar_Employee&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_bluecollar_employee DEFINITION&lt;/P&gt;&lt;P&gt;          INHERITING FROM lcl_company_employees.&lt;/P&gt;&lt;P&gt; See code in example 3...&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;CLASS lcl_bluecollar_employee IMPLEMENTATION.&lt;/P&gt;&lt;P&gt; See code in example 3...&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Sub class LCL_WhiteCollar_Employee&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_whitecollar_employee DEFINITION&lt;/P&gt;&lt;P&gt; See code in example 3...&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;CLASS lcl_whitecollar_employee IMPLEMENTATION.&lt;/P&gt;&lt;P&gt; See code in example 3...&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;R E P O R T&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Object references&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  o_bluecollar_employee1  TYPE REF TO lcl_bluecollar_employee,&lt;/P&gt;&lt;P&gt;  o_whitecollar_employee1 TYPE REF TO lcl_whitecollar_employee.&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create bluecollar employee obeject&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE OBJECT o_bluecollar_employee1&lt;/P&gt;&lt;P&gt;      EXPORTING im_no  = 1&lt;/P&gt;&lt;P&gt;                im_name  = 'Karen Johnson'&lt;/P&gt;&lt;P&gt;                im_hours = 38&lt;/P&gt;&lt;P&gt;                im_hourly_payment = 75.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Register event for o_bluecollar_employee1&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  SET HANDLER o_bluecollar_employee1-&amp;gt;on_employee_added_to_list&lt;/P&gt;&lt;P&gt;     FOR o_bluecollar_employee1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Add bluecollar employee to employee list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD o_bluecollar_employee1-&amp;gt;lif_employee~add_employee&lt;/P&gt;&lt;P&gt;      EXPORTING im_no  = 1&lt;/P&gt;&lt;P&gt;                im_name  = 'Gylle Karen'&lt;/P&gt;&lt;P&gt;                im_wage = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create whitecollar employee obeject&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE OBJECT o_whitecollar_employee1&lt;/P&gt;&lt;P&gt;      EXPORTING im_no  = 2&lt;/P&gt;&lt;P&gt;                im_name  = 'John Dickens'&lt;/P&gt;&lt;P&gt;                im_monthly_salary = 10000&lt;/P&gt;&lt;P&gt;                im_monthly_deductions = 2500.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Register event for o_whitecollar_employee1&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  SET HANDLER o_whitecollar_employee1-&amp;gt;on_employee_added_to_list&lt;/P&gt;&lt;P&gt;     FOR o_whitecollar_employee1.´&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Add bluecollar employee to employee list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD o_whitecollar_employee1-&amp;gt;lif_employee~add_employee&lt;/P&gt;&lt;P&gt;      EXPORTING im_no  = 1&lt;/P&gt;&lt;P&gt;                im_name  = 'Gylle Karen'&lt;/P&gt;&lt;P&gt;                im_wage = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Display employee list and number of employees. Note that the result&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;will be the same when called from o_whitecollar_employee1 or&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;o_bluecolarcollar_employee1, because the methods are defined&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;as static (CLASS-METHODS)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD o_whitecollar_employee1-&amp;gt;display_employee_list.&lt;/P&gt;&lt;P&gt;  CALL METHOD o_whitecollar_employee1-&amp;gt;display_no_of_employees.&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Employee added to list Karen Johnson &lt;/P&gt;&lt;P&gt;Employee added to list John Dickens &lt;/P&gt;&lt;P&gt;List of Employees &lt;/P&gt;&lt;P&gt;1 Karen Johnson 2.850 &lt;/P&gt;&lt;P&gt;2 John Dickens 7.500 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Total number of employees: 2 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;General&lt;/P&gt;&lt;P&gt;Control Framework and enheritance hierarchy&lt;/P&gt;&lt;P&gt;The control framework consists of 2 parts:&lt;/P&gt;&lt;P&gt;&amp;#149;	CL_GUI_CFW contains methods that provide services for communication with the frontend, and can be used both by control wrapper calsses and by control progtrammers &lt;/P&gt;&lt;P&gt;&amp;#149;	The CL_GUI_OBJECT encapsulates ActiveX or JavaBeans methods, while CL_GUI_CONTROL is responsible for displaying the control on the screen. &lt;/P&gt;&lt;P&gt;CL_GUI_OBJECT -&amp;gt; CL_GUI_CONTROL -&amp;gt; CL_GUI_* (Wrapper class)&lt;/P&gt;&lt;P&gt;These classes contains methods that are enherited by subsequent classes in the enheritance tree.&lt;/P&gt;&lt;P&gt;Synchronization/Flush&lt;/P&gt;&lt;P&gt;RFC calls is used to synchronize the front and backend. This synchronization takes palce at some predifined points in the program flow. However you should not rely entirely on automatic synchronization, but force synchronization with the Flush method when necessary.&lt;/P&gt;&lt;P&gt;Bear in mind that the synchronization/RFC calls represenmts a bottleneck, so you should keep the not use the Flush method to a minimum.&lt;/P&gt;&lt;P&gt;Syntax:&lt;/P&gt;&lt;P&gt;CALL METHOD cl_gui_cfw=&amp;gt;FLUSH&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Set up event handling for controls&lt;/P&gt;&lt;P&gt;There are two types of events:&lt;/P&gt;&lt;P&gt;Application events. T&lt;/P&gt;&lt;P&gt;The flow logic of the screen is processed after the event (The PAI module is processed). &lt;/P&gt;&lt;P&gt;In the events table the event must be registred as an application event by setting then field appl_event to 'X':&lt;/P&gt;&lt;P&gt;wa_events-eventid = cl_gui_textedit=&amp;gt;event_double_click.&lt;/P&gt;&lt;P&gt;wa_events-appl_event = 'X'. &lt;/P&gt;&lt;P&gt;append wa_events to i_events.&lt;/P&gt;&lt;P&gt;Important: The dispatch method of cl_gui_cfw must be called in the PAI module:&lt;/P&gt;&lt;P&gt;CALL METHOD cl_gui_cfw=&amp;gt;dispatch. &lt;/P&gt;&lt;P&gt;System events. &lt;/P&gt;&lt;P&gt;For system events the flow-logic of the screen is not executed. That means that the PAI and PBO modules are not processed.&lt;/P&gt;&lt;P&gt;In the events table the the field appl_event must be set to SAPCE:&lt;/P&gt;&lt;P&gt;wa_events-eventid = cl_gui_textedit=&amp;gt;event_double_click.&lt;/P&gt;&lt;P&gt;wa_events-appl_event = space. &lt;/P&gt;&lt;P&gt;append wa_events to i_events.&lt;/P&gt;&lt;P&gt;The dispatch method of cl_gui_cfw must NOT be called.&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;It is presumed that a SAP toolbar control named go_toolbar of class cl_gui_toolbar has been defined. To see a complete example of how to handle events, refer to The SAP toolbar control.&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;1.  Define and instance of the eventhandler class.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     If the event handler class is defined after the data decalaration&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     the class must be declared as DEFERRED in the top of the program:  CLASS cls_event_handler DEFINITION DEFERRED.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  go_event_handler TYPE REF TO cls_event_handler,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;2. Define table for registration of events. &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Note that a TYPE REF   to cls_event_handler must be created before you can&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    reference types cntl_simple_events and cntl_simple_event&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  gi_events TYPE cntl_simple_events,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Workspace for table gi_events&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  g_event TYPE cntl_simple_event.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;3. Define and implement eventhandler class&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CLASS cls_event_handler DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Syntax:&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    &amp;lt;method name&amp;gt; FOR EVENT &amp;lt;event of control - see the control documentation&amp;gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        OF &amp;lt;class of object&amp;gt; &amp;lt;importing parameters l - see the control documentation&amp;gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      on_function_selected&lt;/P&gt;&lt;P&gt;        FOR EVENT function_selected OF cl_gui_toolbar&lt;/P&gt;&lt;P&gt;          IMPORTING fcode,&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;CLASS cls_event_handler IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;   METHOD on_function_selected.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Do something when the event is raised&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;4. Append events to the events table&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    The Event Id  can be found in the control documentation. Note that The event below is registred as an application event&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; g_event-eventid         = go_toolbar-&amp;gt;m_id_function_selected.&lt;/P&gt;&lt;P&gt; g_event-appl_event   = 'X'.    "This is an application event&lt;/P&gt;&lt;P&gt;APPEND g_event TO gi_events.&lt;/P&gt;&lt;P&gt;.... append more events i necessary...&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;5. Use the events table to register events for the control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL METHOD go_toolbar-&amp;gt;set_registered_events&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;           events = gi_events.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;6. Create event handler&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CREATE OBJECT   go_event_handler.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Syntax:&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;SET HANDLER &amp;lt;event handler class&amp;gt; -&amp;gt; &amp;lt;Event handler method&amp;gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  FOR &amp;lt;control&amp;gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;SET HANDLER go_event_handler-&amp;gt;on_function_selected&lt;/P&gt;&lt;P&gt;      FOR go_toolbar.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Declare a reference variable before the class has been defined&lt;/P&gt;&lt;P&gt;Scenario:&lt;/P&gt;&lt;P&gt;DATA: o_my_class TYPE REF TO lcl_myclass.&lt;/P&gt;&lt;P&gt;CLASS lcl_myclass.....&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;This will cause an error because the definition of class lcl_myclass is after the declaration.&lt;/P&gt;&lt;P&gt;Solution:&lt;/P&gt;&lt;P&gt;Define the class in the beginning of the program with DEFINITION DEFERRED:&lt;/P&gt;&lt;P&gt;CLASS lcl_myclass DEFINITION DEFERRED.&lt;/P&gt;&lt;P&gt;DATA: o_my_class TYPE REF TO lcl_myclass.&lt;/P&gt;&lt;P&gt;CLASS lcl_myclass.....&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Set focus to a control&lt;/P&gt;&lt;P&gt;Set the focus to a control named go_grid:&lt;/P&gt;&lt;P&gt;CALL METHOD cl_gui_control=&amp;gt;set_focus &lt;/P&gt;&lt;P&gt;  EXPORTING control = go_grid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To Use BADI - Business Add In you need to Understand ABAP OO Interface Concept &lt;/P&gt;&lt;P&gt;Content Author:  Jayanta Narayan Choudhuri &lt;/P&gt;&lt;P&gt;Author Email:      sss@cal.vsnl.net.in &lt;/P&gt;&lt;P&gt;Author Website:  &lt;A href="http://www.geocities.com/ojnc" target="test_blank"&gt;http://www.geocities.com/ojnc&lt;/A&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;For Rajat's OO ans BAdI Education &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Report Z_CTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;A Shape Interface "Like a shape" "Behaves like a Shape" &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Adverb/Adjective&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Interface IShape.&lt;/P&gt;&lt;P&gt;Methods:  getArea Returning Value(area) Type F,&lt;/P&gt;&lt;P&gt;          getCircumference Returning Value(circumference) Type F.&lt;/P&gt;&lt;P&gt;Endinterface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;A Circle Class that behaves like a Shape&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Class CCircle Definition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Public Section.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        Interfaces IShape.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        Aliases:   getArea For IShape~getArea,&lt;/P&gt;&lt;P&gt;                   getCircumference For IShape~getCircumference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        Methods:   Constructor Importing pRadius Type F,&lt;/P&gt;&lt;P&gt;                   setRadius   Importing pRadius Type F,&lt;/P&gt;&lt;P&gt;                   getRadius   Returning Value(pRadius) Type F.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Private Section.&lt;/P&gt;&lt;P&gt;        Data radius Type F.&lt;/P&gt;&lt;P&gt;        Constants PI Type F Value '3.141592365359'.&lt;/P&gt;&lt;P&gt;EndClass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Class CCircle Implementation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Method Constructor.&lt;/P&gt;&lt;P&gt;        radius = pRadius.&lt;/P&gt;&lt;P&gt;    EndMethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Method setRadius.&lt;/P&gt;&lt;P&gt;        radius = pRadius.&lt;/P&gt;&lt;P&gt;    EndMethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Method getRadius.&lt;/P&gt;&lt;P&gt;        pRadius = radius.&lt;/P&gt;&lt;P&gt;    EndMethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Method IShape~getArea.&lt;/P&gt;&lt;P&gt;        Compute area = 2 * PI * radius.&lt;/P&gt;&lt;P&gt;    EndMethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Method IShape~getCircumference.&lt;/P&gt;&lt;P&gt;        Compute circumference = PI * radius * radius.&lt;/P&gt;&lt;P&gt;    EndMethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EndClass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;A Square Class&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Class CSquare Definition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Public Section.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        Interfaces IShape.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        Aliases:   getArea For IShape~getArea,&lt;/P&gt;&lt;P&gt;                   getCircumference For IShape~getCircumference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        Methods:   Constructor Importing pSide Type F.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Private Section.&lt;/P&gt;&lt;P&gt;        Data side Type F.&lt;/P&gt;&lt;P&gt;EndClass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Class CSquare Implementation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Method Constructor.&lt;/P&gt;&lt;P&gt;        side = pSide.&lt;/P&gt;&lt;P&gt;    EndMethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Method IShape~getArea.&lt;/P&gt;&lt;P&gt;        Compute area = side * side.&lt;/P&gt;&lt;P&gt;    EndMethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Method IShape~getCircumference.&lt;/P&gt;&lt;P&gt;        Compute circumference = 4 * side.&lt;/P&gt;&lt;P&gt;    EndMethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EndClass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;A Rectangle Class&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Class CRectangle Definition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Public Section.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        Interfaces IShape.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        Aliases:   getArea For IShape~getArea,&lt;/P&gt;&lt;P&gt;                   getCircumference For IShape~getCircumference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        Methods:   Constructor Importing pHeight Type F&lt;/P&gt;&lt;P&gt;                                         pLength Type F.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Private Section.&lt;/P&gt;&lt;P&gt;        Data: height Type F,&lt;/P&gt;&lt;P&gt;              length Type F.&lt;/P&gt;&lt;P&gt;EndClass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Class CRectangle Implementation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Method Constructor.&lt;/P&gt;&lt;P&gt;        height = pHeight.&lt;/P&gt;&lt;P&gt;        length = pLength.&lt;/P&gt;&lt;P&gt;    EndMethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Method IShape~getArea.&lt;/P&gt;&lt;P&gt;        Compute area = height * length.&lt;/P&gt;&lt;P&gt;    EndMethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Method IShape~getCircumference.&lt;/P&gt;&lt;P&gt;        Compute circumference = 2 * ( height + length ).&lt;/P&gt;&lt;P&gt;    EndMethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EndClass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;START of PROGRAM&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Array of Shapes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Data:  OneShape   Type Ref To IShape,             " One Object with &lt;/P&gt;&lt;P&gt;Shape Behaviour&lt;/P&gt;&lt;P&gt;       ShapeTable Type Table Of Ref To IShape.    " Array of Objects &lt;/P&gt;&lt;P&gt;with Shape Behaviour&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Concrete Objects with IShape Behaviour!&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Data:  C1 Type Ref To CCircle,&lt;/P&gt;&lt;P&gt;       S1 Type Ref To CSquare,&lt;/P&gt;&lt;P&gt;       R1 Type Ref To CRectangle,&lt;/P&gt;&lt;P&gt;       C2 Type Ref To CCircle,&lt;/P&gt;&lt;P&gt;       S2 Type Ref To CSquare,&lt;/P&gt;&lt;P&gt;       R2 Type Ref To CRectangle.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:  descr_ref  TYPE ref to CL_ABAP_TYPEDESCR,&lt;/P&gt;&lt;P&gt;       ClassName  Type String,&lt;/P&gt;&lt;P&gt;       Serial     Type I.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:  myArea          Type F,&lt;/P&gt;&lt;P&gt;       myCircumference Type F.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;    Create Object C1 Exporting pRadius = '2.5'.&lt;/P&gt;&lt;P&gt;    Create Object C2 Exporting pRadius = '5.0'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Create Object S1 Exporting pSide = '3.5'.&lt;/P&gt;&lt;P&gt;    Create Object S2 Exporting pSide = '6.0'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Create Object R1 Exporting pHeight = '2.8' pLength = '3.4'.&lt;/P&gt;&lt;P&gt;    Create Object R2 Exporting pHeight = '1.7' pLength = '6.3'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Append in any order!&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    Append S1  to ShapeTable.&lt;/P&gt;&lt;P&gt;    Append R2  to ShapeTable.&lt;/P&gt;&lt;P&gt;    Append R1  to ShapeTable.&lt;/P&gt;&lt;P&gt;    Append C2  to ShapeTable.&lt;/P&gt;&lt;P&gt;    Append C1  to ShapeTable.&lt;/P&gt;&lt;P&gt;    Append S2  to ShapeTable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Serial = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Loop At ShapeTable into OneShape.&lt;/P&gt;&lt;P&gt;       Call Method OneShape-&amp;gt;getArea&lt;/P&gt;&lt;P&gt;                             Receiving area = myArea.&lt;/P&gt;&lt;P&gt;       Call Method OneShape-&amp;gt;getCircumference&lt;/P&gt;&lt;P&gt;                             Receiving circumference = myCircumference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       descr_ref = CL_ABAP_TYPEDESCR=&amp;gt;Describe_By_Object_Ref( OneShape &lt;/P&gt;&lt;P&gt;).&lt;/P&gt;&lt;P&gt;       Call Method descr_ref-&amp;gt;get_relative_name&lt;/P&gt;&lt;P&gt;                   Receiving P_RELATIVE_NAME = ClassName.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       Add 1 to Serial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       Write: / Serial,  ClassName.&lt;/P&gt;&lt;P&gt;       Write: / 'Area          ',  myArea          Decimals 4 Exponent &lt;/P&gt;&lt;P&gt;0.&lt;/P&gt;&lt;P&gt;       Write: / 'Circumference ',  myCircumference Decimals 4 Exponent &lt;/P&gt;&lt;P&gt;0.&lt;/P&gt;&lt;P&gt;       Write: /.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    EndLoop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;Results    &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          1  CSQUARE                        &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Area                            12.2500    &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Circumference                   14.0000    &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          2  CRECTANGLE                     &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Area                            10.7100    &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Circumference                   16.0000    &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          3  CRECTANGLE                     &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Area                             9.5200    &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Circumference                   12.4000    &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          4  CCIRCLE                        &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Area                            31.4159    &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Circumference                   78.5398    &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          5  CCIRCLE                        &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Area                            15.7080    &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Circumference                   19.6350    &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          6  CSQUARE                        &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Area                            36.0000    &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Circumference                   24.0000&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example 1: Creating the TextEdit control&lt;/P&gt;&lt;P&gt;This is a simple example of how to implement a text edit control.&lt;/P&gt;&lt;P&gt;Steps&lt;/P&gt;&lt;P&gt;1.	Create a report &lt;/P&gt;&lt;P&gt;2.	In the start of selection event add: SET SCREEN '100'. &lt;/P&gt;&lt;P&gt;3.	Create screen 100 &lt;/P&gt;&lt;P&gt;4.	Place a custom control on the screen by choosing the custom control icon which can be recognized by the letter 'C', and give it the name MYCONTAINER1. &lt;/P&gt;&lt;P&gt;5.	To be able to exit the program, add a pushbutton with the function code EXIT. &lt;/P&gt;&lt;P&gt;6.	In the elements list enter the name OK_CODE for the element of type OK. &lt;/P&gt;&lt;P&gt;The code&lt;/P&gt;&lt;P&gt;REPORT sapmz_hf_controls1 .&lt;/P&gt;&lt;P&gt;CONSTANTS:&lt;/P&gt;&lt;P&gt;  line_length TYPE i VALUE 254.&lt;/P&gt;&lt;P&gt;DATA: ok_code LIKE sy-ucomm.&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create reference to the custom container&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  custom_container TYPE REF TO cl_gui_custom_container,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create reference to the TextEdit control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  editor TYPE REF TO cl_gui_textedit,&lt;/P&gt;&lt;P&gt;  repid LIKE sy-repid.&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  SET SCREEN '100'.&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;      MODULE USER_COMMAND_0100 INPUT                                *&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;MODULE user_command_0100 INPUT.&lt;/P&gt;&lt;P&gt;  CASE ok_code.&lt;/P&gt;&lt;P&gt;    WHEN 'EXIT'.&lt;/P&gt;&lt;P&gt;      LEAVE TO SCREEN 0.&lt;/P&gt;&lt;P&gt;  ENDCASE.&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " USER_COMMAND_0100  INPUT&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;      Module  STATUS_0100  OUTPUT&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;MODULE status_0100 OUTPUT.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The TextEdit control shoul only be initialized the first time the&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;PBO module executes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  IF editor IS INITIAL.&lt;/P&gt;&lt;P&gt;    repid = sy-repid.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Create obejct for custom container&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CREATE OBJECT custom_container&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        container_name              = 'MYCONTAINER1'&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        cntl_error                  = 1&lt;/P&gt;&lt;P&gt;        cntl_system_error           = 2&lt;/P&gt;&lt;P&gt;        create_error                = 3&lt;/P&gt;&lt;P&gt;        lifetime_error              = 4&lt;/P&gt;&lt;P&gt;        lifetime_dynpro_dynpro_link = 5&lt;/P&gt;&lt;P&gt;        others                      = 6&lt;/P&gt;&lt;P&gt;        .&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Create obejct for the TextEditor control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CREATE OBJECT editor&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;         wordwrap_mode          =&lt;/P&gt;&lt;P&gt;                cl_gui_textedit=&amp;gt;wordwrap_at_fixed_position&lt;/P&gt;&lt;P&gt;         wordwrap_position      = line_length&lt;/P&gt;&lt;P&gt;         wordwrap_to_linebreak_mode = cl_gui_textedit=&amp;gt;true&lt;/P&gt;&lt;P&gt;        parent                  = custom_container&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        error_cntl_create      = 1&lt;/P&gt;&lt;P&gt;        error_cntl_init        = 2&lt;/P&gt;&lt;P&gt;        error_cntl_link        = 3&lt;/P&gt;&lt;P&gt;        error_dp_create        = 4&lt;/P&gt;&lt;P&gt;        gui_type_not_supported = 5&lt;/P&gt;&lt;P&gt;        others                 = 6&lt;/P&gt;&lt;P&gt;        .&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " STATUS_0100  OUTPUT&lt;/P&gt;&lt;P&gt;The result&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Example 2: Event handling - Application event&lt;/P&gt;&lt;P&gt;There are 2 types of events:&lt;/P&gt;&lt;P&gt;&amp;#149;	System events. These events are triggerede irrespective of the screen flow-logic. &lt;/P&gt;&lt;P&gt;&amp;#149;	Application events. The PAI module is processed after an event. The method CL_GUI_CFW=&amp;gt;DISPATCH must be called to initiate event handling &lt;/P&gt;&lt;P&gt;In this example an application event is added to the program in example 1. New code is marked with red.&lt;/P&gt;&lt;P&gt;Steps:&lt;/P&gt;&lt;P&gt;1.	Create an input/output field on screen 100, where the event type can be output. Name it EVENT_TYPE &lt;/P&gt;&lt;P&gt;The code:&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;REPORT sapmz_hf_controls1 .&lt;/P&gt;&lt;P&gt;CONSTANTS:&lt;/P&gt;&lt;P&gt;  line_length TYPE i VALUE 254.&lt;/P&gt;&lt;P&gt;DATA: ok_code LIKE sy-ucomm.&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create reference to the custom container&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  custom_container TYPE REF TO cl_gui_custom_container,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create reference to the TextEdit control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  editor TYPE REF TO cl_gui_textedit,&lt;/P&gt;&lt;P&gt;  repid LIKE sy-repid.&lt;/P&gt;&lt;P&gt;**********************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Impmenting events&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;**********************************************************************&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;  event_type(20) TYPE c,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal table for events that should be registred&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  i_events TYPE cntl_simple_events,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Structure for oneline of the table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  wa_events TYPE cntl_simple_event.&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 lcl_event_handler 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;CLASS lcl_event_handler DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    CLASS-METHODS:&lt;/P&gt;&lt;P&gt;      catch_dblclick FOR EVENT dblclick&lt;/P&gt;&lt;P&gt;         OF cl_gui_textedit IMPORTING sender.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;CLASS lcl_event_handler IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD catch_dblclick.&lt;/P&gt;&lt;P&gt;    event_type = 'Event DBLCLICK raised'.&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;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  CLEAR wa_events. refresh i_events.&lt;/P&gt;&lt;P&gt;  SET SCREEN '100'.&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;      MODULE USER_COMMAND_0100 INPUT                                *&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;MODULE user_command_0100 INPUT.&lt;/P&gt;&lt;P&gt;  CASE ok_code.&lt;/P&gt;&lt;P&gt;    WHEN 'EXIT'.&lt;/P&gt;&lt;P&gt;      LEAVE TO SCREEN 0.&lt;/P&gt;&lt;P&gt;    WHEN OTHERS.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Call the Dispacth method to initiate application event handling&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    call method cl_gui_cfw=&amp;gt;Dispatch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDCASE.&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " USER_COMMAND_0100  INPUT&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;      Module  STATUS_0100  OUTPUT&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;MODULE status_0100 OUTPUT.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The TextEdit control shoul only be initialized the first time the&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;PBO module executes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  IF editor IS INITIAL.&lt;/P&gt;&lt;P&gt;    repid = sy-repid.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Create obejct for custom container&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CREATE OBJECT custom_container&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        container_name              = 'MYCONTAINER1'&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        cntl_error                  = 1&lt;/P&gt;&lt;P&gt;        cntl_system_error           = 2&lt;/P&gt;&lt;P&gt;        create_error                = 3&lt;/P&gt;&lt;P&gt;        lifetime_error              = 4&lt;/P&gt;&lt;P&gt;        lifetime_dynpro_dynpro_link = 5&lt;/P&gt;&lt;P&gt;        others                      = 6&lt;/P&gt;&lt;P&gt;        .&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Create obejct for the TextEditor control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CREATE OBJECT editor&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;         wordwrap_mode          =&lt;/P&gt;&lt;P&gt;                cl_gui_textedit=&amp;gt;wordwrap_at_fixed_position&lt;/P&gt;&lt;P&gt;         wordwrap_position      = line_length&lt;/P&gt;&lt;P&gt;         wordwrap_to_linebreak_mode = cl_gui_textedit=&amp;gt;true&lt;/P&gt;&lt;P&gt;        parent                  = custom_container&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        error_cntl_create      = 1&lt;/P&gt;&lt;P&gt;        error_cntl_init        = 2&lt;/P&gt;&lt;P&gt;        error_cntl_link        = 3&lt;/P&gt;&lt;P&gt;        error_dp_create        = 4&lt;/P&gt;&lt;P&gt;        gui_type_not_supported = 5&lt;/P&gt;&lt;P&gt;        others                 = 6&lt;/P&gt;&lt;P&gt;        .&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Link the event handler method to the event and the&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  TextEdit control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    SET HANDLER lcl_event_handler=&amp;gt;catch_dblclick FOR editor.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Register the event in the internal table i_events&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    wa_events-eventid = cl_gui_textedit=&amp;gt;event_double_click.&lt;/P&gt;&lt;P&gt;    wa_events-appl_event = 'X'. "This is an application event&lt;/P&gt;&lt;P&gt;    append wa_events to i_events.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Pass the table to the TextEdit control using method&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  set_registred_events&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    call method editor-&amp;gt;set_registered_events&lt;/P&gt;&lt;P&gt;       exporting events = i_events.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " STATUS_0100  OUTPUT&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;When you double click on the TextEdit control, the input/ouput field should show the text: Event DBLCLICK&lt;/P&gt;&lt;P&gt;Example 3: Event handling - System event&lt;/P&gt;&lt;P&gt;System events are passed irrespective of the flow-logic of the screen. To implement a system event change the code from example 2 as follows:&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;CLASS lcl_event_handler IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD catch_dblclick.&lt;/P&gt;&lt;P&gt;*---  event_type = 'Event DBLCLICK raised'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Reacting to the system event&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call method cl_gui_cfw=&amp;gt;set_new_ok_code&lt;/P&gt;&lt;P&gt;    exporting new_code = 'SHOW'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;MODULE user_command_0100 INPUT.&lt;/P&gt;&lt;P&gt;  CASE ok_code.&lt;/P&gt;&lt;P&gt;   code.........&lt;/P&gt;&lt;P&gt;    WHEN 'SHOW'.&lt;/P&gt;&lt;P&gt;      event_type = 'System dblclick'.&lt;/P&gt;&lt;P&gt;    WHEN OTHERS.&lt;/P&gt;&lt;P&gt;*----    call method cl_gui_cfw=&amp;gt;Dispatch.&lt;/P&gt;&lt;P&gt;  ENDCASE.&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " USER_COMMAND_0100  INPUT&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;MODULE status_0100 OUTPUT.&lt;/P&gt;&lt;P&gt; Code ................&lt;/P&gt;&lt;P&gt;*---    wa_events-appl_event = 'X'. "This is an application event&lt;/P&gt;&lt;P&gt;    wa_events-appl_event = space. "This is a system event&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " STATUS_0100  OUTPUT&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;When you double clicks on the TextEdit control nothing happens, since the flow-logic of the screen an dthe fielde transport is ignore.&lt;/P&gt;&lt;P&gt;Example 4: Calling methods of the control&lt;/P&gt;&lt;P&gt;In this exercise a function that loads the texts of an internal table into the text window, is implemented.&lt;/P&gt;&lt;P&gt;Steps:&lt;/P&gt;&lt;P&gt;Define anoterh pushbutton on the screen, that activates the method that fills the TextEdit control. Give itname PUSHBUTTON_IMPORT and function code IMP.&lt;/P&gt;&lt;P&gt;Define a form CREATE_TEXTS that carries out the text import.&lt;/P&gt;&lt;P&gt;Only changes to the code in example 2 is show.&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;MODULE user_command_0100 INPUT.&lt;/P&gt;&lt;P&gt;  CASE ok_code.&lt;/P&gt;&lt;P&gt;   code.........&lt;/P&gt;&lt;P&gt;    WHEN 'IMP'.&lt;/P&gt;&lt;P&gt;      perform load_texts. &lt;/P&gt;&lt;P&gt;  ENDCASE.&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " USER_COMMAND_0100  INPUT&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  load_texts&lt;/P&gt;&lt;P&gt;*&amp;amp;----&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;This form creates an internal table with texts. The the contents of&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;the table is instered into the TextEdit control using method&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;set_text_as_r3table&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;FORM load_texts.&lt;/P&gt;&lt;P&gt;  TYPES:&lt;/P&gt;&lt;P&gt;   BEGIN OF t_texttable,&lt;/P&gt;&lt;P&gt;     line(line_length) TYPE c,&lt;/P&gt;&lt;P&gt;   END OF t_texttable.&lt;/P&gt;&lt;P&gt;  DATA&lt;/P&gt;&lt;P&gt;    i_texttable TYPE TABLE OF t_texttable.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create internal table with texts&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  APPEND 'This a method that fills the TextEdit control' TO i_texttable.&lt;/P&gt;&lt;P&gt;  APPEND 'with a text.' TO i_texttable.&lt;/P&gt;&lt;P&gt;  DO 10 TIMES.&lt;/P&gt;&lt;P&gt;    APPEND 'hallo world !' TO i_texttable.&lt;/P&gt;&lt;P&gt;  ENDDO.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Load TextEdit control with texts&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD editor-&amp;gt;set_text_as_r3table&lt;/P&gt;&lt;P&gt;    EXPORTING table = i_texttable.&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Display an error message&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    EXIT.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;All methods that operates on controls are transferred to the frontend&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;by a RFC calls. the method FLUSH is used to determine when this is done.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD cl_gui_cfw=&amp;gt;flush.&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Display an error message&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDFORM.                    " create_texts&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Example 5: Responding to an event&lt;/P&gt;&lt;P&gt;When you double click on a text line in the TextEdit control, you want it to be prefixed with a '*'. &lt;/P&gt;&lt;P&gt;The line number of the TextEdit control that is double clicked, is retreived using method GET_SELECTION_POS. The internal text table is reloaded froim the TextEdit control with method GET_TEXT_AS_R3TABLE. The position of the double click in the TextEdit control is used to find the entry in the table, and the entry is prefixed with '*' and loaded into the TextEdit control again.&lt;/P&gt;&lt;P&gt;The program should be changed so that the internal table i_texttable is global, and a global flag g_loaded added. The load of the table should be moved to the PBO module. The changes in thje code are marked with red. The whole program now looks like this:&lt;/P&gt;&lt;P&gt;Code&lt;/P&gt;&lt;P&gt;REPORT sapmz_hf_controls1 .&lt;/P&gt;&lt;P&gt;CONSTANTS:&lt;/P&gt;&lt;P&gt;  line_length TYPE i VALUE 254.&lt;/P&gt;&lt;P&gt;DATA: ok_code LIKE sy-ucomm.&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create reference to the custom container&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  custom_container TYPE REF TO cl_gui_custom_container,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create reference to the TextEdit control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  editor TYPE REF TO cl_gui_textedit,&lt;/P&gt;&lt;P&gt;  repid LIKE sy-repid.&lt;/P&gt;&lt;P&gt;**********************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Utillity table to load texts&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;**********************************************************************&lt;/P&gt;&lt;P&gt;TYPES:&lt;/P&gt;&lt;P&gt;   BEGIN OF t_texttable,&lt;/P&gt;&lt;P&gt;     line(line_length) TYPE c,&lt;/P&gt;&lt;P&gt;   END OF t_texttable.&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;  i_texttable TYPE TABLE OF t_texttable,&lt;/P&gt;&lt;P&gt;  g_loaded(1) TYPE c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**********************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Impmenting events&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;**********************************************************************&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;  event_type(20) TYPE c,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal table for events that should be registred&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  i_events TYPE cntl_simple_events,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Structure for oneline of the table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  wa_events TYPE cntl_simple_event.&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 lcl_event_handler 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;CLASS lcl_event_handler DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    CLASS-METHODS:&lt;/P&gt;&lt;P&gt;      catch_dblclick FOR EVENT dblclick&lt;/P&gt;&lt;P&gt;         OF cl_gui_textedit IMPORTING sender.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;CLASS lcl_event_handler IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD catch_dblclick.&lt;/P&gt;&lt;P&gt;    DATA:&lt;/P&gt;&lt;P&gt;      from_line TYPE i,&lt;/P&gt;&lt;P&gt;      from_pos  TYPE i,&lt;/P&gt;&lt;P&gt;      to_line TYPE i,&lt;/P&gt;&lt;P&gt;      to_pos TYPE i,&lt;/P&gt;&lt;P&gt;      wa_texttable TYPE t_texttable.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Used for the sytem event&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call method cl_gui_cfw=&amp;gt;set_new_ok_code&lt;/P&gt;&lt;P&gt;    exporting new_code = 'SHOW'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Read the position of the double click&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL METHOD sender-&amp;gt;get_selection_pos&lt;/P&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;P&gt;         from_line = from_line&lt;/P&gt;&lt;P&gt;         from_pos  = from_pos&lt;/P&gt;&lt;P&gt;         to_line   = to_line&lt;/P&gt;&lt;P&gt;         to_pos    = to_pos.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Texts in the TextEdit control can have been changed, so&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  first reload text from the control into the internal&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  table that contains text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    IF NOT g_loaded IS INITIAL.&lt;/P&gt;&lt;P&gt;      CALL METHOD sender-&amp;gt;get_text_as_r3table&lt;/P&gt;&lt;P&gt;           IMPORTING table = i_texttable.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Read the line of the internal table that was clicked&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      READ TABLE i_texttable INDEX from_line INTO wa_texttable.&lt;/P&gt;&lt;P&gt;      IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;        EXIT.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;      IF wa_texttable+0(1) CS '*'.&lt;/P&gt;&lt;P&gt;        SHIFT wa_texttable.&lt;/P&gt;&lt;P&gt;      ELSEIF wa_texttable+0(1) NS '*'.&lt;/P&gt;&lt;P&gt;        SHIFT wa_texttable RIGHT.&lt;/P&gt;&lt;P&gt;        wa_texttable+0(1) = '*'.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;      modify i_texttable from wa_texttable index from_line.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Reload texts from h einternal table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      perform load_texts.&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;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  CLEAR wa_events.&lt;/P&gt;&lt;P&gt;  REFRESH: i_events.&lt;/P&gt;&lt;P&gt;  SET SCREEN '100'.&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;      MODULE USER_COMMAND_0100 INPUT                                *&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;MODULE user_command_0100 INPUT.&lt;/P&gt;&lt;P&gt;  CASE ok_code.&lt;/P&gt;&lt;P&gt;    WHEN 'EXIT'.&lt;/P&gt;&lt;P&gt;      LEAVE TO SCREEN 0.&lt;/P&gt;&lt;P&gt;    WHEN 'SHOW'.&lt;/P&gt;&lt;P&gt;      event_type = 'System dblclick'.&lt;/P&gt;&lt;P&gt;    WHEN 'IMP'.&lt;/P&gt;&lt;P&gt;      PERFORM Load_texts.&lt;/P&gt;&lt;P&gt;    WHEN OTHERS.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   CALL METHOD cl_gui_cfw=&amp;gt;dispatch. "Not used for system events&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDCASE.&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " USER_COMMAND_0100  INPUT&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;      Module  STATUS_0100  OUTPUT&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;MODULE status_0100 OUTPUT.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The TextEdit control shoul only be initialized the first time the&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;PBO module executes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  IF editor IS INITIAL.&lt;/P&gt;&lt;P&gt;    repid = sy-repid.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Create object for custom container&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CREATE OBJECT custom_container&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        container_name              = 'MYCONTAINER1'&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        cntl_error                  = 1&lt;/P&gt;&lt;P&gt;        cntl_system_error           = 2&lt;/P&gt;&lt;P&gt;        create_error                = 3&lt;/P&gt;&lt;P&gt;        lifetime_error              = 4&lt;/P&gt;&lt;P&gt;        lifetime_dynpro_dynpro_link = 5&lt;/P&gt;&lt;P&gt;        others                      = 6&lt;/P&gt;&lt;P&gt;        .&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Create obejct for the TextEditor control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CREATE OBJECT editor&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;         wordwrap_mode          =&lt;/P&gt;&lt;P&gt;                cl_gui_textedit=&amp;gt;wordwrap_at_fixed_position&lt;/P&gt;&lt;P&gt;         wordwrap_position      = line_length&lt;/P&gt;&lt;P&gt;         wordwrap_to_linebreak_mode = cl_gui_textedit=&amp;gt;true&lt;/P&gt;&lt;P&gt;        parent                  = custom_container&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        error_cntl_create      = 1&lt;/P&gt;&lt;P&gt;        error_cntl_init        = 2&lt;/P&gt;&lt;P&gt;        error_cntl_link        = 3&lt;/P&gt;&lt;P&gt;        error_dp_create        = 4&lt;/P&gt;&lt;P&gt;        gui_type_not_supported = 5&lt;/P&gt;&lt;P&gt;        others                 = 6&lt;/P&gt;&lt;P&gt;        .&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Link the event handler method to the event and the&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  TextEdit control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    SET HANDLER lcl_event_handler=&amp;gt;catch_dblclick FOR editor.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Register the event in the internal table i_events&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    wa_events-eventid = cl_gui_textedit=&amp;gt;event_double_click.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   wa_events-appl_event = 'X'. "This is an application event&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    wa_events-appl_event = space. "This is a system event&lt;/P&gt;&lt;P&gt;    APPEND wa_events TO i_events.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Pass the table to the TextEdit control uding method&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  set_registred_events&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL METHOD editor-&amp;gt;set_registered_events&lt;/P&gt;&lt;P&gt;       EXPORTING events = i_events.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create internal table with texts taht can be uploaded to&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;the TextEdit control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  APPEND 'This a method that fills the TextEdit control' TO i_texttable.&lt;/P&gt;&lt;P&gt;    APPEND 'with a text.' TO i_texttable.&lt;/P&gt;&lt;P&gt;    DO 10 TIMES.&lt;/P&gt;&lt;P&gt;      APPEND 'hallo world !' TO i_texttable.&lt;/P&gt;&lt;P&gt;    ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " STATUS_0100  OUTPUT&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form Load_texts&lt;/P&gt;&lt;P&gt;*&amp;amp;----&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;This form loads the lines of the internal table i_texttable into&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;the TextEdit control&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;FORM Load_texts.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Load TextEdit control with texts&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD editor-&amp;gt;set_text_as_r3table&lt;/P&gt;&lt;P&gt;    EXPORTING table = i_texttable.&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Display an error message&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    EXIT.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;All methods that operates on controls are transferred to the frontend&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;by a RFC calls. the method FLUSH is used to determine when this is&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;done.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD cl_gui_cfw=&amp;gt;flush.&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Display an error message&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;  g_loaded = 'X'.&lt;/P&gt;&lt;P&gt;ENDFORM.                    " create_texts&lt;/P&gt;&lt;P&gt;Example 6: Protect a line in the TextEdit control and the importance of FLUSH&lt;/P&gt;&lt;P&gt;All methods that operates on controls are transfered to the fronend by RFC calls. The FLUSH method is used to synchronize control execution and the frontend. This is very important when working e.g. with export parameters from a method, as the parmeters will not be correct before the FLUSH method has been called.&lt;/P&gt;&lt;P&gt;The example below portects selected lines in the TextEdit and uses FLUSH to ensure that the correct parameters are returned from method GET_SELECTION_POS. &lt;/P&gt;&lt;P&gt;Note: Instead of using method PROTECT_LINES, the method PROTECT_SELECTION could be used. This method does not need line numbers or a FLUSH statement&lt;/P&gt;&lt;P&gt;Steps&lt;/P&gt;&lt;P&gt;&amp;#149;	Add a new pushbutton to the screen with the function code PROTECT. &lt;/P&gt;&lt;P&gt;Code&lt;/P&gt;&lt;P&gt;Add the following code to the example:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Global variables&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;   from_idx TYPE i,&lt;/P&gt;&lt;P&gt;   to_idx TYPE i,&lt;/P&gt;&lt;P&gt;   index TYPE i.&lt;/P&gt;&lt;P&gt;MODULE user_command_0100 INPUT.&lt;/P&gt;&lt;P&gt;  CASE ok_code.&lt;/P&gt;&lt;P&gt;    code.......................&lt;/P&gt;&lt;P&gt;    WHEN 'PROTECT'.&lt;/P&gt;&lt;P&gt;      PERFORM protect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.    .......................&lt;/P&gt;&lt;P&gt;  ENDCASE.&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  protect&lt;/P&gt;&lt;P&gt;*&amp;amp;----&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;Protects marked lines in a TextEdit control&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;FORM protect.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Determine the area selected by the user&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD editor-&amp;gt;get_selection_pos&lt;/P&gt;&lt;P&gt;     IMPORTING&lt;/P&gt;&lt;P&gt;       from_line = from_idx&lt;/P&gt;&lt;P&gt;       to_line   = to_idx&lt;/P&gt;&lt;P&gt;     EXCEPTIONS&lt;/P&gt;&lt;P&gt;       error_cntl_call_method = 1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Synchronize execution in the control with the ABAP program.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Without this synchronization the variables from_idx and&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;to_idx will have obsolutete values (The initial value for&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;both, are 0)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD cl_gui_cfw=&amp;gt;flush.&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Errormessage: Error in flush&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Protect the selected lines&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  IF to_idx &amp;gt; from_idx.&lt;/P&gt;&lt;P&gt;    to_idx = to_idx - 1.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;  CALL METHOD editor-&amp;gt;protect_lines&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      from_line = from_idx&lt;/P&gt;&lt;P&gt;      to_line   = to_idx.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The PROTECT_SELECTION method could be used instead, eliminating the&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;need of line numbers and the last FLUSH&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;call method editor-&amp;gt;protect_selection.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Flush again to protect immidiately&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD cl_gui_cfw=&amp;gt;flush.&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Errormessage: Error in flush&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " protect&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Example 7: Using multiple controls&lt;/P&gt;&lt;P&gt;In this example a second TextEdit control will be added to the screen. The new TextEdit control will be designed to act as a clipboard for short texts.&lt;/P&gt;&lt;P&gt;Steps:&lt;/P&gt;&lt;P&gt;&amp;#149;	Add a new container to the screen and name it MYCONTAINER2. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;Insert global datadeclaration:&lt;/P&gt;&lt;P&gt;**********************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Implementing a second Scratch TextEdit control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;**********************************************************************&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;  scratch            TYPE REF TO cl_gui_textedit,&lt;/P&gt;&lt;P&gt;  custom_container2  TYPE REF TO cl_gui_custom_container.&lt;/P&gt;&lt;P&gt;Insert the following code in the PBO module:&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The SCRATCH TextEdit control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------------------------------" /&gt;&lt;P&gt;  IF scratch IS INITIAL.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Create obejct for custom container2&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CREATE OBJECT custom_container2&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        container_name              = 'MYCONTAINER2'&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        cntl_error                  = 1&lt;/P&gt;&lt;P&gt;        cntl_system_error           = 2&lt;/P&gt;&lt;P&gt;        create_error                = 3&lt;/P&gt;&lt;P&gt;        lifetime_error              = 4&lt;/P&gt;&lt;P&gt;        lifetime_dynpro_dynpro_link = 5&lt;/P&gt;&lt;P&gt;        others                      = 6&lt;/P&gt;&lt;P&gt;        .&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Create obejct for the SCRATCH TextEditor control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CREATE OBJECT scratch&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;         parent         = custom_container2&lt;/P&gt;&lt;P&gt;         wordwrap_mode  =&lt;/P&gt;&lt;P&gt;                cl_gui_textedit=&amp;gt;wordwrap_at_windowborder&lt;/P&gt;&lt;P&gt;        wordwrap_to_linebreak_mode = cl_gui_textedit=&amp;gt;true.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Remove the staus bar&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL METHOD scratch-&amp;gt;set_statusbar_mode&lt;/P&gt;&lt;P&gt;      EXPORTING statusbar_mode = cl_gui_textedit=&amp;gt;false.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;1  REPORT sapmz_hf_controls1 .&lt;/P&gt;&lt;P&gt;      2 &lt;/P&gt;&lt;P&gt;      3  CONSTANTS:&lt;/P&gt;&lt;P&gt;      4    line_length TYPE i VALUE 254.&lt;/P&gt;&lt;P&gt;      5 &lt;/P&gt;&lt;P&gt;      6  DATA: ok_code LIKE sy-ucomm.&lt;/P&gt;&lt;P&gt;      7 &lt;/P&gt;&lt;P&gt;      8  DATA:&lt;/P&gt;&lt;P&gt;      9  * Create reference to the custom container&lt;/P&gt;&lt;P&gt;     10    custom_container TYPE REF TO cl_gui_custom_container,&lt;/P&gt;&lt;P&gt;     11  * Create reference to the TextEdit control&lt;/P&gt;&lt;P&gt;     12    editor TYPE REF TO cl_gui_textedit,&lt;/P&gt;&lt;P&gt;     13    repid LIKE sy-repid.&lt;/P&gt;&lt;P&gt;     14 &lt;/P&gt;&lt;P&gt;     15  **********************************************************************&lt;/P&gt;&lt;P&gt;     16  * Utillity table to load texts&lt;/P&gt;&lt;P&gt;     17  **********************************************************************&lt;/P&gt;&lt;P&gt;     18  TYPES:&lt;/P&gt;&lt;P&gt;     19     BEGIN OF t_texttable,&lt;/P&gt;&lt;P&gt;     20       line(line_length) TYPE c,&lt;/P&gt;&lt;P&gt;     21     END OF t_texttable.&lt;/P&gt;&lt;P&gt;     22 &lt;/P&gt;&lt;P&gt;     23  DATA:&lt;/P&gt;&lt;P&gt;     24    i_texttable TYPE TABLE OF t_texttable,&lt;/P&gt;&lt;P&gt;     25    wa_texttable TYPE t_texttable,&lt;/P&gt;&lt;P&gt;     26    g_loaded(1) TYPE c.&lt;/P&gt;&lt;P&gt;     27 &lt;/P&gt;&lt;P&gt;     28  **********************************************************************&lt;/P&gt;&lt;P&gt;     29  * Data for the protection example&lt;/P&gt;&lt;P&gt;     30  **********************************************************************&lt;/P&gt;&lt;P&gt;     31  DATA:&lt;/P&gt;&lt;P&gt;     32    from_idx TYPE i,&lt;/P&gt;&lt;P&gt;     33    to_idx   TYPE i,&lt;/P&gt;&lt;P&gt;     34    index    TYPE i.&lt;/P&gt;&lt;P&gt;     35 &lt;/P&gt;&lt;P&gt;     36  **********************************************************************&lt;/P&gt;&lt;P&gt;     37  * Implementing a second Scratch TextEdit control&lt;/P&gt;&lt;P&gt;     38  **********************************************************************&lt;/P&gt;&lt;P&gt;     39  DATA:&lt;/P&gt;&lt;P&gt;     40    scratch            TYPE REF TO cl_gui_textedit,&lt;/P&gt;&lt;P&gt;     41    custom_container2  TYPE REF TO cl_gui_custom_container.&lt;/P&gt;&lt;P&gt;     42 &lt;/P&gt;&lt;P&gt;     43 &lt;/P&gt;&lt;P&gt;     44  **********************************************************************&lt;/P&gt;&lt;P&gt;     45  * Implementing events&lt;/P&gt;&lt;P&gt;     46  **********************************************************************&lt;/P&gt;&lt;P&gt;     47  DATA:&lt;/P&gt;&lt;P&gt;     48    event_type(20) TYPE c,&lt;/P&gt;&lt;P&gt;     49  * Internal table for events that should be registred&lt;/P&gt;&lt;P&gt;     50    i_events TYPE cntl_simple_events,&lt;/P&gt;&lt;P&gt;     51  * Structure for oneline of the table&lt;/P&gt;&lt;P&gt;     52    wa_events TYPE cntl_simple_event.&lt;/P&gt;&lt;P&gt;     53 &lt;/P&gt;&lt;P&gt;     54  *----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;     55  *       CLASS lcl_event_handler DEFINITION&lt;/P&gt;&lt;P&gt;     56  *----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;     57  *       ........                                                      *&lt;/P&gt;&lt;P&gt;     58  *----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;     59  CLASS lcl_event_handler DEFINITION.&lt;/P&gt;&lt;P&gt;     60    PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;     61      CLASS-METHODS:&lt;/P&gt;&lt;P&gt;     62        catch_dblclick FOR EVENT dblclick&lt;/P&gt;&lt;P&gt;     63           OF cl_gui_textedit IMPORTING sender.&lt;/P&gt;&lt;P&gt;     64 &lt;/P&gt;&lt;P&gt;     65  ENDCLASS.&lt;/P&gt;&lt;P&gt;     66 &lt;/P&gt;&lt;P&gt;     67  *----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;     68  *       CLASS lcl_event_handler IMPLEMENTATION&lt;/P&gt;&lt;P&gt;     69  *----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;     70  *       ........                                                      *&lt;/P&gt;&lt;P&gt;     71  *----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;     72  CLASS lcl_event_handler IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;     73    METHOD catch_dblclick.&lt;/P&gt;&lt;P&gt;     74      DATA:&lt;/P&gt;&lt;P&gt;     75        from_line TYPE i,&lt;/P&gt;&lt;P&gt;     76        from_pos  TYPE i,&lt;/P&gt;&lt;P&gt;     77        to_line TYPE i,&lt;/P&gt;&lt;P&gt;     78        to_pos TYPE i.&lt;/P&gt;&lt;P&gt;     79 &lt;/P&gt;&lt;P&gt;     80 &lt;/P&gt;&lt;P&gt;     81  * Used for the sytem event&lt;/P&gt;&lt;P&gt;     82      CALL METHOD cl_gui_cfw=&amp;gt;set_new_ok_code&lt;/P&gt;&lt;P&gt;     83        EXPORTING new_code = 'SHOW'.&lt;/P&gt;&lt;P&gt;     84 &lt;/P&gt;&lt;P&gt;     85 &lt;/P&gt;&lt;P&gt;     86  * Read the position of the double click&lt;/P&gt;&lt;P&gt;     87      CALL METHOD sender-&amp;gt;get_selection_pos&lt;/P&gt;&lt;P&gt;     88        IMPORTING&lt;/P&gt;&lt;P&gt;     89           from_line = from_line&lt;/P&gt;&lt;P&gt;     90           from_pos  = from_pos&lt;/P&gt;&lt;P&gt;     91           to_line   = to_line&lt;/P&gt;&lt;P&gt;     92           to_pos    = to_pos.&lt;/P&gt;&lt;P&gt;     93 &lt;/P&gt;&lt;P&gt;     94  *   Texts in the TextEdit control can have been changed, so&lt;/P&gt;&lt;P&gt;     95  *   first reload text from the control into the internal&lt;/P&gt;&lt;P&gt;     96  *   table that contains text&lt;/P&gt;&lt;P&gt;     97      IF NOT g_loaded IS INITIAL.&lt;/P&gt;&lt;P&gt;     98        CALL METHOD sender-&amp;gt;get_text_as_r3table&lt;/P&gt;&lt;P&gt;     99             IMPORTING table = i_texttable.&lt;/P&gt;&lt;P&gt;    100  *   Read the line of the internal table that was clicked&lt;/P&gt;&lt;P&gt;    101        READ TABLE i_texttable INDEX from_line INTO wa_texttable.&lt;/P&gt;&lt;P&gt;    102        IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    103          EXIT.&lt;/P&gt;&lt;P&gt;    104        ENDIF.&lt;/P&gt;&lt;P&gt;    105 &lt;/P&gt;&lt;P&gt;    106        IF wa_texttable+0(1) CS '*'.&lt;/P&gt;&lt;P&gt;    107          SHIFT wa_texttable.&lt;/P&gt;&lt;P&gt;    108        ELSEIF wa_texttable+0(1) NS '*'.&lt;/P&gt;&lt;P&gt;    109          SHIFT wa_texttable RIGHT.&lt;/P&gt;&lt;P&gt;    110          wa_texttable+0(1) = '*'.&lt;/P&gt;&lt;P&gt;    111        ENDIF.&lt;/P&gt;&lt;P&gt;    112        MODIFY i_texttable FROM wa_texttable INDEX from_line.&lt;/P&gt;&lt;P&gt;    113  *     Reload texts from h einternal table&lt;/P&gt;&lt;P&gt;    114        PERFORM load_texts.&lt;/P&gt;&lt;P&gt;    115 &lt;/P&gt;&lt;P&gt;    116 &lt;/P&gt;&lt;P&gt;    117      ENDIF.&lt;/P&gt;&lt;P&gt;    118 &lt;/P&gt;&lt;P&gt;    119 &lt;/P&gt;&lt;P&gt;    120    ENDMETHOD.&lt;/P&gt;&lt;P&gt;    121  ENDCLASS.&lt;/P&gt;&lt;P&gt;    122 &lt;/P&gt;&lt;P&gt;    123 &lt;/P&gt;&lt;P&gt;    124 &lt;/P&gt;&lt;P&gt;    125  START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;    126    CLEAR wa_events.&lt;/P&gt;&lt;P&gt;    127    REFRESH: i_events.&lt;/P&gt;&lt;P&gt;    128 &lt;/P&gt;&lt;P&gt;    129    SET SCREEN '100'.&lt;/P&gt;&lt;P&gt;    130 &lt;/P&gt;&lt;P&gt;    131 &lt;/P&gt;&lt;P&gt;    132 &lt;/P&gt;&lt;P&gt;    133  *----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;    134  *       MODULE USER_COMMAND_0100 INPUT                                *&lt;/P&gt;&lt;P&gt;    135  *----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;    136  MODULE user_command_0100 INPUT.&lt;/P&gt;&lt;P&gt;    137 &lt;/P&gt;&lt;P&gt;    138    CASE ok_code.&lt;/P&gt;&lt;P&gt;    139      WHEN 'EXIT'.&lt;/P&gt;&lt;P&gt;    140        LEAVE TO SCREEN 0.&lt;/P&gt;&lt;P&gt;    141      WHEN 'SHOW'.&lt;/P&gt;&lt;P&gt;    142        event_type = 'System dblclick'.&lt;/P&gt;&lt;P&gt;    143      WHEN 'IMP'.&lt;/P&gt;&lt;P&gt;    144        PERFORM load_texts.&lt;/P&gt;&lt;P&gt;    145      WHEN 'PROTECT'.&lt;/P&gt;&lt;P&gt;    146        PERFORM protect.&lt;/P&gt;&lt;P&gt;    147 &lt;/P&gt;&lt;P&gt;    148      WHEN OTHERS.&lt;/P&gt;&lt;P&gt;    149  *    CALL METHOD cl_gui_cfw=&amp;gt;dispatch. "Not used for system events&lt;/P&gt;&lt;P&gt;    150    ENDCASE.&lt;/P&gt;&lt;P&gt;    151 &lt;/P&gt;&lt;P&gt;    152 &lt;/P&gt;&lt;P&gt;    153  ENDMODULE.                 " USER_COMMAND_0100  INPUT&lt;/P&gt;&lt;P&gt;    154  *&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;    155  *&amp;amp;      Module  STATUS_0100  OUTPUT&lt;/P&gt;&lt;P&gt;    156  *&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;    157  MODULE status_0100 OUTPUT.&lt;/P&gt;&lt;P&gt;    158  * The TextEdit control shoul only be initialized the first time the&lt;/P&gt;&lt;P&gt;    159  * PBO module executes&lt;/P&gt;&lt;P&gt;    160    IF editor IS INITIAL.&lt;/P&gt;&lt;P&gt;    161      repid = sy-repid.&lt;/P&gt;&lt;P&gt;    162  *   Create obejct for custom container&lt;/P&gt;&lt;P&gt;    163      CREATE OBJECT custom_container&lt;/P&gt;&lt;P&gt;    164        EXPORTING&lt;/P&gt;&lt;P&gt;    165          container_name              = 'MYCONTAINER1'&lt;/P&gt;&lt;P&gt;    166        EXCEPTIONS&lt;/P&gt;&lt;P&gt;    167          cntl_error                  = 1&lt;/P&gt;&lt;P&gt;    168          cntl_system_error           = 2&lt;/P&gt;&lt;P&gt;    169          create_error                = 3&lt;/P&gt;&lt;P&gt;    170          lifetime_error              = 4&lt;/P&gt;&lt;P&gt;    171          lifetime_dynpro_dynpro_link = 5&lt;/P&gt;&lt;P&gt;    172          others                      = 6&lt;/P&gt;&lt;P&gt;    173          .&lt;/P&gt;&lt;P&gt;    174      IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    175        MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;    176                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;    177      ENDIF.&lt;/P&gt;&lt;P&gt;    178 &lt;/P&gt;&lt;P&gt;    179  *   Create obejct for the TextEditor control&lt;/P&gt;&lt;P&gt;    180      CREATE OBJECT editor&lt;/P&gt;&lt;P&gt;    181        EXPORTING&lt;/P&gt;&lt;P&gt;    182 &lt;/P&gt;&lt;P&gt;    183           wordwrap_mode          =&lt;/P&gt;&lt;P&gt;    184                  cl_gui_textedit=&amp;gt;wordwrap_at_fixed_position&lt;/P&gt;&lt;P&gt;    185           wordwrap_position      = line_length&lt;/P&gt;&lt;P&gt;    186           wordwrap_to_linebreak_mode = cl_gui_textedit=&amp;gt;true&lt;/P&gt;&lt;P&gt;    187          parent                  = custom_container&lt;/P&gt;&lt;P&gt;    188        EXCEPTIONS&lt;/P&gt;&lt;P&gt;    189          error_cntl_create      = 1&lt;/P&gt;&lt;P&gt;    190          error_cntl_init        = 2&lt;/P&gt;&lt;P&gt;    191          error_cntl_link        = 3&lt;/P&gt;&lt;P&gt;    192          error_dp_create        = 4&lt;/P&gt;&lt;P&gt;    193          gui_type_not_supported = 5&lt;/P&gt;&lt;P&gt;    194          others                 = 6&lt;/P&gt;&lt;P&gt;    195          .&lt;/P&gt;&lt;P&gt;    196      IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    197        MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;    198                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;    199      ENDIF.&lt;/P&gt;&lt;P&gt;    200 &lt;/P&gt;&lt;P&gt;    201  *   Link the event handler method to the event and the&lt;/P&gt;&lt;P&gt;    202  *   TextEdit control&lt;/P&gt;&lt;P&gt;    203      SET HANDLER lcl_event_handler=&amp;gt;catch_dblclick FOR editor.&lt;/P&gt;&lt;P&gt;    204 &lt;/P&gt;&lt;P&gt;    205  *   Register the event in the internal table i_events&lt;/P&gt;&lt;P&gt;    206      wa_events-eventid = cl_gui_textedit=&amp;gt;event_double_click.&lt;/P&gt;&lt;P&gt;    207 &lt;/P&gt;&lt;P&gt;    208  *    wa_events-appl_event = 'X'. "This is an application event&lt;/P&gt;&lt;P&gt;    209      wa_events-appl_event = space. "This is a system event&lt;/P&gt;&lt;P&gt;    210 &lt;/P&gt;&lt;P&gt;    211 &lt;/P&gt;&lt;P&gt;    212      APPEND wa_events TO i_events.&lt;/P&gt;&lt;P&gt;    213  *   Pass the table to the TextEdit control uding method&lt;/P&gt;&lt;P&gt;    214  *   set_registred_events&lt;/P&gt;&lt;P&gt;    215      CALL METHOD editor-&amp;gt;set_registered_events&lt;/P&gt;&lt;P&gt;    216         EXPORTING events = i_events.&lt;/P&gt;&lt;P&gt;    217 &lt;/P&gt;&lt;P&gt;    218  * Create internal table with texts taht can be uploaded to&lt;/P&gt;&lt;P&gt;    219  * the TextEdit control&lt;/P&gt;&lt;P&gt;    220    APPEND 'This a method that fills the TextEdit control' TO i_texttable.&lt;/P&gt;&lt;P&gt;    221      APPEND 'with a text.' TO i_texttable.&lt;/P&gt;&lt;P&gt;    222      DO 10 TIMES.&lt;/P&gt;&lt;P&gt;    223        APPEND 'hallo world !' TO i_texttable.&lt;/P&gt;&lt;P&gt;    224      ENDDO.&lt;/P&gt;&lt;P&gt;    225    ENDIF.&lt;/P&gt;&lt;P&gt;    226 &lt;/P&gt;&lt;P&gt;    227  *----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------------------------------" /&gt;&lt;P&gt;    228  * The SCRATCH TextEdit control&lt;/P&gt;&lt;P&gt;    229  *----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------------------------------" /&gt;&lt;P&gt;    230    IF scratch IS INITIAL.&lt;/P&gt;&lt;P&gt;    231  *   Create obejct for custom container2&lt;/P&gt;&lt;P&gt;    232      CREATE OBJECT custom_container2&lt;/P&gt;&lt;P&gt;    233        EXPORTING&lt;/P&gt;&lt;P&gt;    234          container_name              = 'MYCONTAINER2'&lt;/P&gt;&lt;P&gt;    235        EXCEPTIONS&lt;/P&gt;&lt;P&gt;    236          cntl_error                  = 1&lt;/P&gt;&lt;P&gt;    237          cntl_system_error           = 2&lt;/P&gt;&lt;P&gt;    238          create_error                = 3&lt;/P&gt;&lt;P&gt;    239          lifetime_error              = 4&lt;/P&gt;&lt;P&gt;    240          lifetime_dynpro_dynpro_link = 5&lt;/P&gt;&lt;P&gt;    241          others                      = 6&lt;/P&gt;&lt;P&gt;    242          .&lt;/P&gt;&lt;P&gt;    243      IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    244        MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;    245                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;    246      ENDIF.&lt;/P&gt;&lt;P&gt;    247 &lt;/P&gt;&lt;P&gt;    248  *   Create obejct for the SCRATCH TextEditor control&lt;/P&gt;&lt;P&gt;    249      CREATE OBJECT scratch&lt;/P&gt;&lt;P&gt;    250        EXPORTING&lt;/P&gt;&lt;P&gt;    251           parent         = custom_container2&lt;/P&gt;&lt;P&gt;    252           wordwrap_mode  =&lt;/P&gt;&lt;P&gt;    253                  cl_gui_textedit=&amp;gt;wordwrap_at_windowborder&lt;/P&gt;&lt;P&gt;    254          wordwrap_to_linebreak_mode = cl_gui_textedit=&amp;gt;true.&lt;/P&gt;&lt;P&gt;    255 &lt;/P&gt;&lt;P&gt;    256  *   Remove the staus bar&lt;/P&gt;&lt;P&gt;    257      CALL METHOD scratch-&amp;gt;set_statusbar_mode&lt;/P&gt;&lt;P&gt;    258        EXPORTING statusbar_mode = cl_gui_textedit=&amp;gt;false.&lt;/P&gt;&lt;P&gt;    259 &lt;/P&gt;&lt;P&gt;    260    ENDIF.&lt;/P&gt;&lt;P&gt;    261 &lt;/P&gt;&lt;P&gt;    262 &lt;/P&gt;&lt;P&gt;    263  ENDMODULE.                 " STATUS_0100  OUTPUT&lt;/P&gt;&lt;P&gt;    264 &lt;/P&gt;&lt;P&gt;    265  *&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;    266  *&amp;amp;      Form Load_texts&lt;/P&gt;&lt;P&gt;    267  *&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;    268  * This form loads the lines of the internal table i_texttable into&lt;/P&gt;&lt;P&gt;    269  * the TextEdit control&lt;/P&gt;&lt;P&gt;    270  *----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;    271  FORM load_texts.&lt;/P&gt;&lt;P&gt;    272 &lt;/P&gt;&lt;P&gt;    273  * Load TextEdit control with texts&lt;/P&gt;&lt;P&gt;    274    CALL METHOD editor-&amp;gt;set_text_as_r3table&lt;/P&gt;&lt;P&gt;    275      EXPORTING table = i_texttable.&lt;/P&gt;&lt;P&gt;    276    IF sy-subrc &amp;gt; 0.&lt;/P&gt;&lt;P&gt;    277  *   Display an error message&lt;/P&gt;&lt;P&gt;    278      EXIT.&lt;/P&gt;&lt;P&gt;    279    ENDIF.&lt;/P&gt;&lt;P&gt;    280 &lt;/P&gt;&lt;P&gt;    281  * All methods that operates on controls are transferred to the frontend&lt;/P&gt;&lt;P&gt;    282  * by a RFC calls. the method FLUSH is used to determine when this is&lt;/P&gt;&lt;P&gt;    283  * done.&lt;/P&gt;&lt;P&gt;    284    CALL METHOD cl_gui_cfw=&amp;gt;flush.&lt;/P&gt;&lt;P&gt;    285    IF sy-subrc &amp;gt; 0.&lt;/P&gt;&lt;P&gt;    286  *   Display an error message&lt;/P&gt;&lt;P&gt;    287    ENDIF.&lt;/P&gt;&lt;P&gt;    288    g_loaded = 'X'.&lt;/P&gt;&lt;P&gt;    289  ENDFORM.                    " create_texts&lt;/P&gt;&lt;P&gt;    290  *&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;    291  *&amp;amp;      Form  protect&lt;/P&gt;&lt;P&gt;    292  *&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;    293  * Protects marked lines in a TextEdit control&lt;/P&gt;&lt;P&gt;    294  *----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;    295  FORM protect.&lt;/P&gt;&lt;P&gt;    296  * Determine the area selected by the user&lt;/P&gt;&lt;P&gt;    297    CALL METHOD editor-&amp;gt;get_selection_pos&lt;/P&gt;&lt;P&gt;    298       IMPORTING&lt;/P&gt;&lt;P&gt;    299         from_line = from_idx&lt;/P&gt;&lt;P&gt;    300         to_line   = to_idx&lt;/P&gt;&lt;P&gt;    301       EXCEPTIONS&lt;/P&gt;&lt;P&gt;    302         error_cntl_call_method = 1.&lt;/P&gt;&lt;P&gt;    303 &lt;/P&gt;&lt;P&gt;    304  * Synchronize execution in the control with the ABAP program.&lt;/P&gt;&lt;P&gt;    305  * Without this synchronization the variables from_idx and&lt;/P&gt;&lt;P&gt;    306  * to_idx will have obsolutete values (The initial value for&lt;/P&gt;&lt;P&gt;    307  * both, are 0)&lt;/P&gt;&lt;P&gt;    308    CALL METHOD cl_gui_cfw=&amp;gt;flush.&lt;/P&gt;&lt;P&gt;    309    IF sy-subrc &amp;gt; 0.&lt;/P&gt;&lt;P&gt;    310  * Errormessage: Error in flush&lt;/P&gt;&lt;P&gt;    311    ENDIF.&lt;/P&gt;&lt;P&gt;    312 &lt;/P&gt;&lt;P&gt;    313  * Protect the lines selected&lt;/P&gt;&lt;P&gt;    314    IF to_idx &amp;gt; from_idx.&lt;/P&gt;&lt;P&gt;    315      to_idx = to_idx - 1.&lt;/P&gt;&lt;P&gt;    316    ENDIF.&lt;/P&gt;&lt;P&gt;    317    CALL METHOD editor-&amp;gt;protect_lines&lt;/P&gt;&lt;P&gt;    318      EXPORTING&lt;/P&gt;&lt;P&gt;    319        from_line = from_idx&lt;/P&gt;&lt;P&gt;    320        to_line   = to_idx.&lt;/P&gt;&lt;P&gt;    321 &lt;/P&gt;&lt;P&gt;    322 &lt;/P&gt;&lt;P&gt;    323  * The PROTECT_SELECTION method could be used instead, eliminating the&lt;/P&gt;&lt;P&gt;    324  * need of line numbers and the last FLUSH&lt;/P&gt;&lt;P&gt;    325 &lt;/P&gt;&lt;P&gt;    326  * call method editor-&amp;gt;protect_selection.&lt;/P&gt;&lt;P&gt;    327 &lt;/P&gt;&lt;P&gt;    328 &lt;/P&gt;&lt;P&gt;    329  * Flush again to protect immidately&lt;/P&gt;&lt;P&gt;    330    CALL METHOD cl_gui_cfw=&amp;gt;flush.&lt;/P&gt;&lt;P&gt;    331    IF sy-subrc &amp;gt; 0.&lt;/P&gt;&lt;P&gt;    332  * Errormessage: Error in flush&lt;/P&gt;&lt;P&gt;    333    ENDIF.&lt;/P&gt;&lt;P&gt;    334 &lt;/P&gt;&lt;P&gt;    335 &lt;/P&gt;&lt;P&gt;    336 &lt;/P&gt;&lt;P&gt;    337  ENDFORM.                    " protect&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Mar 2007 11:51:45 GMT</pubDate>
    <dc:creator>ChandrashekharMahajan</dc:creator>
    <dc:date>2007-03-22T11:51:45Z</dc:date>
    <item>
      <title>object oriented abap</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/object-oriented-abap/m-p/2043995#M420594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello abapers,&lt;/P&gt;&lt;P&gt;am new to object oriented abap.cud u pls help me out in explaining me object oriented abap with examples.cud u also pls send me some links related to OO ABAP..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;explanation wid suitable examples will b rewarded higher pints.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;praveen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2007 11:43:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/object-oriented-abap/m-p/2043995#M420594</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-22T11:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: object oriented abap</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/object-oriented-abap/m-p/2043996#M420595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Praveen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check this online document (starting page 1291).&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf" target="test_blank"&gt;http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also check this links as well.&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw2004s/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/OO/" target="test_blank"&gt;http://www.sapgenie.com/abap/OO/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.futureobjects.de/content/intro_oo_e.html" target="test_blank"&gt;http://www.futureobjects.de/content/intro_oo_e.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/business-add-in-you-need-to-understand-abap-oo-interface-concept.htm" target="test_blank"&gt;http://www.sap-img.com/abap/business-add-in-you-need-to-understand-abap-oo-interface-concept.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;/people/ravikumar.allampallam/blog/2005/02/11/abap-oo-in-action&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check the below links lot of info and examples r there&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/OO/index.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/OO/index.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.geocities.com/victorav15/sapr3/abap_ood.html" target="test_blank"&gt;http://www.geocities.com/victorav15/sapr3/abap_ood.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.brabandt.de/html/abap_oo.html" target="test_blank"&gt;http://www.brabandt.de/html/abap_oo.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this cool weblog:&lt;/P&gt;&lt;P&gt;/people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql&lt;/P&gt;&lt;P&gt;/people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b6254f411d194a60000e8353423/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b6254f411d194a60000e8353423/frameset.htm&lt;/A&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;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/OO/" target="test_blank"&gt;http://www.sapgenie.com/abap/OO/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/OO/index.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/OO/index.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt" target="test_blank"&gt;http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf" target="test_blank"&gt;http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt" target="test_blank"&gt;http://www.esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.allsaplinks.com/" target="test_blank"&gt;http://www.allsaplinks.com/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/" target="test_blank"&gt;http://www.sap-img.com/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/" target="test_blank"&gt;http://www.sapgenie.com/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com" target="test_blank"&gt;http://help.sap.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/OO/" target="test_blank"&gt;http://www.sapgenie.com/abap/OO/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/OO/index.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/OO/index.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/controls/index.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/controls/index.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf" target="test_blank"&gt;http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf" target="test_blank"&gt;http://www.esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/OO/index.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/OO/index.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/OO/" target="test_blank"&gt;http://www.sapgenie.com/abap/OO/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;these links &lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/ce/b518b6513611d194a50000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/ce/b518b6513611d194a50000e8353423/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For funtion module to class&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5954f411d194a60000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5954f411d194a60000e8353423/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for classes&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5c54f411d194a60000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5c54f411d194a60000e8353423/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for methods&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for inheritance&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for interfaces&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b6254f411d194a60000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b6254f411d194a60000e8353423/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this resolves your query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward all the helpful answers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2007 11:45:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/object-oriented-abap/m-p/2043996#M420595</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-22T11:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: object oriented abap</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/object-oriented-abap/m-p/2043997#M420596</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;please find the below material with examples,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward points if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Public attributes&lt;/P&gt;&lt;P&gt;Public attributes are defined in the PUBLIC section and can be viewed and changed from outside the class. There is direct access to public attributes. As a general rule, as few public attributes should be defined as possible.&lt;/P&gt;&lt;P&gt;PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;  DATA: Counter type i.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Private attributes&lt;/P&gt;&lt;P&gt;Private attributes are defined in the PRIVATE section. The can only be viewes and changed from within the class. There is no direct access from outside the class.&lt;/P&gt;&lt;P&gt;PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    DATA: name(25) TYPE c,&lt;/P&gt;&lt;P&gt;          planetype LIKE saplane-planetyp,&lt;/P&gt;&lt;P&gt;Instance attributes&lt;/P&gt;&lt;P&gt;There exist one instance attribute for each instance of the class, thus they exist seperately for each object. Instance attributes are declared with the DATA keyword.&lt;/P&gt;&lt;P&gt;Static attributes&lt;/P&gt;&lt;P&gt;Static attributes exist only once for each class. The data are the same for all instances of the class, and can be used e.g. for instance counters. Static attributes are defined with the keyword CLASS-DATA.&lt;/P&gt;&lt;P&gt;PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;  CLASS-DATA: counter type i,   &lt;/P&gt;&lt;P&gt;Public methods&lt;/P&gt;&lt;P&gt;Can called from outside the class&lt;/P&gt;&lt;P&gt;PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;  METHODS:  set_attributes IMPORTING p_name(25) TYPE c,&lt;/P&gt;&lt;P&gt;                                                            p_planetype LIKE saplane-planetyp,&lt;/P&gt;&lt;P&gt;Private methods&lt;/P&gt;&lt;P&gt;Can only be called from inside the class. They are placed in the PRIVATE section of the class.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Constructor method&lt;/P&gt;&lt;P&gt;Implicitly, each class has an instance constructor method with the reserved name constructor and a static constructor method with the reserved name class_constructor. &lt;/P&gt;&lt;P&gt;The instance constructor is executed each time you create an object (instance) with the CREATE OBJECT statement, while the class constructor is executed exactly once before you first access a class. &lt;/P&gt;&lt;P&gt;The constructors are always present. However, to implement a constructor you must declare it explicitly with the METHODS or CLASS-METHODS statements. An instance constructor can have IMPORTING parameters and exceptions. You must pass all non-optional parameters when creating an object. Static constructors have no parameters. &lt;/P&gt;&lt;P&gt;Static constructor&lt;/P&gt;&lt;P&gt;The static constructor is always called CLASS_CONSTRUCTER, and is called autmatically before the clas is first accessed, that is before any of the following actions are executed:&lt;/P&gt;&lt;P&gt;&amp;#149;	Creating an instance using CREATE_OBJECT &lt;/P&gt;&lt;P&gt;&amp;#149;	Adressing a static attribute using  &lt;/P&gt;&lt;P&gt;&amp;#149;	Calling a ststic attribute using CALL METHOD &lt;/P&gt;&lt;P&gt;&amp;#149;	Registering a static event handler &lt;/P&gt;&lt;P&gt;&amp;#149;	Registering an evetm handler method for a static event &lt;/P&gt;&lt;P&gt;The static constructor cannot be called explicitly.&lt;/P&gt;&lt;P&gt;Protected components&lt;/P&gt;&lt;P&gt;When we are talking subclassing and enheritance there is one more component than Public and Private, the Protected component. Protected components can be used by the superclass and all of the subclasses. Note that Subclasses cannot access Private components.&lt;/P&gt;&lt;P&gt;Polymorphism&lt;/P&gt;&lt;P&gt;Polymorphism: When the same method is implemented differently in different classes. This can be done using enheritance, by redefining a method from the superclass in subclasses and implement it differently.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Template for making a class&lt;/P&gt;&lt;P&gt;Delete the parts that should not be used&lt;/P&gt;&lt;P&gt;******************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Definition part&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;******************************************&lt;/P&gt;&lt;P&gt;CLASS xxx DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Public section&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------" /&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    TYPES:&lt;/P&gt;&lt;P&gt;    DATA: &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Static data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CLASS-DATA:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Methods&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Using the constructor to initialize parameters&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       constructor    IMPORTING xxx type yyy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Method with parameters&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      mm1 IMPORTING iii   TYPE ttt.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Method without parameters&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      mm2.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Static methods&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CLASS-METHODS:  &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;Protected section. Also accessable by subclasses&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------" /&gt;&lt;P&gt;  PROTECTED SECTION.&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Private section. Not accessable by subclasses&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------" /&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;******************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Implementation part&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;******************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_airplane IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD mm1.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD mm2.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&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;Template for calling a class&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create reference to class lcl_airplane&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA: airplane1 TYPE REF TO lcl_airplane.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create instance using parameters in the cosntructor method&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE OBJECT airplane1 exporting im_name = 'Hansemand'&lt;/P&gt;&lt;P&gt;                                    im_planetype = 'Boing 747'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Calling a method with parameters&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD: airplane1-&amp;gt;display_n_o_airplanes,&lt;/P&gt;&lt;P&gt;               airplane1-&amp;gt;display_attributes.&lt;/P&gt;&lt;P&gt;Subclass&lt;/P&gt;&lt;P&gt;CLASS xxx DEFINITION INHERITING FROM yyy.&lt;/P&gt;&lt;P&gt;Using af class as a parameter for a method&lt;/P&gt;&lt;P&gt;The class LCL_AIRPLANE is used as a parameter for method add_a_new_airplane:&lt;/P&gt;&lt;P&gt;METHODS:&lt;/P&gt;&lt;P&gt;  add_a_new_airplane importing im_airplane TYPE REF to lcl_airplane.&lt;/P&gt;&lt;P&gt;Interfaces&lt;/P&gt;&lt;P&gt;In ABAP interfaces are implemented in addition to, and independently of classes. An interface only has a declaration part, and do not have visibillity sections. Components (Attributes, methods, constants, types) can be defined the same way as in classes.&lt;/P&gt;&lt;P&gt;&amp;#149;	Interfaces are listed in the definition part lof the class, and must always be in the PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;&amp;#149;	Operations defined in the interface atre impemented as methods of the class. All methods of the interface must be present in the &lt;/P&gt;&lt;P&gt;&amp;#149;	implementation part of the class.&lt;/P&gt;&lt;P&gt;&amp;#149;	Attributes, events, constants and types defined in the interface are automatically available to the class carying out the implementation.&lt;/P&gt;&lt;P&gt;&amp;#149;	Interface components are adresse in the class by ]&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;Define, implement and use simple class&lt;/P&gt;&lt;P&gt;***INCLUDE ZBC404_HF_LCL_AIRPLANE .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;******************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Definition part&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;******************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_airplane DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Public section&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------" /&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    TYPES: t_name(25) TYPE c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;      constructor,&lt;/P&gt;&lt;P&gt;      set_attributes IMPORTING p_name       TYPE t_name&lt;/P&gt;&lt;P&gt;                               p_planetype  TYPE saplane-planetype,&lt;/P&gt;&lt;P&gt;      display_attributes,&lt;/P&gt;&lt;P&gt;      display_n_o_airplanes.&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;HR originaltext="------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Private section&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------" /&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Private attributes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: name(25) TYPE c,&lt;/P&gt;&lt;P&gt;          planetype TYPE saplane-planetype.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Private static attribute&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CLASS-DATA n_o_airplanes TYPE i.&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Implementation part&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;******************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_airplane IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Counts number of instances&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    n_o_airplanes = n_o_airplanes + 1.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD set_attributes.&lt;/P&gt;&lt;P&gt;    name      = p_name.&lt;/P&gt;&lt;P&gt;    planetype = p_planetype.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD display_attributes.&lt;/P&gt;&lt;P&gt;    WRITE:/ 'Name:', name, 'Planetype:', planetype.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD display_n_o_airplanes.&lt;/P&gt;&lt;P&gt;    WRITE: / 'No. planes:', n_o_airplanes.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;REPORT zbc404_hf_maintain_airplanes .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INCLUDE zbc404_hf_lcl_airplane.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create reference to class lcl_airplane&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA: airplane1 TYPE REF TO lcl_airplane,&lt;/P&gt;&lt;P&gt;      airplane2 TYPE REF TO lcl_airplane.&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create instance&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE OBJECT airplane1.&lt;/P&gt;&lt;P&gt;  CALL METHOD: airplane1-&amp;gt;display_n_o_airplanes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CREATE OBJECT airplane2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Setting attributes using a method with parameters&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD airplane1-&amp;gt;set_attributes EXPORTING p_name      = 'Kurt'&lt;/P&gt;&lt;P&gt;                                                  p_planetype = 'MD80'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Using methods &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD: airplane1-&amp;gt;display_n_o_airplanes,&lt;/P&gt;&lt;P&gt;               airplane1-&amp;gt;display_attributes.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;The resulting report:&lt;/P&gt;&lt;P&gt;Maintain airplanes                                                                                &lt;/P&gt;&lt;P&gt;No. planes:          1                                 &lt;/P&gt;&lt;P&gt;No. planes:          2                                 &lt;/P&gt;&lt;P&gt;Name: Kurt                      Planetype: MD80        &lt;/P&gt;&lt;P&gt;Use constructor to create an object with parameters&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;    TYPES: t_name(25) TYPE c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;      constructor    importing p2_name      type t_name&lt;/P&gt;&lt;P&gt;                               p2_planetype  TYPE saplane-planetype,&lt;/P&gt;&lt;P&gt;..... more code .......&lt;/P&gt;&lt;P&gt;CLASS lcl_airplane IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;P&gt;    name      = p2_name.&lt;/P&gt;&lt;P&gt;    planetype = p2_planetype.&lt;/P&gt;&lt;P&gt;..... more code .......&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  CREATE OBJECT airplane1 exporting p2_name = 'Hansemand'&lt;/P&gt;&lt;P&gt;                                    p2_planetype = 'Boing 747'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Subclassing&lt;/P&gt;&lt;P&gt;This example uses a superclass LCL_AIRPLANE and subclasses it into LCL_PASSENGER_AIRPLANE and LCL_CARGO_PLANE.&lt;/P&gt;&lt;P&gt;LCL_AIRPLANE has a method display_n_o_airplanes that displays the number of object instances.&lt;/P&gt;&lt;P&gt;LCL_PASSENGER_AIRPLANE has the private instance attribute n_o_seats, and redefines the superclass method display_attributes, so it also displays n_o_seats.&lt;/P&gt;&lt;P&gt;LCL_CARGO_PLANE has the private instance attribute cargomax, and redefines the superclass method display_attributes, so it also displays cargomax.&lt;/P&gt;&lt;P&gt;All instance attributes are provided by the cunstructor method.&lt;/P&gt;&lt;P&gt;Superclass LCL_AIRPLANE&lt;/P&gt;&lt;P&gt;***INCLUDE ZBC404_HF_LCL_AIRPLANE .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;******************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Definition part&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;******************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_airplane DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Public section&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------" /&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    TYPES: t_name(25) TYPE c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;      constructor    IMPORTING im_name      TYPE t_name&lt;/P&gt;&lt;P&gt;                               im_planetype  TYPE saplane-planetype,&lt;/P&gt;&lt;P&gt;      display_attributes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Static methods&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CLASS-METHODS:&lt;/P&gt;&lt;P&gt;      display_n_o_airplanes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Protected section&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------" /&gt;&lt;P&gt;  PROTECTED SECTION.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Private attributes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: name(25) TYPE c,&lt;/P&gt;&lt;P&gt;          planetype TYPE saplane-planetype.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Private static attribute&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CLASS-DATA n_o_airplanes TYPE i.&lt;/P&gt;&lt;P&gt;&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Implementation part&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;******************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_airplane IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;P&gt;    name      = im_name.&lt;/P&gt;&lt;P&gt;    planetype = im_planetype.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Counts number of instances&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    n_o_airplanes = n_o_airplanes + 1.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD display_attributes.&lt;/P&gt;&lt;P&gt;    WRITE:/ 'Name:', name, 'Planetype:', planetype.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD display_n_o_airplanes.&lt;/P&gt;&lt;P&gt;    WRITE: / 'No. planes:', n_o_airplanes.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;Sub class LCL_PASSENGER_AIRPLANE&lt;/P&gt;&lt;P&gt;***INCLUDE ZBC404_HF_LCL_PASSENGER_PLANE .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*******************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;This is a subclass of class lcl_airplane&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_passenger_airplane DEFINITION INHERITING FROM lcl_airplane.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  The constructor contains the parameters from the superclass&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  plus the parameters from the subclass&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;      constructor IMPORTING im_name      TYPE t_name&lt;/P&gt;&lt;P&gt;                            im_planetype TYPE saplane-planetype&lt;/P&gt;&lt;P&gt;                            im_n_o_seats TYPE sflight-seatsmax,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Redefinition of superclass method display_attributes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      display_attributes REDEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    DATA: n_o_seats TYPE sflight-seatsmax.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS lcl_passenger_airplane IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  The constructor method of the superclass MUST be called withing the&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  construtor&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL METHOD super-&amp;gt;constructor&lt;/P&gt;&lt;P&gt;                          EXPORTING im_name      = im_name&lt;/P&gt;&lt;P&gt;                                    im_planetype = im_planetype.&lt;/P&gt;&lt;P&gt;    n_o_seats = im_n_o_seats.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  The redefined  display_attributes method&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  METHOD display_attributes.&lt;/P&gt;&lt;P&gt;    CALL METHOD super-&amp;gt;display_attributes.&lt;/P&gt;&lt;P&gt;    WRITE: / 'No. seats:', n_o_seats.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;Sub class LCL_CARGO_PLANE&lt;/P&gt;&lt;P&gt;***INCLUDE ZBC404_HF_LCL_CARGO_PLANE .&lt;/P&gt;&lt;P&gt;*******************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;This is a subclass of class lcl_airplane&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_cargo_plane DEFINITION INHERITING FROM lcl_airplane.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    The constructor contains the parameters from the superclass&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    plus the parameters from the subclass&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      constructor IMPORTING im_name      TYPE t_name&lt;/P&gt;&lt;P&gt;                            im_planetype TYPE saplane-planetype&lt;/P&gt;&lt;P&gt;                            im_cargomax  type scplane-cargomax,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Redefinition of superclass method display_attributes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      display_attributes REDEFINITION.&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    DATA:cargomax TYPE scplane-cargomax.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;CLASS lcl_cargo_plane IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  The constructor method of the superclass MUST be called withing the&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  constructor&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL METHOD super-&amp;gt;constructor&lt;/P&gt;&lt;P&gt;                          EXPORTING im_name      = im_name&lt;/P&gt;&lt;P&gt;                                    im_planetype = im_planetype.&lt;/P&gt;&lt;P&gt;    cargomax = im_cargomax.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD display_attributes.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  The redefined  display_attributes method&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL METHOD super-&amp;gt;display_attributes.&lt;/P&gt;&lt;P&gt;    WRITE: / 'Cargo max:', cargomax.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&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;The Main program that uses the classes&lt;/P&gt;&lt;P&gt;REPORT zbc404_hf_main .&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Super class&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;INCLUDE zbc404_hf_lcl_airplane.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Sub classes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;INCLUDE zbc404_hf_lcl_passenger_plane.&lt;/P&gt;&lt;P&gt;INCLUDE zbc404_hf_lcl_cargo_plane.&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Type ref to sub classes. Note: It is not necesssary to make typeref to the superclass&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  o_passenger_airplane TYPE REF TO lcl_passenger_airplane,&lt;/P&gt;&lt;P&gt;  o_cargo_plane        TYPE REF TO lcl_cargo_plane.&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Display initial number of instances = 0&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD  lcl_airplane=&amp;gt;display_n_o_airplanes.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create objects&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE OBJECT o_passenger_airplane&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      im_name      = 'LH505'&lt;/P&gt;&lt;P&gt;      im_planetype = 'Boing 747'&lt;/P&gt;&lt;P&gt;      im_n_o_seats = 350.&lt;/P&gt;&lt;P&gt;  CREATE OBJECT o_cargo_plane&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      im_name      = 'AR13'&lt;/P&gt;&lt;P&gt;      im_planetype = 'DC 3'&lt;/P&gt;&lt;P&gt;      im_cargomax = 35.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Display attributes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD o_passenger_airplane-&amp;gt;display_attributes.&lt;/P&gt;&lt;P&gt;  CALL METHOD o_cargo_plane-&amp;gt;display_attributes.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Call static method display_n_o_airplanes&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Note: The syntax for calling a superclass method, differs from the syntax when calling a subclass method.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;When calling a superclass =&amp;gt; must be used instead of -&amp;gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD  lcl_airplane=&amp;gt;display_n_o_airplanes.&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;No. planes: 0 &lt;/P&gt;&lt;P&gt;Name: LH505 Planetype: Boing 747 &lt;/P&gt;&lt;P&gt;No. seats: 350 &lt;/P&gt;&lt;P&gt;Name: AR13 Planetype: DC 3 &lt;/P&gt;&lt;P&gt;Cargo max: 35,0000 &lt;/P&gt;&lt;P&gt;No. planes: 2 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Polymorphism&lt;/P&gt;&lt;P&gt;Polymorphism: When the same method is implemented differently in different classes. This can be done using enheritance, by redefining a method from the superclass in subclasses and implement it differently.&lt;/P&gt;&lt;P&gt;Classes: &lt;/P&gt;&lt;P&gt;&amp;#149;	lcl_airplane Superclass &lt;/P&gt;&lt;P&gt;&amp;#149;	lcl_cargo_airplane Subclass &lt;/P&gt;&lt;P&gt;&amp;#149;	lcl_passenger_airplane Subclass &lt;/P&gt;&lt;P&gt;The method estimate_fuel_consumption is implemented differently in the 3 classes, as it depends on the airplane type.&lt;/P&gt;&lt;P&gt;Object from different classes are stored in an internal table (plane_list) consisting of references to the superclass, and the processed &lt;/P&gt;&lt;P&gt;identically for all the classes. &lt;/P&gt;&lt;P&gt;What coding for the estimate_fuel_consumption method taht is actually executed, depends on the dynamic type of the plane reference variable,&lt;/P&gt;&lt;P&gt; that is, depends on which object plane points to.&lt;/P&gt;&lt;P&gt;DATA: cargo_plane            TYPE REF to lcl_cargo_airplane,&lt;/P&gt;&lt;P&gt;          passenger_plane    TYPE REF to lcl_passenger_airplane,&lt;/P&gt;&lt;P&gt;          plane_list                  TYPE TABLE OF REF TO lcl_airplane.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Creating the list of references&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CREATE OBJECT cargo_plane.&lt;/P&gt;&lt;P&gt;APPEND cargo_plane to plane_list.&lt;/P&gt;&lt;P&gt;CREATE OBJECT passenger_plane&lt;/P&gt;&lt;P&gt;APPEND passenger_plane to plane list.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Generic method for calucalting required fuel&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;METHOD calculate required_fuel.&lt;/P&gt;&lt;P&gt;  DATA: plane TYPE REF TO lcl_airplane.&lt;/P&gt;&lt;P&gt;  LOOP AT plane_list INTO plane.&lt;/P&gt;&lt;P&gt;    re_fuel = re_fuel + plane-&amp;gt;estimate_fuel_consumption( distance ).&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDMETHOD.&lt;/P&gt;&lt;P&gt;Working example:&lt;/P&gt;&lt;P&gt;This example assumes that the classes lcl_airplane,  lcl_passnger_airplane and lcl_cargo plane (Se Subcallsing)  exists.&lt;/P&gt;&lt;P&gt;Create objects of type lcl_cargo_plane and lcl_passenger_airplane, adds them to a list in lcl_carrier, and displays the list.  &lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp; Include  ZBC404_HF_LCL_CARRIER                                      *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp;----&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 lcl_carrier 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;CLASS lcl_carrier DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    TYPES: BEGIN OF flight_list_type,&lt;/P&gt;&lt;P&gt;              connid   TYPE sflight-connid,&lt;/P&gt;&lt;P&gt;              fldate   TYPE sflight-fldate,&lt;/P&gt;&lt;P&gt;              airplane TYPE REF TO lcl_airplane,&lt;/P&gt;&lt;P&gt;              seatsocc TYPE sflight-seatsocc,&lt;/P&gt;&lt;P&gt;              cargo(5) TYPE p DECIMALS 3,&lt;/P&gt;&lt;P&gt;           END OF flight_list_type.&lt;/P&gt;&lt;P&gt;    METHODS: constructor IMPORTING im_name TYPE string,&lt;/P&gt;&lt;P&gt;             get_name RETURNING value(ex_name) TYPE string,&lt;/P&gt;&lt;P&gt;             add_a_new_airplane IMPORTING&lt;/P&gt;&lt;P&gt;                                   im_airplane TYPE REF TO lcl_airplane,&lt;/P&gt;&lt;P&gt;    create_a_new_flight importing&lt;/P&gt;&lt;P&gt;                          im_connid   type sflight-connid&lt;/P&gt;&lt;P&gt;                          im_fldate   type sflight-fldate&lt;/P&gt;&lt;P&gt;                          im_airplane type ref to lcl_airplane&lt;/P&gt;&lt;P&gt;                          im_seatsocc type sflight-seatsocc&lt;/P&gt;&lt;P&gt;                                    optional&lt;/P&gt;&lt;P&gt;                        im_cargo    type p optional,&lt;/P&gt;&lt;P&gt;     display_airplanes.&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    DATA: name              TYPE string,&lt;/P&gt;&lt;P&gt;          list_of_airplanes TYPE TABLE OF REF TO lcl_airplane,&lt;/P&gt;&lt;P&gt;          list_of_flights   TYPE TABLE OF flight_list_type.&lt;/P&gt;&lt;P&gt;ENDCLASS.&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 lcl_carrier 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;CLASS lcl_carrier IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;P&gt;    name = im_name.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD get_name.&lt;/P&gt;&lt;P&gt;    ex_name = name.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD create_a_new_flight.&lt;/P&gt;&lt;P&gt;    DATA: wa_list_of_flights TYPE flight_list_type.&lt;/P&gt;&lt;P&gt;    wa_list_of_flights-connid   = im_connid.&lt;/P&gt;&lt;P&gt;    wa_list_of_flights-fldate   = im_fldate.&lt;/P&gt;&lt;P&gt;    wa_list_of_flights-airplane = im_airplane.&lt;/P&gt;&lt;P&gt;    IF im_seatsocc IS INITIAL.&lt;/P&gt;&lt;P&gt;      wa_list_of_flights-cargo = im_cargo.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      wa_list_of_flights-seatsocc = im_seatsocc.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    APPEND wa_list_of_flights TO list_of_flights.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD add_a_new_airplane.&lt;/P&gt;&lt;P&gt;    APPEND im_airplane TO list_of_airplanes.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD display_airplanes.&lt;/P&gt;&lt;P&gt;    DATA: l_airplane TYPE REF TO lcl_airplane.&lt;/P&gt;&lt;P&gt;    LOOP AT list_of_airplanes INTO l_airplane.&lt;/P&gt;&lt;P&gt;      CALL METHOD l_airplane-&amp;gt;display_attributes.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&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;REPORT zbc404_hf_main .&lt;/P&gt;&lt;P&gt;*******************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; This reprort uses class LCL_AIRPLNAE and subclasses&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; LCL_CARGO_PLANE and LCL_PASSENGER_AIRPLANE and class LCL_CARRIER&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Super class for airplanes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;INCLUDE zbc404_hf_lcl_airplane.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Sub classes for airplanes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;INCLUDE zbc404_hf_lcl_passenger_plane.&lt;/P&gt;&lt;P&gt;INCLUDE zbc404_hf_lcl_cargo_plane.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Carrier class&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;INCLUDE zbc404_hf_lcl_carrier.&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Type ref to classes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  o_passenger_airplane  TYPE REF TO lcl_passenger_airplane,&lt;/P&gt;&lt;P&gt;  o_passenger_airplane2 TYPE REF TO lcl_passenger_airplane,&lt;/P&gt;&lt;P&gt;  o_cargo_plane         TYPE REF TO lcl_cargo_plane,&lt;/P&gt;&lt;P&gt;  o_cargo_plane2        TYPE REF TO lcl_cargo_plane,&lt;/P&gt;&lt;P&gt;  o_carrier             TYPE REF TO lcl_carrier.&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create objects&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE OBJECT o_passenger_airplane&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      im_name      = 'LH505'&lt;/P&gt;&lt;P&gt;      im_planetype = 'Boing 747'&lt;/P&gt;&lt;P&gt;      im_n_o_seats = 350.&lt;/P&gt;&lt;P&gt;  CREATE OBJECT o_passenger_airplane2&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      im_name      = 'SK333'&lt;/P&gt;&lt;P&gt;      im_planetype = 'MD80'&lt;/P&gt;&lt;P&gt;      im_n_o_seats = 110.&lt;/P&gt;&lt;P&gt;  CREATE OBJECT o_cargo_plane&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      im_name      = 'AR13'&lt;/P&gt;&lt;P&gt;      im_planetype = 'DC 3'&lt;/P&gt;&lt;P&gt;      im_cargomax = 35.&lt;/P&gt;&lt;P&gt;  CREATE OBJECT o_cargo_plane2&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      im_name      = 'AFL124'&lt;/P&gt;&lt;P&gt;      im_planetype = 'Iljutsin 2'&lt;/P&gt;&lt;P&gt;      im_cargomax = 35000.&lt;/P&gt;&lt;P&gt;  CREATE OBJECT o_carrier&lt;/P&gt;&lt;P&gt;    EXPORTING im_name = 'Spritisch Airways'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Add passenger and cargo planes to the list of airplanes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD o_carrier-&amp;gt;add_a_new_airplane&lt;/P&gt;&lt;P&gt;     EXPORTING im_airplane = o_passenger_airplane.&lt;/P&gt;&lt;P&gt;  CALL METHOD o_carrier-&amp;gt;add_a_new_airplane&lt;/P&gt;&lt;P&gt;     EXPORTING im_airplane = o_passenger_airplane2.&lt;/P&gt;&lt;P&gt;  CALL METHOD o_carrier-&amp;gt;add_a_new_airplane&lt;/P&gt;&lt;P&gt;     EXPORTING im_airplane = o_cargo_plane.&lt;/P&gt;&lt;P&gt;  CALL METHOD o_carrier-&amp;gt;add_a_new_airplane&lt;/P&gt;&lt;P&gt;     EXPORTING im_airplane = o_cargo_plane2.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Display list of airplanes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call method o_carrier-&amp;gt;display_airplanes.&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;Name: LH505                     Planetype: Boing 747         &lt;/P&gt;&lt;P&gt;No. seats:       350                                         &lt;/P&gt;&lt;P&gt;Name: SK333                     Planetype: MD80              &lt;/P&gt;&lt;P&gt;No. seats:       110                                         &lt;/P&gt;&lt;P&gt;Name: AR13                      Planetype: DC 3              &lt;/P&gt;&lt;P&gt;Cargo max:             35,0000                               &lt;/P&gt;&lt;P&gt;Name: AFL124                    Planetype: Iljutsin 2        &lt;/P&gt;&lt;P&gt;Cargo max:         35.000,0000                               &lt;/P&gt;&lt;P&gt;Events &lt;/P&gt;&lt;P&gt;Below is a simple example of how to implement an event.&lt;/P&gt;&lt;P&gt;REPORT zbc404_hf_events_5.&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 lcl_dog 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;CLASS lcl_dog DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Declare events&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    EVENTS:&lt;/P&gt;&lt;P&gt;      dog_is_hungry&lt;/P&gt;&lt;P&gt;        EXPORTING value(ex_time_since_last_meal) TYPE i.&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;      constructor&lt;/P&gt;&lt;P&gt;          IMPORTING im_name TYPE string,&lt;/P&gt;&lt;P&gt;      set_time_since_last_meal&lt;/P&gt;&lt;P&gt;          IMPORTING im_time TYPE i,&lt;/P&gt;&lt;P&gt;      on_dog_is_hungry FOR EVENT dog_is_hungry OF lcl_dog&lt;/P&gt;&lt;P&gt;          IMPORTING ex_time_since_last_meal.&lt;/P&gt;&lt;P&gt;ENDCLASS.&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 lcl_dog 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;CLASS lcl_dog IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;P&gt;    WRITE: / 'I am a dog and my name is', im_name.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD set_time_since_last_meal.&lt;/P&gt;&lt;P&gt;    IF im_time &amp;lt; 4.&lt;/P&gt;&lt;P&gt;      SKIP 1.&lt;/P&gt;&lt;P&gt;      WRITE: / 'You fool, I am not hungry yet'.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   Subsrcribe for event:&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   set handler &amp;lt;Event handler method&amp;gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   FOR &amp;lt;ref_sender&amp;gt;!FOR ALL INSTANCES [ACTIVATION &amp;lt;var&amp;gt;]&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      SET HANDLER on_dog_is_hungry FOR ALL INSTANCES ACTIVATION 'X'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   Raise event&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      RAISE EVENT dog_is_hungry&lt;/P&gt;&lt;P&gt;        EXPORTING ex_time_since_last_meal = im_time.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD on_dog_is_hungry.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Event method, called when the event dog_is_hungry is raised&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    SKIP 1.&lt;/P&gt;&lt;P&gt;    WRITE: /  'You son of a ****. I have not eaten for more than',&lt;/P&gt;&lt;P&gt;              ex_time_since_last_meal, ' hours'.&lt;/P&gt;&lt;P&gt;    WRITE: / 'Give me something to eat NOW!'.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;ENDCLASS.&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;      R E P O R T&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;DATA: o_dog1 TYPE REF TO lcl_dog.&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  CREATE OBJECT o_dog1 EXPORTING im_name = 'Beefeater'.&lt;/P&gt;&lt;P&gt;  CALL METHOD o_dog1-&amp;gt;set_time_since_last_meal&lt;/P&gt;&lt;P&gt;    EXPORTING im_time = 2.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;This method call will raise the event dog_is_hungy&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;because time &amp;gt; 3&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD o_dog1-&amp;gt;set_time_since_last_meal&lt;/P&gt;&lt;P&gt;    EXPORTING im_time = 5.&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;I am a dog and my name is Beefeater &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You fool, I am not hungry yet &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You son of a ****. I have not eaten for more than 5 hours &lt;/P&gt;&lt;P&gt;Give me something to eat NOW! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Simple class&lt;/P&gt;&lt;P&gt;This example shows how to create a simple employee class. The constructor method is used to initialize number and name of thje employee when the object is created. A display_employee method can be called to show the attributes of the employee, and CLASS-METHOD dosplay_no_of_employees can be called to show the total number of employees (Number of instances of the employee class).&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;REPORT zbc404_hf_events_1.&lt;/P&gt;&lt;P&gt;*********************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;L C L _ E M P L O Y E E&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*********************************************************************&lt;/P&gt;&lt;P&gt;*---- LCL Employee - Definition&lt;/P&gt;&lt;P&gt;CLASS lcl_employee DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The public section is accesible from outside   &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------------" /&gt;&lt;P&gt;    TYPES:&lt;/P&gt;&lt;P&gt;      BEGIN OF t_employee,&lt;/P&gt;&lt;P&gt;        no  TYPE i,&lt;/P&gt;&lt;P&gt;        name TYPE string,&lt;/P&gt;&lt;P&gt;     END OF t_employee.&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;      constructor&lt;/P&gt;&lt;P&gt;        IMPORTING im_employee_no TYPE i&lt;/P&gt;&lt;P&gt;                  im_employee_name TYPE string,&lt;/P&gt;&lt;P&gt;      display_employee.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Class methods are global for all instances       &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CLASS-METHODS: display_no_of_employees.&lt;/P&gt;&lt;P&gt;  PROTECTED SECTION.&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The protecetd section is accesible from the class and its subclasses  &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Class data are global for all instances       &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CLASS-DATA: g_no_of_employees TYPE i.&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The private section is only accesible from within the classs  &lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;    DATA: g_employee TYPE t_employee.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*--- LCL Employee - Implementation&lt;/P&gt;&lt;P&gt;CLASS lcl_employee IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;P&gt;    g_employee-no = im_employee_no.&lt;/P&gt;&lt;P&gt;    g_employee-name = im_employee_name.&lt;/P&gt;&lt;P&gt;    g_no_of_employees = g_no_of_employees + 1.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD display_employee.&lt;/P&gt;&lt;P&gt;    WRITE:/ 'Employee', g_employee-no, g_employee-name.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD display_no_of_employees.&lt;/P&gt;&lt;P&gt;    WRITE: / 'Number of employees is:', g_no_of_employees.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;R E P O R T&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*********************************************************************&lt;/P&gt;&lt;P&gt;DATA: g_employee1 TYPE REF TO lcl_employee,&lt;/P&gt;&lt;P&gt;      g_employee2 TYPE REF TO lcl_employee.&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  CREATE OBJECT g_employee1&lt;/P&gt;&lt;P&gt;    EXPORTING im_employee_no = 1&lt;/P&gt;&lt;P&gt;              im_employee_name = 'John Jones'.&lt;/P&gt;&lt;P&gt;  CREATE OBJECT g_employee2&lt;/P&gt;&lt;P&gt;    EXPORTING im_employee_no = 2&lt;/P&gt;&lt;P&gt;              im_employee_name = 'Sally Summer'.&lt;/P&gt;&lt;P&gt;  CALL METHOD g_employee1-&amp;gt;display_employee.&lt;/P&gt;&lt;P&gt;  CALL METHOD g_employee2-&amp;gt;display_employee.&lt;/P&gt;&lt;P&gt;  CALL METHOD g_employee2-&amp;gt;display_no_of_employees.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;2. Inheritance and polymorphism&lt;/P&gt;&lt;P&gt;This example uses a superclass lcl_company_employees and two subclasses lcl_bluecollar_employee and lcl_whitecollar_employee to add employees to a list and then display a list of employees and there wages. The wages are calcukated in the method add_employee, but as the wages are calculated differently for blue collar employees and white collar emplyees, the superclass method add_employee is redeifined in the subclasses.&lt;/P&gt;&lt;P&gt;Principles:&lt;/P&gt;&lt;P&gt;Create super class LCL_CompanyEmployees. &lt;/P&gt;&lt;P&gt;The class has the methods:&lt;/P&gt;&lt;P&gt;&amp;#149;	Constructor &lt;/P&gt;&lt;P&gt;&amp;#149;	Add_Employee - Adds a new employee to the list of employees &lt;/P&gt;&lt;P&gt;&amp;#149;	Display_Employee_List - Displays all employees and there wage &lt;/P&gt;&lt;P&gt;&amp;#149;	Display_no_of_employees - Displays total number of employees &lt;/P&gt;&lt;P&gt;Note the use of CLASS-DATA to keep the list of employees and number of employees the same from instance to instance.&lt;/P&gt;&lt;P&gt;Create subclasses lcl_bluecollar_employee and lcl_whitecollar_employee. The calsses are identical, except for the redifinition of the add_employee method, where the caclculation of wage is different.&lt;/P&gt;&lt;P&gt;Methodes: &lt;/P&gt;&lt;P&gt;&amp;#149;	Constructor. The constructor is used to initialize the attributes of the employee. Note that the constructor in the supclasss has to be called from within the constructor of the subclass. &lt;/P&gt;&lt;P&gt;&amp;#149;	Add_Employee. This is a redinition of the same method in the superclass. In the redefined class the wage is calcuated, and the superclass method is called to add the employees to the emploee list.: &lt;/P&gt;&lt;P&gt;The program&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;REPORT zbc404_hf_events_2 .&lt;/P&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Super class LCL_CompanyEmployees&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_company_employees DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    TYPES:&lt;/P&gt;&lt;P&gt;      BEGIN OF t_employee,&lt;/P&gt;&lt;P&gt;        no  TYPE i,&lt;/P&gt;&lt;P&gt;        name TYPE string,&lt;/P&gt;&lt;P&gt;        wage TYPE i,&lt;/P&gt;&lt;P&gt;     END OF t_employee.&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;      constructor,&lt;/P&gt;&lt;P&gt;      add_employee&lt;/P&gt;&lt;P&gt;        IMPORTING im_no   TYPE i&lt;/P&gt;&lt;P&gt;                  im_name TYPE string&lt;/P&gt;&lt;P&gt;                  im_wage TYPE i,&lt;/P&gt;&lt;P&gt;      display_employee_list,&lt;/P&gt;&lt;P&gt;      display_no_of_employees.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    CLASS-DATA: i_employee_list TYPE TABLE OF t_employee,&lt;/P&gt;&lt;P&gt;                no_of_employees TYPE i.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*-- CLASS LCL_CompanyEmployees IMPLEMENTATION&lt;/P&gt;&lt;P&gt;CLASS lcl_company_employees IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;P&gt;    no_of_employees = no_of_employees + 1.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD add_employee.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Adds a new employee to the list of employees&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: l_employee TYPE t_employee.&lt;/P&gt;&lt;P&gt;    l_employee-no = im_no.&lt;/P&gt;&lt;P&gt;    l_employee-name = im_name.&lt;/P&gt;&lt;P&gt;    l_employee-wage = im_wage.&lt;/P&gt;&lt;P&gt;    APPEND l_employee TO i_employee_list.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD display_employee_list.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Displays all employees and there wage&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: l_employee TYPE t_employee.&lt;/P&gt;&lt;P&gt;    WRITE: / 'List of Employees'.&lt;/P&gt;&lt;P&gt;    LOOP AT i_employee_list INTO l_employee.&lt;/P&gt;&lt;P&gt;      WRITE: / l_employee-no, l_employee-name, l_employee-wage.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD display_no_of_employees.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Displays total number of employees&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    SKIP 3.&lt;/P&gt;&lt;P&gt;    WRITE: / 'Total number of employees:', no_of_employees.&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Sub class LCL_BlueCollar_Employee&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_bluecollar_employee DEFINITION&lt;/P&gt;&lt;P&gt;          INHERITING FROM lcl_company_employees.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;        constructor&lt;/P&gt;&lt;P&gt;          IMPORTING im_no             TYPE i&lt;/P&gt;&lt;P&gt;                    im_name           TYPE string&lt;/P&gt;&lt;P&gt;                    im_hours          TYPE i&lt;/P&gt;&lt;P&gt;                    im_hourly_payment TYPE i,&lt;/P&gt;&lt;P&gt;         add_employee REDEFINITION.&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    DATA:no             TYPE i,&lt;/P&gt;&lt;P&gt;         name           TYPE string,&lt;/P&gt;&lt;P&gt;         hours          TYPE i,&lt;/P&gt;&lt;P&gt;         hourly_payment TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*---- CLASS LCL_BlueCollar_Employee IMPLEMENTATION&lt;/P&gt;&lt;P&gt;CLASS lcl_bluecollar_employee IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  The superclass constructor method must be called from the subclass&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  constructor method&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL METHOD super-&amp;gt;constructor.&lt;/P&gt;&lt;P&gt;    no = im_no.&lt;/P&gt;&lt;P&gt;    name = im_name.&lt;/P&gt;&lt;P&gt;    hours = im_hours.&lt;/P&gt;&lt;P&gt;    hourly_payment = im_hourly_payment.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD add_employee.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Calculate wage an call the superclass method add_employee to add&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  the employee to the employee list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: l_wage TYPE i.&lt;/P&gt;&lt;P&gt;    l_wage = hours * hourly_payment.&lt;/P&gt;&lt;P&gt;    CALL METHOD super-&amp;gt;add_employee&lt;/P&gt;&lt;P&gt;      EXPORTING im_no = no&lt;/P&gt;&lt;P&gt;                im_name = name&lt;/P&gt;&lt;P&gt;                im_wage = l_wage.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Sub class LCL_WhiteCollar_Employee&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_whitecollar_employee DEFINITION&lt;/P&gt;&lt;P&gt;    INHERITING FROM lcl_company_employees.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;        constructor&lt;/P&gt;&lt;P&gt;          IMPORTING im_no                 TYPE i&lt;/P&gt;&lt;P&gt;                    im_name               TYPE string&lt;/P&gt;&lt;P&gt;                    im_monthly_salary     TYPE i&lt;/P&gt;&lt;P&gt;                    im_monthly_deductions TYPE i,&lt;/P&gt;&lt;P&gt;         add_employee REDEFINITION.&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    DATA:&lt;/P&gt;&lt;P&gt;      no                    TYPE i,&lt;/P&gt;&lt;P&gt;      name                  TYPE string,&lt;/P&gt;&lt;P&gt;      monthly_salary        TYPE i,&lt;/P&gt;&lt;P&gt;      monthly_deductions    TYPE i.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*---- CLASS LCL_WhiteCollar_Employee IMPLEMENTATION&lt;/P&gt;&lt;P&gt;CLASS lcl_whitecollar_employee IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  The superclass constructor method must be called from the subclass&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  constructor method&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL METHOD super-&amp;gt;constructor.&lt;/P&gt;&lt;P&gt;    no = im_no.&lt;/P&gt;&lt;P&gt;    name = im_name.&lt;/P&gt;&lt;P&gt;    monthly_salary = im_monthly_salary.&lt;/P&gt;&lt;P&gt;    monthly_deductions = im_monthly_deductions.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD add_employee.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Calculate wage an call the superclass method add_employee to add&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  the employee to the employee list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: l_wage TYPE i.&lt;/P&gt;&lt;P&gt;    l_wage = monthly_salary - monthly_deductions.&lt;/P&gt;&lt;P&gt;    CALL METHOD super-&amp;gt;add_employee&lt;/P&gt;&lt;P&gt;      EXPORTING im_no = no&lt;/P&gt;&lt;P&gt;                im_name = name&lt;/P&gt;&lt;P&gt;                im_wage = l_wage.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;R E P O R T&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Object references&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  o_bluecollar_employee1  TYPE REF TO lcl_bluecollar_employee,&lt;/P&gt;&lt;P&gt;  o_whitecollar_employee1 TYPE REF TO lcl_whitecollar_employee.&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create bluecollar employee obeject&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE OBJECT o_bluecollar_employee1&lt;/P&gt;&lt;P&gt;      EXPORTING im_no  = 1&lt;/P&gt;&lt;P&gt;                im_name  = 'Gylle Karen'&lt;/P&gt;&lt;P&gt;                im_hours = 38&lt;/P&gt;&lt;P&gt;                im_hourly_payment = 75.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Add bluecollar employee to employee list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD o_bluecollar_employee1-&amp;gt;add_employee&lt;/P&gt;&lt;P&gt;      EXPORTING im_no  = 1&lt;/P&gt;&lt;P&gt;                im_name  = 'Gylle Karen'&lt;/P&gt;&lt;P&gt;                im_wage = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create whitecollar employee obeject&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE OBJECT o_whitecollar_employee1&lt;/P&gt;&lt;P&gt;      EXPORTING im_no  = 2&lt;/P&gt;&lt;P&gt;                im_name  = 'John Dickens'&lt;/P&gt;&lt;P&gt;                im_monthly_salary = 10000&lt;/P&gt;&lt;P&gt;                im_monthly_deductions = 2500.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Add bluecollar employee to employee list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD o_whitecollar_employee1-&amp;gt;add_employee&lt;/P&gt;&lt;P&gt;      EXPORTING im_no  = 1&lt;/P&gt;&lt;P&gt;                im_name  = 'Karen Johnson'&lt;/P&gt;&lt;P&gt;                im_wage = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Display employee list and number of employees. Note that the result&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;will be the same when called from o_whitecollar_employee1 or&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;o_bluecolarcollar_employee1, because the methods are defined&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;as static (CLASS-METHODS)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD o_whitecollar_employee1-&amp;gt;display_employee_list.&lt;/P&gt;&lt;P&gt;  CALL METHOD o_whitecollar_employee1-&amp;gt;display_no_of_employees.&lt;/P&gt;&lt;P&gt;The resulting report&lt;/P&gt;&lt;P&gt;List of Employees &lt;/P&gt;&lt;P&gt;1 Karen Johnson 2.850 &lt;/P&gt;&lt;P&gt;2 John Dickens 7.500 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Total number of employees: 2 &lt;/P&gt;&lt;P&gt;3. Interfaces&lt;/P&gt;&lt;P&gt;This example is similiar to th eprevious example, however an interface is implemented with the method add_employee. Note that the interface is only implemented in the superclass ( The INTERFACE stament), but also used in the subclasses. &lt;/P&gt;&lt;P&gt;The interface in the example only contains a method, but an iterface can also contain attrbutes, constants, types and alias names.&lt;/P&gt;&lt;P&gt;The output from example 3 is similiar to the output in example 2.&lt;/P&gt;&lt;P&gt;All changes in the program compared to example 2 are marked with red.&lt;/P&gt;&lt;P&gt;REPORT zbc404_hf_events_3 .&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 lif_employee&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;INTERFACE lif_employee.&lt;/P&gt;&lt;P&gt;  METHODS:&lt;/P&gt;&lt;P&gt;    add_employee&lt;/P&gt;&lt;P&gt;       IMPORTING im_no   TYPE i&lt;/P&gt;&lt;P&gt;                  im_name TYPE string&lt;/P&gt;&lt;P&gt;                  im_wage TYPE i.&lt;/P&gt;&lt;P&gt;ENDINTERFACE.&lt;/P&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Super class LCL_CompanyEmployees&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_company_employees DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    INTERFACES lif_employee.&lt;/P&gt;&lt;P&gt;    TYPES:&lt;/P&gt;&lt;P&gt;      BEGIN OF t_employee,&lt;/P&gt;&lt;P&gt;        no  TYPE i,&lt;/P&gt;&lt;P&gt;        name TYPE string,&lt;/P&gt;&lt;P&gt;        wage TYPE i,&lt;/P&gt;&lt;P&gt;     END OF t_employee.&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;      constructor,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     add_employee      "Removed&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        IMPORTING im_no   TYPE i&lt;/P&gt;&lt;P&gt;                  im_name TYPE string&lt;/P&gt;&lt;P&gt;                  im_wage TYPE i,&lt;/P&gt;&lt;P&gt;      display_employee_list,&lt;/P&gt;&lt;P&gt;      display_no_of_employees.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    CLASS-DATA: i_employee_list TYPE TABLE OF t_employee,&lt;/P&gt;&lt;P&gt;                no_of_employees TYPE i.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*-- CLASS LCL_CompanyEmployees IMPLEMENTATION&lt;/P&gt;&lt;P&gt;CLASS lcl_company_employees IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;P&gt;    no_of_employees = no_of_employees + 1.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD lif_employee~add_employee.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Adds a new employee to the list of employees&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: l_employee TYPE t_employee.&lt;/P&gt;&lt;P&gt;    l_employee-no = im_no.&lt;/P&gt;&lt;P&gt;    l_employee-name = im_name.&lt;/P&gt;&lt;P&gt;    l_employee-wage = im_wage.&lt;/P&gt;&lt;P&gt;    APPEND l_employee TO i_employee_list.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD display_employee_list.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Displays all employees and there wage&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: l_employee TYPE t_employee.&lt;/P&gt;&lt;P&gt;    WRITE: / 'List of Employees'.&lt;/P&gt;&lt;P&gt;    LOOP AT i_employee_list INTO l_employee.&lt;/P&gt;&lt;P&gt;      WRITE: / l_employee-no, l_employee-name, l_employee-wage.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD display_no_of_employees.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Displays total number of employees&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    SKIP 3.&lt;/P&gt;&lt;P&gt;    WRITE: / 'Total number of employees:', no_of_employees.&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Sub class LCL_BlueCollar_Employee&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_bluecollar_employee DEFINITION&lt;/P&gt;&lt;P&gt;          INHERITING FROM lcl_company_employees.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;        constructor&lt;/P&gt;&lt;P&gt;          IMPORTING im_no             TYPE i&lt;/P&gt;&lt;P&gt;                    im_name           TYPE string&lt;/P&gt;&lt;P&gt;                    im_hours          TYPE i&lt;/P&gt;&lt;P&gt;                    im_hourly_payment TYPE i,&lt;/P&gt;&lt;P&gt;         lif_employee~add_employee REDEFINITION..&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    DATA:no             TYPE i,&lt;/P&gt;&lt;P&gt;         name           TYPE string,&lt;/P&gt;&lt;P&gt;         hours          TYPE i,&lt;/P&gt;&lt;P&gt;         hourly_payment TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*---- CLASS LCL_BlueCollar_Employee IMPLEMENTATION&lt;/P&gt;&lt;P&gt;CLASS lcl_bluecollar_employee IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  The superclass constructor method must be called from the subclass&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  constructor method&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL METHOD super-&amp;gt;constructor.&lt;/P&gt;&lt;P&gt;    no = im_no.&lt;/P&gt;&lt;P&gt;    name = im_name.&lt;/P&gt;&lt;P&gt;    hours = im_hours.&lt;/P&gt;&lt;P&gt;    hourly_payment = im_hourly_payment.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD lif_employee~add_employee.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Calculate wage an call the superclass method add_employee to add&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  the employee to the employee list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: l_wage TYPE i.&lt;/P&gt;&lt;P&gt;    l_wage = hours * hourly_payment.&lt;/P&gt;&lt;P&gt;    CALL METHOD super-&amp;gt;lif_employee~add_employee&lt;/P&gt;&lt;P&gt;      EXPORTING im_no = no&lt;/P&gt;&lt;P&gt;                im_name = name&lt;/P&gt;&lt;P&gt;                im_wage = l_wage.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Sub class LCL_WhiteCollar_Employee&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_whitecollar_employee DEFINITION&lt;/P&gt;&lt;P&gt;    INHERITING FROM lcl_company_employees.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;        constructor&lt;/P&gt;&lt;P&gt;          IMPORTING im_no                 TYPE i&lt;/P&gt;&lt;P&gt;                    im_name               TYPE string&lt;/P&gt;&lt;P&gt;                    im_monthly_salary     TYPE i&lt;/P&gt;&lt;P&gt;                    im_monthly_deductions TYPE i,&lt;/P&gt;&lt;P&gt;         lif_employee~add_employee REDEFINITION.&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    DATA:&lt;/P&gt;&lt;P&gt;      no                    TYPE i,&lt;/P&gt;&lt;P&gt;      name                  TYPE string,&lt;/P&gt;&lt;P&gt;      monthly_salary        TYPE i,&lt;/P&gt;&lt;P&gt;      monthly_deductions    TYPE i.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*---- CLASS LCL_WhiteCollar_Employee IMPLEMENTATION&lt;/P&gt;&lt;P&gt;CLASS lcl_whitecollar_employee IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  The superclass constructor method must be called from the subclass&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  constructor method&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL METHOD super-&amp;gt;constructor.&lt;/P&gt;&lt;P&gt;    no = im_no.&lt;/P&gt;&lt;P&gt;    name = im_name.&lt;/P&gt;&lt;P&gt;    monthly_salary = im_monthly_salary.&lt;/P&gt;&lt;P&gt;    monthly_deductions = im_monthly_deductions.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD lif_employee~add_employee.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Calculate wage an call the superclass method add_employee to add&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  the employee to the employee list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: l_wage TYPE i.&lt;/P&gt;&lt;P&gt;    l_wage = monthly_salary - monthly_deductions.&lt;/P&gt;&lt;P&gt;    CALL METHOD super-&amp;gt;lif_employee~add_employee&lt;/P&gt;&lt;P&gt;      EXPORTING im_no = no&lt;/P&gt;&lt;P&gt;                im_name = name&lt;/P&gt;&lt;P&gt;                im_wage = l_wage.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;R E P O R T&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Object references&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  o_bluecollar_employee1  TYPE REF TO lcl_bluecollar_employee,&lt;/P&gt;&lt;P&gt;  o_whitecollar_employee1 TYPE REF TO lcl_whitecollar_employee.&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create bluecollar employee obeject&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE OBJECT o_bluecollar_employee1&lt;/P&gt;&lt;P&gt;      EXPORTING im_no  = 1&lt;/P&gt;&lt;P&gt;                im_name  = 'Gylle Karen'&lt;/P&gt;&lt;P&gt;                im_hours = 38&lt;/P&gt;&lt;P&gt;                im_hourly_payment = 75.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Add bluecollar employee to employee list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD o_bluecollar_employee1-&amp;gt;lif_employee~add_employee&lt;/P&gt;&lt;P&gt;      EXPORTING im_no  = 1&lt;/P&gt;&lt;P&gt;                im_name  = 'Karen Johnson'&lt;/P&gt;&lt;P&gt;                im_wage = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create whitecollar employee obeject&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE OBJECT o_whitecollar_employee1&lt;/P&gt;&lt;P&gt;      EXPORTING im_no  = 2&lt;/P&gt;&lt;P&gt;                im_name  = 'John Dickens'&lt;/P&gt;&lt;P&gt;                im_monthly_salary = 10000&lt;/P&gt;&lt;P&gt;                im_monthly_deductions = 2500.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Add bluecollar employee to employee list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD o_whitecollar_employee1-&amp;gt;lif_employee~add_employee&lt;/P&gt;&lt;P&gt;      EXPORTING im_no  = 1&lt;/P&gt;&lt;P&gt;                im_name  = 'Gylle Karen'&lt;/P&gt;&lt;P&gt;                im_wage = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Display employee list and number of employees. Note that the result&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;will be the same when called from o_whitecollar_employee1 or&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;o_bluecolarcollar_employee1, because the methods are defined&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;as static (CLASS-METHODS)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD o_whitecollar_employee1-&amp;gt;display_employee_list.&lt;/P&gt;&lt;P&gt;  CALL METHOD o_whitecollar_employee1-&amp;gt;display_no_of_employees.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;4. Events&lt;/P&gt;&lt;P&gt;This is the same example as example 4. All changes are marked with red. There have been no canges to the subclasses, only to the superclass and the report, sp the code for th esubclasses is not shown.&lt;/P&gt;&lt;P&gt;For a simple example refer to Events in Examples.&lt;/P&gt;&lt;P&gt;REPORT zbc404_hf_events_4 .&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 lif_employee&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;INTERFACE lif_employee.&lt;/P&gt;&lt;P&gt;  METHODS:&lt;/P&gt;&lt;P&gt;    add_employee&lt;/P&gt;&lt;P&gt;       IMPORTING im_no   TYPE i&lt;/P&gt;&lt;P&gt;                  im_name TYPE string&lt;/P&gt;&lt;P&gt;                  im_wage TYPE i.&lt;/P&gt;&lt;P&gt;ENDINTERFACE.&lt;/P&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Super class LCL_CompanyEmployees&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_company_employees DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    TYPES:&lt;/P&gt;&lt;P&gt;    BEGIN OF t_employee,&lt;/P&gt;&lt;P&gt;      no  TYPE i,&lt;/P&gt;&lt;P&gt;      name TYPE string,&lt;/P&gt;&lt;P&gt;      wage TYPE i,&lt;/P&gt;&lt;P&gt;   END OF t_employee.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Declare event. Note that declaration could also be placed in the&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  interface&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    EVENTS: employee_added_to_list&lt;/P&gt;&lt;P&gt;        EXPORTING value(ex_employee_name) TYPE string.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; CLASS-EVENTS: Events can also be defined as class-events&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    INTERFACES lif_employee.&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;      constructor,&lt;/P&gt;&lt;P&gt;      display_employee_list,&lt;/P&gt;&lt;P&gt;      display_no_of_employees,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Declare event method&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      on_employee_added_to_list FOR EVENT employee_added_to_list OF lcl_company_employees&lt;/P&gt;&lt;P&gt;         IMPORTING ex_employee_name sender.&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;    CLASS-DATA:&lt;/P&gt;&lt;P&gt;      i_employee_list TYPE TABLE OF t_employee,&lt;/P&gt;&lt;P&gt;      no_of_employees TYPE i.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*-- CLASS LCL_CompanyEmployees IMPLEMENTATION&lt;/P&gt;&lt;P&gt;CLASS lcl_company_employees IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD constructor.&lt;/P&gt;&lt;P&gt;    no_of_employees = no_of_employees + 1.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD lif_employee~add_employee.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Adds a new employee to the list of employees&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: l_employee TYPE t_employee.&lt;/P&gt;&lt;P&gt;    l_employee-no = im_no.&lt;/P&gt;&lt;P&gt;    l_employee-name = im_name.&lt;/P&gt;&lt;P&gt;    l_employee-wage = im_wage.&lt;/P&gt;&lt;P&gt;    APPEND l_employee TO i_employee_list.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Raise event employee_added_to_list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    RAISE EVENT employee_added_to_list&lt;/P&gt;&lt;P&gt;       EXPORTING ex_employee_name =  l_employee-name.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD display_employee_list.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Displays all employees and there wage&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DATA: l_employee TYPE t_employee.&lt;/P&gt;&lt;P&gt;    WRITE: / 'List of Employees'.&lt;/P&gt;&lt;P&gt;    LOOP AT i_employee_list INTO l_employee.&lt;/P&gt;&lt;P&gt;      WRITE: / l_employee-no, l_employee-name, l_employee-wage.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD display_no_of_employees.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Displays total number of employees&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    SKIP 3.&lt;/P&gt;&lt;P&gt;    WRITE: / 'Total number of employees:', no_of_employees.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;  METHOD on_employee_added_to_list.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Event method&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    WRITE: / 'Employee added to list', ex_employee_name.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Sub class LCL_BlueCollar_Employee&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_bluecollar_employee DEFINITION&lt;/P&gt;&lt;P&gt;          INHERITING FROM lcl_company_employees.&lt;/P&gt;&lt;P&gt; See code in example 3...&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;CLASS lcl_bluecollar_employee IMPLEMENTATION.&lt;/P&gt;&lt;P&gt; See code in example 3...&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Sub class LCL_WhiteCollar_Employee&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;P&gt;CLASS lcl_whitecollar_employee DEFINITION&lt;/P&gt;&lt;P&gt; See code in example 3...&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;CLASS lcl_whitecollar_employee IMPLEMENTATION.&lt;/P&gt;&lt;P&gt; See code in example 3...&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;R E P O R T&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*******************************************************&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Object references&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  o_bluecollar_employee1  TYPE REF TO lcl_bluecollar_employee,&lt;/P&gt;&lt;P&gt;  o_whitecollar_employee1 TYPE REF TO lcl_whitecollar_employee.&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create bluecollar employee obeject&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE OBJECT o_bluecollar_employee1&lt;/P&gt;&lt;P&gt;      EXPORTING im_no  = 1&lt;/P&gt;&lt;P&gt;                im_name  = 'Karen Johnson'&lt;/P&gt;&lt;P&gt;                im_hours = 38&lt;/P&gt;&lt;P&gt;                im_hourly_payment = 75.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Register event for o_bluecollar_employee1&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  SET HANDLER o_bluecollar_employee1-&amp;gt;on_employee_added_to_list&lt;/P&gt;&lt;P&gt;     FOR o_bluecollar_employee1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Add bluecollar employee to employee list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD o_bluecollar_employee1-&amp;gt;lif_employee~add_employee&lt;/P&gt;&lt;P&gt;      EXPORTING im_no  = 1&lt;/P&gt;&lt;P&gt;                im_name  = 'Gylle Karen'&lt;/P&gt;&lt;P&gt;                im_wage = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create whitecollar employee obeject&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE OBJECT o_whitecollar_employee1&lt;/P&gt;&lt;P&gt;      EXPORTING im_no  = 2&lt;/P&gt;&lt;P&gt;                im_name  = 'John Dickens'&lt;/P&gt;&lt;P&gt;                im_monthly_salary = 10000&lt;/P&gt;&lt;P&gt;                im_monthly_deductions = 2500.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Register event for o_whitecollar_employee1&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  SET HANDLER o_whitecollar_employee1-&amp;gt;on_employee_added_to_list&lt;/P&gt;&lt;P&gt;     FOR o_whitecollar_employee1.´&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Add bluecollar employee to employee list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD o_whitecollar_employee1-&amp;gt;lif_employee~add_employee&lt;/P&gt;&lt;P&gt;      EXPORTING im_no  = 1&lt;/P&gt;&lt;P&gt;                im_name  = 'Gylle Karen'&lt;/P&gt;&lt;P&gt;                im_wage = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Display employee list and number of employees. Note that the result&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;will be the same when called from o_whitecollar_employee1 or&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;o_bluecolarcollar_employee1, because the methods are defined&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;as static (CLASS-METHODS)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD o_whitecollar_employee1-&amp;gt;display_employee_list.&lt;/P&gt;&lt;P&gt;  CALL METHOD o_whitecollar_employee1-&amp;gt;display_no_of_employees.&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Employee added to list Karen Johnson &lt;/P&gt;&lt;P&gt;Employee added to list John Dickens &lt;/P&gt;&lt;P&gt;List of Employees &lt;/P&gt;&lt;P&gt;1 Karen Johnson 2.850 &lt;/P&gt;&lt;P&gt;2 John Dickens 7.500 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Total number of employees: 2 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;General&lt;/P&gt;&lt;P&gt;Control Framework and enheritance hierarchy&lt;/P&gt;&lt;P&gt;The control framework consists of 2 parts:&lt;/P&gt;&lt;P&gt;&amp;#149;	CL_GUI_CFW contains methods that provide services for communication with the frontend, and can be used both by control wrapper calsses and by control progtrammers &lt;/P&gt;&lt;P&gt;&amp;#149;	The CL_GUI_OBJECT encapsulates ActiveX or JavaBeans methods, while CL_GUI_CONTROL is responsible for displaying the control on the screen. &lt;/P&gt;&lt;P&gt;CL_GUI_OBJECT -&amp;gt; CL_GUI_CONTROL -&amp;gt; CL_GUI_* (Wrapper class)&lt;/P&gt;&lt;P&gt;These classes contains methods that are enherited by subsequent classes in the enheritance tree.&lt;/P&gt;&lt;P&gt;Synchronization/Flush&lt;/P&gt;&lt;P&gt;RFC calls is used to synchronize the front and backend. This synchronization takes palce at some predifined points in the program flow. However you should not rely entirely on automatic synchronization, but force synchronization with the Flush method when necessary.&lt;/P&gt;&lt;P&gt;Bear in mind that the synchronization/RFC calls represenmts a bottleneck, so you should keep the not use the Flush method to a minimum.&lt;/P&gt;&lt;P&gt;Syntax:&lt;/P&gt;&lt;P&gt;CALL METHOD cl_gui_cfw=&amp;gt;FLUSH&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Set up event handling for controls&lt;/P&gt;&lt;P&gt;There are two types of events:&lt;/P&gt;&lt;P&gt;Application events. T&lt;/P&gt;&lt;P&gt;The flow logic of the screen is processed after the event (The PAI module is processed). &lt;/P&gt;&lt;P&gt;In the events table the event must be registred as an application event by setting then field appl_event to 'X':&lt;/P&gt;&lt;P&gt;wa_events-eventid = cl_gui_textedit=&amp;gt;event_double_click.&lt;/P&gt;&lt;P&gt;wa_events-appl_event = 'X'. &lt;/P&gt;&lt;P&gt;append wa_events to i_events.&lt;/P&gt;&lt;P&gt;Important: The dispatch method of cl_gui_cfw must be called in the PAI module:&lt;/P&gt;&lt;P&gt;CALL METHOD cl_gui_cfw=&amp;gt;dispatch. &lt;/P&gt;&lt;P&gt;System events. &lt;/P&gt;&lt;P&gt;For system events the flow-logic of the screen is not executed. That means that the PAI and PBO modules are not processed.&lt;/P&gt;&lt;P&gt;In the events table the the field appl_event must be set to SAPCE:&lt;/P&gt;&lt;P&gt;wa_events-eventid = cl_gui_textedit=&amp;gt;event_double_click.&lt;/P&gt;&lt;P&gt;wa_events-appl_event = space. &lt;/P&gt;&lt;P&gt;append wa_events to i_events.&lt;/P&gt;&lt;P&gt;The dispatch method of cl_gui_cfw must NOT be called.&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;It is presumed that a SAP toolbar control named go_toolbar of class cl_gui_toolbar has been defined. To see a complete example of how to handle events, refer to The SAP toolbar control.&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;1.  Define and instance of the eventhandler class.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     If the event handler class is defined after the data decalaration&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     the class must be declared as DEFERRED in the top of the program:  CLASS cls_event_handler DEFINITION DEFERRED.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  go_event_handler TYPE REF TO cls_event_handler,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;2. Define table for registration of events. &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Note that a TYPE REF   to cls_event_handler must be created before you can&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    reference types cntl_simple_events and cntl_simple_event&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  gi_events TYPE cntl_simple_events,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Workspace for table gi_events&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  g_event TYPE cntl_simple_event.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;3. Define and implement eventhandler class&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CLASS cls_event_handler DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Syntax:&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    &amp;lt;method name&amp;gt; FOR EVENT &amp;lt;event of control - see the control documentation&amp;gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        OF &amp;lt;class of object&amp;gt; &amp;lt;importing parameters l - see the control documentation&amp;gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      on_function_selected&lt;/P&gt;&lt;P&gt;        FOR EVENT function_selected OF cl_gui_toolbar&lt;/P&gt;&lt;P&gt;          IMPORTING fcode,&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;CLASS cls_event_handler IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;   METHOD on_function_selected.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Do something when the event is raised&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;4. Append events to the events table&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    The Event Id  can be found in the control documentation. Note that The event below is registred as an application event&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; g_event-eventid         = go_toolbar-&amp;gt;m_id_function_selected.&lt;/P&gt;&lt;P&gt; g_event-appl_event   = 'X'.    "This is an application event&lt;/P&gt;&lt;P&gt;APPEND g_event TO gi_events.&lt;/P&gt;&lt;P&gt;.... append more events i necessary...&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;5. Use the events table to register events for the control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL METHOD go_toolbar-&amp;gt;set_registered_events&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;           events = gi_events.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;6. Create event handler&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CREATE OBJECT   go_event_handler.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Syntax:&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;SET HANDLER &amp;lt;event handler class&amp;gt; -&amp;gt; &amp;lt;Event handler method&amp;gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  FOR &amp;lt;control&amp;gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;SET HANDLER go_event_handler-&amp;gt;on_function_selected&lt;/P&gt;&lt;P&gt;      FOR go_toolbar.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Declare a reference variable before the class has been defined&lt;/P&gt;&lt;P&gt;Scenario:&lt;/P&gt;&lt;P&gt;DATA: o_my_class TYPE REF TO lcl_myclass.&lt;/P&gt;&lt;P&gt;CLASS lcl_myclass.....&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;This will cause an error because the definition of class lcl_myclass is after the declaration.&lt;/P&gt;&lt;P&gt;Solution:&lt;/P&gt;&lt;P&gt;Define the class in the beginning of the program with DEFINITION DEFERRED:&lt;/P&gt;&lt;P&gt;CLASS lcl_myclass DEFINITION DEFERRED.&lt;/P&gt;&lt;P&gt;DATA: o_my_class TYPE REF TO lcl_myclass.&lt;/P&gt;&lt;P&gt;CLASS lcl_myclass.....&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Set focus to a control&lt;/P&gt;&lt;P&gt;Set the focus to a control named go_grid:&lt;/P&gt;&lt;P&gt;CALL METHOD cl_gui_control=&amp;gt;set_focus &lt;/P&gt;&lt;P&gt;  EXPORTING control = go_grid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To Use BADI - Business Add In you need to Understand ABAP OO Interface Concept &lt;/P&gt;&lt;P&gt;Content Author:  Jayanta Narayan Choudhuri &lt;/P&gt;&lt;P&gt;Author Email:      sss@cal.vsnl.net.in &lt;/P&gt;&lt;P&gt;Author Website:  &lt;A href="http://www.geocities.com/ojnc" target="test_blank"&gt;http://www.geocities.com/ojnc&lt;/A&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;For Rajat's OO ans BAdI Education &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Report Z_CTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;A Shape Interface "Like a shape" "Behaves like a Shape" &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Adverb/Adjective&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Interface IShape.&lt;/P&gt;&lt;P&gt;Methods:  getArea Returning Value(area) Type F,&lt;/P&gt;&lt;P&gt;          getCircumference Returning Value(circumference) Type F.&lt;/P&gt;&lt;P&gt;Endinterface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;A Circle Class that behaves like a Shape&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Class CCircle Definition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Public Section.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        Interfaces IShape.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        Aliases:   getArea For IShape~getArea,&lt;/P&gt;&lt;P&gt;                   getCircumference For IShape~getCircumference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        Methods:   Constructor Importing pRadius Type F,&lt;/P&gt;&lt;P&gt;                   setRadius   Importing pRadius Type F,&lt;/P&gt;&lt;P&gt;                   getRadius   Returning Value(pRadius) Type F.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Private Section.&lt;/P&gt;&lt;P&gt;        Data radius Type F.&lt;/P&gt;&lt;P&gt;        Constants PI Type F Value '3.141592365359'.&lt;/P&gt;&lt;P&gt;EndClass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Class CCircle Implementation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Method Constructor.&lt;/P&gt;&lt;P&gt;        radius = pRadius.&lt;/P&gt;&lt;P&gt;    EndMethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Method setRadius.&lt;/P&gt;&lt;P&gt;        radius = pRadius.&lt;/P&gt;&lt;P&gt;    EndMethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Method getRadius.&lt;/P&gt;&lt;P&gt;        pRadius = radius.&lt;/P&gt;&lt;P&gt;    EndMethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Method IShape~getArea.&lt;/P&gt;&lt;P&gt;        Compute area = 2 * PI * radius.&lt;/P&gt;&lt;P&gt;    EndMethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Method IShape~getCircumference.&lt;/P&gt;&lt;P&gt;        Compute circumference = PI * radius * radius.&lt;/P&gt;&lt;P&gt;    EndMethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EndClass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;A Square Class&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Class CSquare Definition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Public Section.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        Interfaces IShape.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        Aliases:   getArea For IShape~getArea,&lt;/P&gt;&lt;P&gt;                   getCircumference For IShape~getCircumference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        Methods:   Constructor Importing pSide Type F.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Private Section.&lt;/P&gt;&lt;P&gt;        Data side Type F.&lt;/P&gt;&lt;P&gt;EndClass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Class CSquare Implementation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Method Constructor.&lt;/P&gt;&lt;P&gt;        side = pSide.&lt;/P&gt;&lt;P&gt;    EndMethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Method IShape~getArea.&lt;/P&gt;&lt;P&gt;        Compute area = side * side.&lt;/P&gt;&lt;P&gt;    EndMethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Method IShape~getCircumference.&lt;/P&gt;&lt;P&gt;        Compute circumference = 4 * side.&lt;/P&gt;&lt;P&gt;    EndMethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EndClass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;A Rectangle Class&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Class CRectangle Definition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Public Section.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        Interfaces IShape.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        Aliases:   getArea For IShape~getArea,&lt;/P&gt;&lt;P&gt;                   getCircumference For IShape~getCircumference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        Methods:   Constructor Importing pHeight Type F&lt;/P&gt;&lt;P&gt;                                         pLength Type F.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Private Section.&lt;/P&gt;&lt;P&gt;        Data: height Type F,&lt;/P&gt;&lt;P&gt;              length Type F.&lt;/P&gt;&lt;P&gt;EndClass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Class CRectangle Implementation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Method Constructor.&lt;/P&gt;&lt;P&gt;        height = pHeight.&lt;/P&gt;&lt;P&gt;        length = pLength.&lt;/P&gt;&lt;P&gt;    EndMethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Method IShape~getArea.&lt;/P&gt;&lt;P&gt;        Compute area = height * length.&lt;/P&gt;&lt;P&gt;    EndMethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Method IShape~getCircumference.&lt;/P&gt;&lt;P&gt;        Compute circumference = 2 * ( height + length ).&lt;/P&gt;&lt;P&gt;    EndMethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EndClass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;START of PROGRAM&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Array of Shapes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Data:  OneShape   Type Ref To IShape,             " One Object with &lt;/P&gt;&lt;P&gt;Shape Behaviour&lt;/P&gt;&lt;P&gt;       ShapeTable Type Table Of Ref To IShape.    " Array of Objects &lt;/P&gt;&lt;P&gt;with Shape Behaviour&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Concrete Objects with IShape Behaviour!&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Data:  C1 Type Ref To CCircle,&lt;/P&gt;&lt;P&gt;       S1 Type Ref To CSquare,&lt;/P&gt;&lt;P&gt;       R1 Type Ref To CRectangle,&lt;/P&gt;&lt;P&gt;       C2 Type Ref To CCircle,&lt;/P&gt;&lt;P&gt;       S2 Type Ref To CSquare,&lt;/P&gt;&lt;P&gt;       R2 Type Ref To CRectangle.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:  descr_ref  TYPE ref to CL_ABAP_TYPEDESCR,&lt;/P&gt;&lt;P&gt;       ClassName  Type String,&lt;/P&gt;&lt;P&gt;       Serial     Type I.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:  myArea          Type F,&lt;/P&gt;&lt;P&gt;       myCircumference Type F.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;    Create Object C1 Exporting pRadius = '2.5'.&lt;/P&gt;&lt;P&gt;    Create Object C2 Exporting pRadius = '5.0'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Create Object S1 Exporting pSide = '3.5'.&lt;/P&gt;&lt;P&gt;    Create Object S2 Exporting pSide = '6.0'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Create Object R1 Exporting pHeight = '2.8' pLength = '3.4'.&lt;/P&gt;&lt;P&gt;    Create Object R2 Exporting pHeight = '1.7' pLength = '6.3'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Append in any order!&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    Append S1  to ShapeTable.&lt;/P&gt;&lt;P&gt;    Append R2  to ShapeTable.&lt;/P&gt;&lt;P&gt;    Append R1  to ShapeTable.&lt;/P&gt;&lt;P&gt;    Append C2  to ShapeTable.&lt;/P&gt;&lt;P&gt;    Append C1  to ShapeTable.&lt;/P&gt;&lt;P&gt;    Append S2  to ShapeTable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Serial = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Loop At ShapeTable into OneShape.&lt;/P&gt;&lt;P&gt;       Call Method OneShape-&amp;gt;getArea&lt;/P&gt;&lt;P&gt;                             Receiving area = myArea.&lt;/P&gt;&lt;P&gt;       Call Method OneShape-&amp;gt;getCircumference&lt;/P&gt;&lt;P&gt;                             Receiving circumference = myCircumference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       descr_ref = CL_ABAP_TYPEDESCR=&amp;gt;Describe_By_Object_Ref( OneShape &lt;/P&gt;&lt;P&gt;).&lt;/P&gt;&lt;P&gt;       Call Method descr_ref-&amp;gt;get_relative_name&lt;/P&gt;&lt;P&gt;                   Receiving P_RELATIVE_NAME = ClassName.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       Add 1 to Serial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       Write: / Serial,  ClassName.&lt;/P&gt;&lt;P&gt;       Write: / 'Area          ',  myArea          Decimals 4 Exponent &lt;/P&gt;&lt;P&gt;0.&lt;/P&gt;&lt;P&gt;       Write: / 'Circumference ',  myCircumference Decimals 4 Exponent &lt;/P&gt;&lt;P&gt;0.&lt;/P&gt;&lt;P&gt;       Write: /.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    EndLoop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;Results    &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          1  CSQUARE                        &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Area                            12.2500    &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Circumference                   14.0000    &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          2  CRECTANGLE                     &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Area                            10.7100    &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Circumference                   16.0000    &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          3  CRECTANGLE                     &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Area                             9.5200    &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Circumference                   12.4000    &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          4  CCIRCLE                        &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Area                            31.4159    &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Circumference                   78.5398    &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          5  CCIRCLE                        &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Area                            15.7080    &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Circumference                   19.6350    &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          6  CSQUARE                        &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Area                            36.0000    &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Circumference                   24.0000&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example 1: Creating the TextEdit control&lt;/P&gt;&lt;P&gt;This is a simple example of how to implement a text edit control.&lt;/P&gt;&lt;P&gt;Steps&lt;/P&gt;&lt;P&gt;1.	Create a report &lt;/P&gt;&lt;P&gt;2.	In the start of selection event add: SET SCREEN '100'. &lt;/P&gt;&lt;P&gt;3.	Create screen 100 &lt;/P&gt;&lt;P&gt;4.	Place a custom control on the screen by choosing the custom control icon which can be recognized by the letter 'C', and give it the name MYCONTAINER1. &lt;/P&gt;&lt;P&gt;5.	To be able to exit the program, add a pushbutton with the function code EXIT. &lt;/P&gt;&lt;P&gt;6.	In the elements list enter the name OK_CODE for the element of type OK. &lt;/P&gt;&lt;P&gt;The code&lt;/P&gt;&lt;P&gt;REPORT sapmz_hf_controls1 .&lt;/P&gt;&lt;P&gt;CONSTANTS:&lt;/P&gt;&lt;P&gt;  line_length TYPE i VALUE 254.&lt;/P&gt;&lt;P&gt;DATA: ok_code LIKE sy-ucomm.&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create reference to the custom container&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  custom_container TYPE REF TO cl_gui_custom_container,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create reference to the TextEdit control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  editor TYPE REF TO cl_gui_textedit,&lt;/P&gt;&lt;P&gt;  repid LIKE sy-repid.&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  SET SCREEN '100'.&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;      MODULE USER_COMMAND_0100 INPUT                                *&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;MODULE user_command_0100 INPUT.&lt;/P&gt;&lt;P&gt;  CASE ok_code.&lt;/P&gt;&lt;P&gt;    WHEN 'EXIT'.&lt;/P&gt;&lt;P&gt;      LEAVE TO SCREEN 0.&lt;/P&gt;&lt;P&gt;  ENDCASE.&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " USER_COMMAND_0100  INPUT&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;      Module  STATUS_0100  OUTPUT&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;MODULE status_0100 OUTPUT.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The TextEdit control shoul only be initialized the first time the&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;PBO module executes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  IF editor IS INITIAL.&lt;/P&gt;&lt;P&gt;    repid = sy-repid.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Create obejct for custom container&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CREATE OBJECT custom_container&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        container_name              = 'MYCONTAINER1'&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        cntl_error                  = 1&lt;/P&gt;&lt;P&gt;        cntl_system_error           = 2&lt;/P&gt;&lt;P&gt;        create_error                = 3&lt;/P&gt;&lt;P&gt;        lifetime_error              = 4&lt;/P&gt;&lt;P&gt;        lifetime_dynpro_dynpro_link = 5&lt;/P&gt;&lt;P&gt;        others                      = 6&lt;/P&gt;&lt;P&gt;        .&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Create obejct for the TextEditor control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CREATE OBJECT editor&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;         wordwrap_mode          =&lt;/P&gt;&lt;P&gt;                cl_gui_textedit=&amp;gt;wordwrap_at_fixed_position&lt;/P&gt;&lt;P&gt;         wordwrap_position      = line_length&lt;/P&gt;&lt;P&gt;         wordwrap_to_linebreak_mode = cl_gui_textedit=&amp;gt;true&lt;/P&gt;&lt;P&gt;        parent                  = custom_container&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        error_cntl_create      = 1&lt;/P&gt;&lt;P&gt;        error_cntl_init        = 2&lt;/P&gt;&lt;P&gt;        error_cntl_link        = 3&lt;/P&gt;&lt;P&gt;        error_dp_create        = 4&lt;/P&gt;&lt;P&gt;        gui_type_not_supported = 5&lt;/P&gt;&lt;P&gt;        others                 = 6&lt;/P&gt;&lt;P&gt;        .&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " STATUS_0100  OUTPUT&lt;/P&gt;&lt;P&gt;The result&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Example 2: Event handling - Application event&lt;/P&gt;&lt;P&gt;There are 2 types of events:&lt;/P&gt;&lt;P&gt;&amp;#149;	System events. These events are triggerede irrespective of the screen flow-logic. &lt;/P&gt;&lt;P&gt;&amp;#149;	Application events. The PAI module is processed after an event. The method CL_GUI_CFW=&amp;gt;DISPATCH must be called to initiate event handling &lt;/P&gt;&lt;P&gt;In this example an application event is added to the program in example 1. New code is marked with red.&lt;/P&gt;&lt;P&gt;Steps:&lt;/P&gt;&lt;P&gt;1.	Create an input/output field on screen 100, where the event type can be output. Name it EVENT_TYPE &lt;/P&gt;&lt;P&gt;The code:&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;REPORT sapmz_hf_controls1 .&lt;/P&gt;&lt;P&gt;CONSTANTS:&lt;/P&gt;&lt;P&gt;  line_length TYPE i VALUE 254.&lt;/P&gt;&lt;P&gt;DATA: ok_code LIKE sy-ucomm.&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create reference to the custom container&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  custom_container TYPE REF TO cl_gui_custom_container,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create reference to the TextEdit control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  editor TYPE REF TO cl_gui_textedit,&lt;/P&gt;&lt;P&gt;  repid LIKE sy-repid.&lt;/P&gt;&lt;P&gt;**********************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Impmenting events&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;**********************************************************************&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;  event_type(20) TYPE c,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal table for events that should be registred&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  i_events TYPE cntl_simple_events,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Structure for oneline of the table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  wa_events TYPE cntl_simple_event.&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 lcl_event_handler 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;CLASS lcl_event_handler DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    CLASS-METHODS:&lt;/P&gt;&lt;P&gt;      catch_dblclick FOR EVENT dblclick&lt;/P&gt;&lt;P&gt;         OF cl_gui_textedit IMPORTING sender.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;CLASS lcl_event_handler IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD catch_dblclick.&lt;/P&gt;&lt;P&gt;    event_type = 'Event DBLCLICK raised'.&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;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  CLEAR wa_events. refresh i_events.&lt;/P&gt;&lt;P&gt;  SET SCREEN '100'.&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;      MODULE USER_COMMAND_0100 INPUT                                *&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;MODULE user_command_0100 INPUT.&lt;/P&gt;&lt;P&gt;  CASE ok_code.&lt;/P&gt;&lt;P&gt;    WHEN 'EXIT'.&lt;/P&gt;&lt;P&gt;      LEAVE TO SCREEN 0.&lt;/P&gt;&lt;P&gt;    WHEN OTHERS.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Call the Dispacth method to initiate application event handling&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    call method cl_gui_cfw=&amp;gt;Dispatch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDCASE.&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " USER_COMMAND_0100  INPUT&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;      Module  STATUS_0100  OUTPUT&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;MODULE status_0100 OUTPUT.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The TextEdit control shoul only be initialized the first time the&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;PBO module executes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  IF editor IS INITIAL.&lt;/P&gt;&lt;P&gt;    repid = sy-repid.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Create obejct for custom container&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CREATE OBJECT custom_container&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        container_name              = 'MYCONTAINER1'&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        cntl_error                  = 1&lt;/P&gt;&lt;P&gt;        cntl_system_error           = 2&lt;/P&gt;&lt;P&gt;        create_error                = 3&lt;/P&gt;&lt;P&gt;        lifetime_error              = 4&lt;/P&gt;&lt;P&gt;        lifetime_dynpro_dynpro_link = 5&lt;/P&gt;&lt;P&gt;        others                      = 6&lt;/P&gt;&lt;P&gt;        .&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Create obejct for the TextEditor control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CREATE OBJECT editor&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;         wordwrap_mode          =&lt;/P&gt;&lt;P&gt;                cl_gui_textedit=&amp;gt;wordwrap_at_fixed_position&lt;/P&gt;&lt;P&gt;         wordwrap_position      = line_length&lt;/P&gt;&lt;P&gt;         wordwrap_to_linebreak_mode = cl_gui_textedit=&amp;gt;true&lt;/P&gt;&lt;P&gt;        parent                  = custom_container&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        error_cntl_create      = 1&lt;/P&gt;&lt;P&gt;        error_cntl_init        = 2&lt;/P&gt;&lt;P&gt;        error_cntl_link        = 3&lt;/P&gt;&lt;P&gt;        error_dp_create        = 4&lt;/P&gt;&lt;P&gt;        gui_type_not_supported = 5&lt;/P&gt;&lt;P&gt;        others                 = 6&lt;/P&gt;&lt;P&gt;        .&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Link the event handler method to the event and the&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  TextEdit control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    SET HANDLER lcl_event_handler=&amp;gt;catch_dblclick FOR editor.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Register the event in the internal table i_events&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    wa_events-eventid = cl_gui_textedit=&amp;gt;event_double_click.&lt;/P&gt;&lt;P&gt;    wa_events-appl_event = 'X'. "This is an application event&lt;/P&gt;&lt;P&gt;    append wa_events to i_events.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Pass the table to the TextEdit control using method&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  set_registred_events&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    call method editor-&amp;gt;set_registered_events&lt;/P&gt;&lt;P&gt;       exporting events = i_events.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " STATUS_0100  OUTPUT&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;When you double click on the TextEdit control, the input/ouput field should show the text: Event DBLCLICK&lt;/P&gt;&lt;P&gt;Example 3: Event handling - System event&lt;/P&gt;&lt;P&gt;System events are passed irrespective of the flow-logic of the screen. To implement a system event change the code from example 2 as follows:&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;CLASS lcl_event_handler IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD catch_dblclick.&lt;/P&gt;&lt;P&gt;*---  event_type = 'Event DBLCLICK raised'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Reacting to the system event&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call method cl_gui_cfw=&amp;gt;set_new_ok_code&lt;/P&gt;&lt;P&gt;    exporting new_code = 'SHOW'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;MODULE user_command_0100 INPUT.&lt;/P&gt;&lt;P&gt;  CASE ok_code.&lt;/P&gt;&lt;P&gt;   code.........&lt;/P&gt;&lt;P&gt;    WHEN 'SHOW'.&lt;/P&gt;&lt;P&gt;      event_type = 'System dblclick'.&lt;/P&gt;&lt;P&gt;    WHEN OTHERS.&lt;/P&gt;&lt;P&gt;*----    call method cl_gui_cfw=&amp;gt;Dispatch.&lt;/P&gt;&lt;P&gt;  ENDCASE.&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " USER_COMMAND_0100  INPUT&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;MODULE status_0100 OUTPUT.&lt;/P&gt;&lt;P&gt; Code ................&lt;/P&gt;&lt;P&gt;*---    wa_events-appl_event = 'X'. "This is an application event&lt;/P&gt;&lt;P&gt;    wa_events-appl_event = space. "This is a system event&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " STATUS_0100  OUTPUT&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;When you double clicks on the TextEdit control nothing happens, since the flow-logic of the screen an dthe fielde transport is ignore.&lt;/P&gt;&lt;P&gt;Example 4: Calling methods of the control&lt;/P&gt;&lt;P&gt;In this exercise a function that loads the texts of an internal table into the text window, is implemented.&lt;/P&gt;&lt;P&gt;Steps:&lt;/P&gt;&lt;P&gt;Define anoterh pushbutton on the screen, that activates the method that fills the TextEdit control. Give itname PUSHBUTTON_IMPORT and function code IMP.&lt;/P&gt;&lt;P&gt;Define a form CREATE_TEXTS that carries out the text import.&lt;/P&gt;&lt;P&gt;Only changes to the code in example 2 is show.&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;MODULE user_command_0100 INPUT.&lt;/P&gt;&lt;P&gt;  CASE ok_code.&lt;/P&gt;&lt;P&gt;   code.........&lt;/P&gt;&lt;P&gt;    WHEN 'IMP'.&lt;/P&gt;&lt;P&gt;      perform load_texts. &lt;/P&gt;&lt;P&gt;  ENDCASE.&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " USER_COMMAND_0100  INPUT&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  load_texts&lt;/P&gt;&lt;P&gt;*&amp;amp;----&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;This form creates an internal table with texts. The the contents of&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;the table is instered into the TextEdit control using method&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;set_text_as_r3table&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;FORM load_texts.&lt;/P&gt;&lt;P&gt;  TYPES:&lt;/P&gt;&lt;P&gt;   BEGIN OF t_texttable,&lt;/P&gt;&lt;P&gt;     line(line_length) TYPE c,&lt;/P&gt;&lt;P&gt;   END OF t_texttable.&lt;/P&gt;&lt;P&gt;  DATA&lt;/P&gt;&lt;P&gt;    i_texttable TYPE TABLE OF t_texttable.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create internal table with texts&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  APPEND 'This a method that fills the TextEdit control' TO i_texttable.&lt;/P&gt;&lt;P&gt;  APPEND 'with a text.' TO i_texttable.&lt;/P&gt;&lt;P&gt;  DO 10 TIMES.&lt;/P&gt;&lt;P&gt;    APPEND 'hallo world !' TO i_texttable.&lt;/P&gt;&lt;P&gt;  ENDDO.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Load TextEdit control with texts&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD editor-&amp;gt;set_text_as_r3table&lt;/P&gt;&lt;P&gt;    EXPORTING table = i_texttable.&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Display an error message&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    EXIT.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;All methods that operates on controls are transferred to the frontend&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;by a RFC calls. the method FLUSH is used to determine when this is done.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD cl_gui_cfw=&amp;gt;flush.&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Display an error message&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDFORM.                    " create_texts&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Example 5: Responding to an event&lt;/P&gt;&lt;P&gt;When you double click on a text line in the TextEdit control, you want it to be prefixed with a '*'. &lt;/P&gt;&lt;P&gt;The line number of the TextEdit control that is double clicked, is retreived using method GET_SELECTION_POS. The internal text table is reloaded froim the TextEdit control with method GET_TEXT_AS_R3TABLE. The position of the double click in the TextEdit control is used to find the entry in the table, and the entry is prefixed with '*' and loaded into the TextEdit control again.&lt;/P&gt;&lt;P&gt;The program should be changed so that the internal table i_texttable is global, and a global flag g_loaded added. The load of the table should be moved to the PBO module. The changes in thje code are marked with red. The whole program now looks like this:&lt;/P&gt;&lt;P&gt;Code&lt;/P&gt;&lt;P&gt;REPORT sapmz_hf_controls1 .&lt;/P&gt;&lt;P&gt;CONSTANTS:&lt;/P&gt;&lt;P&gt;  line_length TYPE i VALUE 254.&lt;/P&gt;&lt;P&gt;DATA: ok_code LIKE sy-ucomm.&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create reference to the custom container&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  custom_container TYPE REF TO cl_gui_custom_container,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create reference to the TextEdit control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  editor TYPE REF TO cl_gui_textedit,&lt;/P&gt;&lt;P&gt;  repid LIKE sy-repid.&lt;/P&gt;&lt;P&gt;**********************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Utillity table to load texts&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;**********************************************************************&lt;/P&gt;&lt;P&gt;TYPES:&lt;/P&gt;&lt;P&gt;   BEGIN OF t_texttable,&lt;/P&gt;&lt;P&gt;     line(line_length) TYPE c,&lt;/P&gt;&lt;P&gt;   END OF t_texttable.&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;  i_texttable TYPE TABLE OF t_texttable,&lt;/P&gt;&lt;P&gt;  g_loaded(1) TYPE c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**********************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Impmenting events&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;**********************************************************************&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;  event_type(20) TYPE c,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal table for events that should be registred&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  i_events TYPE cntl_simple_events,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Structure for oneline of the table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  wa_events TYPE cntl_simple_event.&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 lcl_event_handler 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;CLASS lcl_event_handler DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    CLASS-METHODS:&lt;/P&gt;&lt;P&gt;      catch_dblclick FOR EVENT dblclick&lt;/P&gt;&lt;P&gt;         OF cl_gui_textedit IMPORTING sender.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;CLASS lcl_event_handler IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD catch_dblclick.&lt;/P&gt;&lt;P&gt;    DATA:&lt;/P&gt;&lt;P&gt;      from_line TYPE i,&lt;/P&gt;&lt;P&gt;      from_pos  TYPE i,&lt;/P&gt;&lt;P&gt;      to_line TYPE i,&lt;/P&gt;&lt;P&gt;      to_pos TYPE i,&lt;/P&gt;&lt;P&gt;      wa_texttable TYPE t_texttable.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Used for the sytem event&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call method cl_gui_cfw=&amp;gt;set_new_ok_code&lt;/P&gt;&lt;P&gt;    exporting new_code = 'SHOW'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Read the position of the double click&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL METHOD sender-&amp;gt;get_selection_pos&lt;/P&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;P&gt;         from_line = from_line&lt;/P&gt;&lt;P&gt;         from_pos  = from_pos&lt;/P&gt;&lt;P&gt;         to_line   = to_line&lt;/P&gt;&lt;P&gt;         to_pos    = to_pos.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Texts in the TextEdit control can have been changed, so&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  first reload text from the control into the internal&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  table that contains text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    IF NOT g_loaded IS INITIAL.&lt;/P&gt;&lt;P&gt;      CALL METHOD sender-&amp;gt;get_text_as_r3table&lt;/P&gt;&lt;P&gt;           IMPORTING table = i_texttable.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Read the line of the internal table that was clicked&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      READ TABLE i_texttable INDEX from_line INTO wa_texttable.&lt;/P&gt;&lt;P&gt;      IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;        EXIT.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;      IF wa_texttable+0(1) CS '*'.&lt;/P&gt;&lt;P&gt;        SHIFT wa_texttable.&lt;/P&gt;&lt;P&gt;      ELSEIF wa_texttable+0(1) NS '*'.&lt;/P&gt;&lt;P&gt;        SHIFT wa_texttable RIGHT.&lt;/P&gt;&lt;P&gt;        wa_texttable+0(1) = '*'.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;      modify i_texttable from wa_texttable index from_line.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Reload texts from h einternal table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      perform load_texts.&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;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  CLEAR wa_events.&lt;/P&gt;&lt;P&gt;  REFRESH: i_events.&lt;/P&gt;&lt;P&gt;  SET SCREEN '100'.&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;      MODULE USER_COMMAND_0100 INPUT                                *&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;MODULE user_command_0100 INPUT.&lt;/P&gt;&lt;P&gt;  CASE ok_code.&lt;/P&gt;&lt;P&gt;    WHEN 'EXIT'.&lt;/P&gt;&lt;P&gt;      LEAVE TO SCREEN 0.&lt;/P&gt;&lt;P&gt;    WHEN 'SHOW'.&lt;/P&gt;&lt;P&gt;      event_type = 'System dblclick'.&lt;/P&gt;&lt;P&gt;    WHEN 'IMP'.&lt;/P&gt;&lt;P&gt;      PERFORM Load_texts.&lt;/P&gt;&lt;P&gt;    WHEN OTHERS.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   CALL METHOD cl_gui_cfw=&amp;gt;dispatch. "Not used for system events&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDCASE.&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " USER_COMMAND_0100  INPUT&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;      Module  STATUS_0100  OUTPUT&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;MODULE status_0100 OUTPUT.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The TextEdit control shoul only be initialized the first time the&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;PBO module executes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  IF editor IS INITIAL.&lt;/P&gt;&lt;P&gt;    repid = sy-repid.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Create object for custom container&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CREATE OBJECT custom_container&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        container_name              = 'MYCONTAINER1'&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        cntl_error                  = 1&lt;/P&gt;&lt;P&gt;        cntl_system_error           = 2&lt;/P&gt;&lt;P&gt;        create_error                = 3&lt;/P&gt;&lt;P&gt;        lifetime_error              = 4&lt;/P&gt;&lt;P&gt;        lifetime_dynpro_dynpro_link = 5&lt;/P&gt;&lt;P&gt;        others                      = 6&lt;/P&gt;&lt;P&gt;        .&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Create obejct for the TextEditor control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CREATE OBJECT editor&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;         wordwrap_mode          =&lt;/P&gt;&lt;P&gt;                cl_gui_textedit=&amp;gt;wordwrap_at_fixed_position&lt;/P&gt;&lt;P&gt;         wordwrap_position      = line_length&lt;/P&gt;&lt;P&gt;         wordwrap_to_linebreak_mode = cl_gui_textedit=&amp;gt;true&lt;/P&gt;&lt;P&gt;        parent                  = custom_container&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        error_cntl_create      = 1&lt;/P&gt;&lt;P&gt;        error_cntl_init        = 2&lt;/P&gt;&lt;P&gt;        error_cntl_link        = 3&lt;/P&gt;&lt;P&gt;        error_dp_create        = 4&lt;/P&gt;&lt;P&gt;        gui_type_not_supported = 5&lt;/P&gt;&lt;P&gt;        others                 = 6&lt;/P&gt;&lt;P&gt;        .&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Link the event handler method to the event and the&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  TextEdit control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    SET HANDLER lcl_event_handler=&amp;gt;catch_dblclick FOR editor.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Register the event in the internal table i_events&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    wa_events-eventid = cl_gui_textedit=&amp;gt;event_double_click.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   wa_events-appl_event = 'X'. "This is an application event&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    wa_events-appl_event = space. "This is a system event&lt;/P&gt;&lt;P&gt;    APPEND wa_events TO i_events.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Pass the table to the TextEdit control uding method&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  set_registred_events&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL METHOD editor-&amp;gt;set_registered_events&lt;/P&gt;&lt;P&gt;       EXPORTING events = i_events.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create internal table with texts taht can be uploaded to&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;the TextEdit control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  APPEND 'This a method that fills the TextEdit control' TO i_texttable.&lt;/P&gt;&lt;P&gt;    APPEND 'with a text.' TO i_texttable.&lt;/P&gt;&lt;P&gt;    DO 10 TIMES.&lt;/P&gt;&lt;P&gt;      APPEND 'hallo world !' TO i_texttable.&lt;/P&gt;&lt;P&gt;    ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " STATUS_0100  OUTPUT&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form Load_texts&lt;/P&gt;&lt;P&gt;*&amp;amp;----&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;This form loads the lines of the internal table i_texttable into&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;the TextEdit control&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;FORM Load_texts.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Load TextEdit control with texts&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD editor-&amp;gt;set_text_as_r3table&lt;/P&gt;&lt;P&gt;    EXPORTING table = i_texttable.&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Display an error message&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    EXIT.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;All methods that operates on controls are transferred to the frontend&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;by a RFC calls. the method FLUSH is used to determine when this is&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;done.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD cl_gui_cfw=&amp;gt;flush.&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Display an error message&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;  g_loaded = 'X'.&lt;/P&gt;&lt;P&gt;ENDFORM.                    " create_texts&lt;/P&gt;&lt;P&gt;Example 6: Protect a line in the TextEdit control and the importance of FLUSH&lt;/P&gt;&lt;P&gt;All methods that operates on controls are transfered to the fronend by RFC calls. The FLUSH method is used to synchronize control execution and the frontend. This is very important when working e.g. with export parameters from a method, as the parmeters will not be correct before the FLUSH method has been called.&lt;/P&gt;&lt;P&gt;The example below portects selected lines in the TextEdit and uses FLUSH to ensure that the correct parameters are returned from method GET_SELECTION_POS. &lt;/P&gt;&lt;P&gt;Note: Instead of using method PROTECT_LINES, the method PROTECT_SELECTION could be used. This method does not need line numbers or a FLUSH statement&lt;/P&gt;&lt;P&gt;Steps&lt;/P&gt;&lt;P&gt;&amp;#149;	Add a new pushbutton to the screen with the function code PROTECT. &lt;/P&gt;&lt;P&gt;Code&lt;/P&gt;&lt;P&gt;Add the following code to the example:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Global variables&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;   from_idx TYPE i,&lt;/P&gt;&lt;P&gt;   to_idx TYPE i,&lt;/P&gt;&lt;P&gt;   index TYPE i.&lt;/P&gt;&lt;P&gt;MODULE user_command_0100 INPUT.&lt;/P&gt;&lt;P&gt;  CASE ok_code.&lt;/P&gt;&lt;P&gt;    code.......................&lt;/P&gt;&lt;P&gt;    WHEN 'PROTECT'.&lt;/P&gt;&lt;P&gt;      PERFORM protect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.    .......................&lt;/P&gt;&lt;P&gt;  ENDCASE.&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  protect&lt;/P&gt;&lt;P&gt;*&amp;amp;----&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;Protects marked lines in a TextEdit control&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;FORM protect.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Determine the area selected by the user&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD editor-&amp;gt;get_selection_pos&lt;/P&gt;&lt;P&gt;     IMPORTING&lt;/P&gt;&lt;P&gt;       from_line = from_idx&lt;/P&gt;&lt;P&gt;       to_line   = to_idx&lt;/P&gt;&lt;P&gt;     EXCEPTIONS&lt;/P&gt;&lt;P&gt;       error_cntl_call_method = 1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Synchronize execution in the control with the ABAP program.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Without this synchronization the variables from_idx and&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;to_idx will have obsolutete values (The initial value for&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;both, are 0)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD cl_gui_cfw=&amp;gt;flush.&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Errormessage: Error in flush&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Protect the selected lines&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  IF to_idx &amp;gt; from_idx.&lt;/P&gt;&lt;P&gt;    to_idx = to_idx - 1.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;  CALL METHOD editor-&amp;gt;protect_lines&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      from_line = from_idx&lt;/P&gt;&lt;P&gt;      to_line   = to_idx.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The PROTECT_SELECTION method could be used instead, eliminating the&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;need of line numbers and the last FLUSH&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;call method editor-&amp;gt;protect_selection.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Flush again to protect immidiately&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD cl_gui_cfw=&amp;gt;flush.&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Errormessage: Error in flush&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " protect&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Example 7: Using multiple controls&lt;/P&gt;&lt;P&gt;In this example a second TextEdit control will be added to the screen. The new TextEdit control will be designed to act as a clipboard for short texts.&lt;/P&gt;&lt;P&gt;Steps:&lt;/P&gt;&lt;P&gt;&amp;#149;	Add a new container to the screen and name it MYCONTAINER2. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;Insert global datadeclaration:&lt;/P&gt;&lt;P&gt;**********************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Implementing a second Scratch TextEdit control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;**********************************************************************&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;  scratch            TYPE REF TO cl_gui_textedit,&lt;/P&gt;&lt;P&gt;  custom_container2  TYPE REF TO cl_gui_custom_container.&lt;/P&gt;&lt;P&gt;Insert the following code in the PBO module:&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The SCRATCH TextEdit control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------------------------------" /&gt;&lt;P&gt;  IF scratch IS INITIAL.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Create obejct for custom container2&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CREATE OBJECT custom_container2&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        container_name              = 'MYCONTAINER2'&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        cntl_error                  = 1&lt;/P&gt;&lt;P&gt;        cntl_system_error           = 2&lt;/P&gt;&lt;P&gt;        create_error                = 3&lt;/P&gt;&lt;P&gt;        lifetime_error              = 4&lt;/P&gt;&lt;P&gt;        lifetime_dynpro_dynpro_link = 5&lt;/P&gt;&lt;P&gt;        others                      = 6&lt;/P&gt;&lt;P&gt;        .&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Create obejct for the SCRATCH TextEditor control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CREATE OBJECT scratch&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;         parent         = custom_container2&lt;/P&gt;&lt;P&gt;         wordwrap_mode  =&lt;/P&gt;&lt;P&gt;                cl_gui_textedit=&amp;gt;wordwrap_at_windowborder&lt;/P&gt;&lt;P&gt;        wordwrap_to_linebreak_mode = cl_gui_textedit=&amp;gt;true.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Remove the staus bar&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL METHOD scratch-&amp;gt;set_statusbar_mode&lt;/P&gt;&lt;P&gt;      EXPORTING statusbar_mode = cl_gui_textedit=&amp;gt;false.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;1  REPORT sapmz_hf_controls1 .&lt;/P&gt;&lt;P&gt;      2 &lt;/P&gt;&lt;P&gt;      3  CONSTANTS:&lt;/P&gt;&lt;P&gt;      4    line_length TYPE i VALUE 254.&lt;/P&gt;&lt;P&gt;      5 &lt;/P&gt;&lt;P&gt;      6  DATA: ok_code LIKE sy-ucomm.&lt;/P&gt;&lt;P&gt;      7 &lt;/P&gt;&lt;P&gt;      8  DATA:&lt;/P&gt;&lt;P&gt;      9  * Create reference to the custom container&lt;/P&gt;&lt;P&gt;     10    custom_container TYPE REF TO cl_gui_custom_container,&lt;/P&gt;&lt;P&gt;     11  * Create reference to the TextEdit control&lt;/P&gt;&lt;P&gt;     12    editor TYPE REF TO cl_gui_textedit,&lt;/P&gt;&lt;P&gt;     13    repid LIKE sy-repid.&lt;/P&gt;&lt;P&gt;     14 &lt;/P&gt;&lt;P&gt;     15  **********************************************************************&lt;/P&gt;&lt;P&gt;     16  * Utillity table to load texts&lt;/P&gt;&lt;P&gt;     17  **********************************************************************&lt;/P&gt;&lt;P&gt;     18  TYPES:&lt;/P&gt;&lt;P&gt;     19     BEGIN OF t_texttable,&lt;/P&gt;&lt;P&gt;     20       line(line_length) TYPE c,&lt;/P&gt;&lt;P&gt;     21     END OF t_texttable.&lt;/P&gt;&lt;P&gt;     22 &lt;/P&gt;&lt;P&gt;     23  DATA:&lt;/P&gt;&lt;P&gt;     24    i_texttable TYPE TABLE OF t_texttable,&lt;/P&gt;&lt;P&gt;     25    wa_texttable TYPE t_texttable,&lt;/P&gt;&lt;P&gt;     26    g_loaded(1) TYPE c.&lt;/P&gt;&lt;P&gt;     27 &lt;/P&gt;&lt;P&gt;     28  **********************************************************************&lt;/P&gt;&lt;P&gt;     29  * Data for the protection example&lt;/P&gt;&lt;P&gt;     30  **********************************************************************&lt;/P&gt;&lt;P&gt;     31  DATA:&lt;/P&gt;&lt;P&gt;     32    from_idx TYPE i,&lt;/P&gt;&lt;P&gt;     33    to_idx   TYPE i,&lt;/P&gt;&lt;P&gt;     34    index    TYPE i.&lt;/P&gt;&lt;P&gt;     35 &lt;/P&gt;&lt;P&gt;     36  **********************************************************************&lt;/P&gt;&lt;P&gt;     37  * Implementing a second Scratch TextEdit control&lt;/P&gt;&lt;P&gt;     38  **********************************************************************&lt;/P&gt;&lt;P&gt;     39  DATA:&lt;/P&gt;&lt;P&gt;     40    scratch            TYPE REF TO cl_gui_textedit,&lt;/P&gt;&lt;P&gt;     41    custom_container2  TYPE REF TO cl_gui_custom_container.&lt;/P&gt;&lt;P&gt;     42 &lt;/P&gt;&lt;P&gt;     43 &lt;/P&gt;&lt;P&gt;     44  **********************************************************************&lt;/P&gt;&lt;P&gt;     45  * Implementing events&lt;/P&gt;&lt;P&gt;     46  **********************************************************************&lt;/P&gt;&lt;P&gt;     47  DATA:&lt;/P&gt;&lt;P&gt;     48    event_type(20) TYPE c,&lt;/P&gt;&lt;P&gt;     49  * Internal table for events that should be registred&lt;/P&gt;&lt;P&gt;     50    i_events TYPE cntl_simple_events,&lt;/P&gt;&lt;P&gt;     51  * Structure for oneline of the table&lt;/P&gt;&lt;P&gt;     52    wa_events TYPE cntl_simple_event.&lt;/P&gt;&lt;P&gt;     53 &lt;/P&gt;&lt;P&gt;     54  *----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;     55  *       CLASS lcl_event_handler DEFINITION&lt;/P&gt;&lt;P&gt;     56  *----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;     57  *       ........                                                      *&lt;/P&gt;&lt;P&gt;     58  *----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;     59  CLASS lcl_event_handler DEFINITION.&lt;/P&gt;&lt;P&gt;     60    PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;     61      CLASS-METHODS:&lt;/P&gt;&lt;P&gt;     62        catch_dblclick FOR EVENT dblclick&lt;/P&gt;&lt;P&gt;     63           OF cl_gui_textedit IMPORTING sender.&lt;/P&gt;&lt;P&gt;     64 &lt;/P&gt;&lt;P&gt;     65  ENDCLASS.&lt;/P&gt;&lt;P&gt;     66 &lt;/P&gt;&lt;P&gt;     67  *----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;     68  *       CLASS lcl_event_handler IMPLEMENTATION&lt;/P&gt;&lt;P&gt;     69  *----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;     70  *       ........                                                      *&lt;/P&gt;&lt;P&gt;     71  *----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;     72  CLASS lcl_event_handler IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;     73    METHOD catch_dblclick.&lt;/P&gt;&lt;P&gt;     74      DATA:&lt;/P&gt;&lt;P&gt;     75        from_line TYPE i,&lt;/P&gt;&lt;P&gt;     76        from_pos  TYPE i,&lt;/P&gt;&lt;P&gt;     77        to_line TYPE i,&lt;/P&gt;&lt;P&gt;     78        to_pos TYPE i.&lt;/P&gt;&lt;P&gt;     79 &lt;/P&gt;&lt;P&gt;     80 &lt;/P&gt;&lt;P&gt;     81  * Used for the sytem event&lt;/P&gt;&lt;P&gt;     82      CALL METHOD cl_gui_cfw=&amp;gt;set_new_ok_code&lt;/P&gt;&lt;P&gt;     83        EXPORTING new_code = 'SHOW'.&lt;/P&gt;&lt;P&gt;     84 &lt;/P&gt;&lt;P&gt;     85 &lt;/P&gt;&lt;P&gt;     86  * Read the position of the double click&lt;/P&gt;&lt;P&gt;     87      CALL METHOD sender-&amp;gt;get_selection_pos&lt;/P&gt;&lt;P&gt;     88        IMPORTING&lt;/P&gt;&lt;P&gt;     89           from_line = from_line&lt;/P&gt;&lt;P&gt;     90           from_pos  = from_pos&lt;/P&gt;&lt;P&gt;     91           to_line   = to_line&lt;/P&gt;&lt;P&gt;     92           to_pos    = to_pos.&lt;/P&gt;&lt;P&gt;     93 &lt;/P&gt;&lt;P&gt;     94  *   Texts in the TextEdit control can have been changed, so&lt;/P&gt;&lt;P&gt;     95  *   first reload text from the control into the internal&lt;/P&gt;&lt;P&gt;     96  *   table that contains text&lt;/P&gt;&lt;P&gt;     97      IF NOT g_loaded IS INITIAL.&lt;/P&gt;&lt;P&gt;     98        CALL METHOD sender-&amp;gt;get_text_as_r3table&lt;/P&gt;&lt;P&gt;     99             IMPORTING table = i_texttable.&lt;/P&gt;&lt;P&gt;    100  *   Read the line of the internal table that was clicked&lt;/P&gt;&lt;P&gt;    101        READ TABLE i_texttable INDEX from_line INTO wa_texttable.&lt;/P&gt;&lt;P&gt;    102        IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    103          EXIT.&lt;/P&gt;&lt;P&gt;    104        ENDIF.&lt;/P&gt;&lt;P&gt;    105 &lt;/P&gt;&lt;P&gt;    106        IF wa_texttable+0(1) CS '*'.&lt;/P&gt;&lt;P&gt;    107          SHIFT wa_texttable.&lt;/P&gt;&lt;P&gt;    108        ELSEIF wa_texttable+0(1) NS '*'.&lt;/P&gt;&lt;P&gt;    109          SHIFT wa_texttable RIGHT.&lt;/P&gt;&lt;P&gt;    110          wa_texttable+0(1) = '*'.&lt;/P&gt;&lt;P&gt;    111        ENDIF.&lt;/P&gt;&lt;P&gt;    112        MODIFY i_texttable FROM wa_texttable INDEX from_line.&lt;/P&gt;&lt;P&gt;    113  *     Reload texts from h einternal table&lt;/P&gt;&lt;P&gt;    114        PERFORM load_texts.&lt;/P&gt;&lt;P&gt;    115 &lt;/P&gt;&lt;P&gt;    116 &lt;/P&gt;&lt;P&gt;    117      ENDIF.&lt;/P&gt;&lt;P&gt;    118 &lt;/P&gt;&lt;P&gt;    119 &lt;/P&gt;&lt;P&gt;    120    ENDMETHOD.&lt;/P&gt;&lt;P&gt;    121  ENDCLASS.&lt;/P&gt;&lt;P&gt;    122 &lt;/P&gt;&lt;P&gt;    123 &lt;/P&gt;&lt;P&gt;    124 &lt;/P&gt;&lt;P&gt;    125  START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;    126    CLEAR wa_events.&lt;/P&gt;&lt;P&gt;    127    REFRESH: i_events.&lt;/P&gt;&lt;P&gt;    128 &lt;/P&gt;&lt;P&gt;    129    SET SCREEN '100'.&lt;/P&gt;&lt;P&gt;    130 &lt;/P&gt;&lt;P&gt;    131 &lt;/P&gt;&lt;P&gt;    132 &lt;/P&gt;&lt;P&gt;    133  *----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;    134  *       MODULE USER_COMMAND_0100 INPUT                                *&lt;/P&gt;&lt;P&gt;    135  *----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;    136  MODULE user_command_0100 INPUT.&lt;/P&gt;&lt;P&gt;    137 &lt;/P&gt;&lt;P&gt;    138    CASE ok_code.&lt;/P&gt;&lt;P&gt;    139      WHEN 'EXIT'.&lt;/P&gt;&lt;P&gt;    140        LEAVE TO SCREEN 0.&lt;/P&gt;&lt;P&gt;    141      WHEN 'SHOW'.&lt;/P&gt;&lt;P&gt;    142        event_type = 'System dblclick'.&lt;/P&gt;&lt;P&gt;    143      WHEN 'IMP'.&lt;/P&gt;&lt;P&gt;    144        PERFORM load_texts.&lt;/P&gt;&lt;P&gt;    145      WHEN 'PROTECT'.&lt;/P&gt;&lt;P&gt;    146        PERFORM protect.&lt;/P&gt;&lt;P&gt;    147 &lt;/P&gt;&lt;P&gt;    148      WHEN OTHERS.&lt;/P&gt;&lt;P&gt;    149  *    CALL METHOD cl_gui_cfw=&amp;gt;dispatch. "Not used for system events&lt;/P&gt;&lt;P&gt;    150    ENDCASE.&lt;/P&gt;&lt;P&gt;    151 &lt;/P&gt;&lt;P&gt;    152 &lt;/P&gt;&lt;P&gt;    153  ENDMODULE.                 " USER_COMMAND_0100  INPUT&lt;/P&gt;&lt;P&gt;    154  *&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;    155  *&amp;amp;      Module  STATUS_0100  OUTPUT&lt;/P&gt;&lt;P&gt;    156  *&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;    157  MODULE status_0100 OUTPUT.&lt;/P&gt;&lt;P&gt;    158  * The TextEdit control shoul only be initialized the first time the&lt;/P&gt;&lt;P&gt;    159  * PBO module executes&lt;/P&gt;&lt;P&gt;    160    IF editor IS INITIAL.&lt;/P&gt;&lt;P&gt;    161      repid = sy-repid.&lt;/P&gt;&lt;P&gt;    162  *   Create obejct for custom container&lt;/P&gt;&lt;P&gt;    163      CREATE OBJECT custom_container&lt;/P&gt;&lt;P&gt;    164        EXPORTING&lt;/P&gt;&lt;P&gt;    165          container_name              = 'MYCONTAINER1'&lt;/P&gt;&lt;P&gt;    166        EXCEPTIONS&lt;/P&gt;&lt;P&gt;    167          cntl_error                  = 1&lt;/P&gt;&lt;P&gt;    168          cntl_system_error           = 2&lt;/P&gt;&lt;P&gt;    169          create_error                = 3&lt;/P&gt;&lt;P&gt;    170          lifetime_error              = 4&lt;/P&gt;&lt;P&gt;    171          lifetime_dynpro_dynpro_link = 5&lt;/P&gt;&lt;P&gt;    172          others                      = 6&lt;/P&gt;&lt;P&gt;    173          .&lt;/P&gt;&lt;P&gt;    174      IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    175        MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;    176                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;    177      ENDIF.&lt;/P&gt;&lt;P&gt;    178 &lt;/P&gt;&lt;P&gt;    179  *   Create obejct for the TextEditor control&lt;/P&gt;&lt;P&gt;    180      CREATE OBJECT editor&lt;/P&gt;&lt;P&gt;    181        EXPORTING&lt;/P&gt;&lt;P&gt;    182 &lt;/P&gt;&lt;P&gt;    183           wordwrap_mode          =&lt;/P&gt;&lt;P&gt;    184                  cl_gui_textedit=&amp;gt;wordwrap_at_fixed_position&lt;/P&gt;&lt;P&gt;    185           wordwrap_position      = line_length&lt;/P&gt;&lt;P&gt;    186           wordwrap_to_linebreak_mode = cl_gui_textedit=&amp;gt;true&lt;/P&gt;&lt;P&gt;    187          parent                  = custom_container&lt;/P&gt;&lt;P&gt;    188        EXCEPTIONS&lt;/P&gt;&lt;P&gt;    189          error_cntl_create      = 1&lt;/P&gt;&lt;P&gt;    190          error_cntl_init        = 2&lt;/P&gt;&lt;P&gt;    191          error_cntl_link        = 3&lt;/P&gt;&lt;P&gt;    192          error_dp_create        = 4&lt;/P&gt;&lt;P&gt;    193          gui_type_not_supported = 5&lt;/P&gt;&lt;P&gt;    194          others                 = 6&lt;/P&gt;&lt;P&gt;    195          .&lt;/P&gt;&lt;P&gt;    196      IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    197        MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;    198                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;    199      ENDIF.&lt;/P&gt;&lt;P&gt;    200 &lt;/P&gt;&lt;P&gt;    201  *   Link the event handler method to the event and the&lt;/P&gt;&lt;P&gt;    202  *   TextEdit control&lt;/P&gt;&lt;P&gt;    203      SET HANDLER lcl_event_handler=&amp;gt;catch_dblclick FOR editor.&lt;/P&gt;&lt;P&gt;    204 &lt;/P&gt;&lt;P&gt;    205  *   Register the event in the internal table i_events&lt;/P&gt;&lt;P&gt;    206      wa_events-eventid = cl_gui_textedit=&amp;gt;event_double_click.&lt;/P&gt;&lt;P&gt;    207 &lt;/P&gt;&lt;P&gt;    208  *    wa_events-appl_event = 'X'. "This is an application event&lt;/P&gt;&lt;P&gt;    209      wa_events-appl_event = space. "This is a system event&lt;/P&gt;&lt;P&gt;    210 &lt;/P&gt;&lt;P&gt;    211 &lt;/P&gt;&lt;P&gt;    212      APPEND wa_events TO i_events.&lt;/P&gt;&lt;P&gt;    213  *   Pass the table to the TextEdit control uding method&lt;/P&gt;&lt;P&gt;    214  *   set_registred_events&lt;/P&gt;&lt;P&gt;    215      CALL METHOD editor-&amp;gt;set_registered_events&lt;/P&gt;&lt;P&gt;    216         EXPORTING events = i_events.&lt;/P&gt;&lt;P&gt;    217 &lt;/P&gt;&lt;P&gt;    218  * Create internal table with texts taht can be uploaded to&lt;/P&gt;&lt;P&gt;    219  * the TextEdit control&lt;/P&gt;&lt;P&gt;    220    APPEND 'This a method that fills the TextEdit control' TO i_texttable.&lt;/P&gt;&lt;P&gt;    221      APPEND 'with a text.' TO i_texttable.&lt;/P&gt;&lt;P&gt;    222      DO 10 TIMES.&lt;/P&gt;&lt;P&gt;    223        APPEND 'hallo world !' TO i_texttable.&lt;/P&gt;&lt;P&gt;    224      ENDDO.&lt;/P&gt;&lt;P&gt;    225    ENDIF.&lt;/P&gt;&lt;P&gt;    226 &lt;/P&gt;&lt;P&gt;    227  *----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------------------------------" /&gt;&lt;P&gt;    228  * The SCRATCH TextEdit control&lt;/P&gt;&lt;P&gt;    229  *----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------------------------------" /&gt;&lt;P&gt;    230    IF scratch IS INITIAL.&lt;/P&gt;&lt;P&gt;    231  *   Create obejct for custom container2&lt;/P&gt;&lt;P&gt;    232      CREATE OBJECT custom_container2&lt;/P&gt;&lt;P&gt;    233        EXPORTING&lt;/P&gt;&lt;P&gt;    234          container_name              = 'MYCONTAINER2'&lt;/P&gt;&lt;P&gt;    235        EXCEPTIONS&lt;/P&gt;&lt;P&gt;    236          cntl_error                  = 1&lt;/P&gt;&lt;P&gt;    237          cntl_system_error           = 2&lt;/P&gt;&lt;P&gt;    238          create_error                = 3&lt;/P&gt;&lt;P&gt;    239          lifetime_error              = 4&lt;/P&gt;&lt;P&gt;    240          lifetime_dynpro_dynpro_link = 5&lt;/P&gt;&lt;P&gt;    241          others                      = 6&lt;/P&gt;&lt;P&gt;    242          .&lt;/P&gt;&lt;P&gt;    243      IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    244        MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;    245                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;    246      ENDIF.&lt;/P&gt;&lt;P&gt;    247 &lt;/P&gt;&lt;P&gt;    248  *   Create obejct for the SCRATCH TextEditor control&lt;/P&gt;&lt;P&gt;    249      CREATE OBJECT scratch&lt;/P&gt;&lt;P&gt;    250        EXPORTING&lt;/P&gt;&lt;P&gt;    251           parent         = custom_container2&lt;/P&gt;&lt;P&gt;    252           wordwrap_mode  =&lt;/P&gt;&lt;P&gt;    253                  cl_gui_textedit=&amp;gt;wordwrap_at_windowborder&lt;/P&gt;&lt;P&gt;    254          wordwrap_to_linebreak_mode = cl_gui_textedit=&amp;gt;true.&lt;/P&gt;&lt;P&gt;    255 &lt;/P&gt;&lt;P&gt;    256  *   Remove the staus bar&lt;/P&gt;&lt;P&gt;    257      CALL METHOD scratch-&amp;gt;set_statusbar_mode&lt;/P&gt;&lt;P&gt;    258        EXPORTING statusbar_mode = cl_gui_textedit=&amp;gt;false.&lt;/P&gt;&lt;P&gt;    259 &lt;/P&gt;&lt;P&gt;    260    ENDIF.&lt;/P&gt;&lt;P&gt;    261 &lt;/P&gt;&lt;P&gt;    262 &lt;/P&gt;&lt;P&gt;    263  ENDMODULE.                 " STATUS_0100  OUTPUT&lt;/P&gt;&lt;P&gt;    264 &lt;/P&gt;&lt;P&gt;    265  *&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;    266  *&amp;amp;      Form Load_texts&lt;/P&gt;&lt;P&gt;    267  *&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;    268  * This form loads the lines of the internal table i_texttable into&lt;/P&gt;&lt;P&gt;    269  * the TextEdit control&lt;/P&gt;&lt;P&gt;    270  *----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;    271  FORM load_texts.&lt;/P&gt;&lt;P&gt;    272 &lt;/P&gt;&lt;P&gt;    273  * Load TextEdit control with texts&lt;/P&gt;&lt;P&gt;    274    CALL METHOD editor-&amp;gt;set_text_as_r3table&lt;/P&gt;&lt;P&gt;    275      EXPORTING table = i_texttable.&lt;/P&gt;&lt;P&gt;    276    IF sy-subrc &amp;gt; 0.&lt;/P&gt;&lt;P&gt;    277  *   Display an error message&lt;/P&gt;&lt;P&gt;    278      EXIT.&lt;/P&gt;&lt;P&gt;    279    ENDIF.&lt;/P&gt;&lt;P&gt;    280 &lt;/P&gt;&lt;P&gt;    281  * All methods that operates on controls are transferred to the frontend&lt;/P&gt;&lt;P&gt;    282  * by a RFC calls. the method FLUSH is used to determine when this is&lt;/P&gt;&lt;P&gt;    283  * done.&lt;/P&gt;&lt;P&gt;    284    CALL METHOD cl_gui_cfw=&amp;gt;flush.&lt;/P&gt;&lt;P&gt;    285    IF sy-subrc &amp;gt; 0.&lt;/P&gt;&lt;P&gt;    286  *   Display an error message&lt;/P&gt;&lt;P&gt;    287    ENDIF.&lt;/P&gt;&lt;P&gt;    288    g_loaded = 'X'.&lt;/P&gt;&lt;P&gt;    289  ENDFORM.                    " create_texts&lt;/P&gt;&lt;P&gt;    290  *&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;    291  *&amp;amp;      Form  protect&lt;/P&gt;&lt;P&gt;    292  *&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;    293  * Protects marked lines in a TextEdit control&lt;/P&gt;&lt;P&gt;    294  *----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;    295  FORM protect.&lt;/P&gt;&lt;P&gt;    296  * Determine the area selected by the user&lt;/P&gt;&lt;P&gt;    297    CALL METHOD editor-&amp;gt;get_selection_pos&lt;/P&gt;&lt;P&gt;    298       IMPORTING&lt;/P&gt;&lt;P&gt;    299         from_line = from_idx&lt;/P&gt;&lt;P&gt;    300         to_line   = to_idx&lt;/P&gt;&lt;P&gt;    301       EXCEPTIONS&lt;/P&gt;&lt;P&gt;    302         error_cntl_call_method = 1.&lt;/P&gt;&lt;P&gt;    303 &lt;/P&gt;&lt;P&gt;    304  * Synchronize execution in the control with the ABAP program.&lt;/P&gt;&lt;P&gt;    305  * Without this synchronization the variables from_idx and&lt;/P&gt;&lt;P&gt;    306  * to_idx will have obsolutete values (The initial value for&lt;/P&gt;&lt;P&gt;    307  * both, are 0)&lt;/P&gt;&lt;P&gt;    308    CALL METHOD cl_gui_cfw=&amp;gt;flush.&lt;/P&gt;&lt;P&gt;    309    IF sy-subrc &amp;gt; 0.&lt;/P&gt;&lt;P&gt;    310  * Errormessage: Error in flush&lt;/P&gt;&lt;P&gt;    311    ENDIF.&lt;/P&gt;&lt;P&gt;    312 &lt;/P&gt;&lt;P&gt;    313  * Protect the lines selected&lt;/P&gt;&lt;P&gt;    314    IF to_idx &amp;gt; from_idx.&lt;/P&gt;&lt;P&gt;    315      to_idx = to_idx - 1.&lt;/P&gt;&lt;P&gt;    316    ENDIF.&lt;/P&gt;&lt;P&gt;    317    CALL METHOD editor-&amp;gt;protect_lines&lt;/P&gt;&lt;P&gt;    318      EXPORTING&lt;/P&gt;&lt;P&gt;    319        from_line = from_idx&lt;/P&gt;&lt;P&gt;    320        to_line   = to_idx.&lt;/P&gt;&lt;P&gt;    321 &lt;/P&gt;&lt;P&gt;    322 &lt;/P&gt;&lt;P&gt;    323  * The PROTECT_SELECTION method could be used instead, eliminating the&lt;/P&gt;&lt;P&gt;    324  * need of line numbers and the last FLUSH&lt;/P&gt;&lt;P&gt;    325 &lt;/P&gt;&lt;P&gt;    326  * call method editor-&amp;gt;protect_selection.&lt;/P&gt;&lt;P&gt;    327 &lt;/P&gt;&lt;P&gt;    328 &lt;/P&gt;&lt;P&gt;    329  * Flush again to protect immidately&lt;/P&gt;&lt;P&gt;    330    CALL METHOD cl_gui_cfw=&amp;gt;flush.&lt;/P&gt;&lt;P&gt;    331    IF sy-subrc &amp;gt; 0.&lt;/P&gt;&lt;P&gt;    332  * Errormessage: Error in flush&lt;/P&gt;&lt;P&gt;    333    ENDIF.&lt;/P&gt;&lt;P&gt;    334 &lt;/P&gt;&lt;P&gt;    335 &lt;/P&gt;&lt;P&gt;    336 &lt;/P&gt;&lt;P&gt;    337  ENDFORM.                    " protect&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2007 11:51:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/object-oriented-abap/m-p/2043997#M420596</guid>
      <dc:creator>ChandrashekharMahajan</dc:creator>
      <dc:date>2007-03-22T11:51:45Z</dc:date>
    </item>
  </channel>
</rss>

