0% found this document useful (0 votes)
11 views3 pages

Class Event 2

Uploaded by

likhita A.N
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views3 pages

Class Event 2

Uploaded by

likhita A.N
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

*&---------------------------------------------------------------------*

*& Report ZH_EVENT1


*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT ZH_EVENT2.

PARAMETERS:c_name(50) type C,
lc1 RADIOBUTTON GROUP g,
hc1 RADIOBUTTON GROUP g.

class honda_car DEFINITION.

PUBLIC SECTION.
EVENTS: ClEANER.
METHODS:HONDA_CEO.

PROTECTED SECTION.

PRIVATE SECTION.

ENDCLASS.

class honda_car IMPLEMENTATION.

**---------------------------------------------------------------------------------
---------
* EVENT RAISING
METHOD ..-------------------------------------------------------------------
**---------------------------------------------------------------------------------
---------

METHOD:HONDA_CEO.

write:/30 'HONDA CAR CEO CALLING CLEANER' COLOR 7.


SKIP 2.

RAISE EVENT CLEANER.


* RAISE EVENT CLEANER.

ENDMETHOD.

ENDCLASS.

CLASS CLEANER DEFINITION.


PUBLIC SECTION.
methods:constructor IMPORTING i_lcl type C.

**------------------------------------------------------------
* handler methodS .
**------------------------------------------------------------

methods cl_cleaner1 for event cleaner of honda_car.


methods cl_cleaner2 for event cleaner of honda_car.

PROTECTED SECTION.
data:lcl(50) type C.

ENDCLASS.

CLASS CLEANER IMPLEMENTATION.

method constructor.

lcl = i_lcl.

ENDMETHOD.

method cl_cleaner1.

Write:/ lcl color 2, 'Low class cleaner' color 7.

endmethod.

method cl_cleaner2.

Write:/ lcl color 2, 'High class cleaner' color 1.

endmethod.

ENDCLASS.

START-OF-SELECTION.

DATA:H1 TYPE REF TO HONDA_CAR,


C1 TYPE REF TO CLEANER.
*
CREATE OBJECT H1.
Create OBJECT C1 EXPORTING I_LCL = C_NAME .

if lc1 = 'X'.
SET HANDLER C1->CL_CLEANER1 FOR H1.
ENDIF.

IF HC1 = 'X'.
SET HANDLER C1->CL_CLEANER2 FOR H1.
ENDIF.

CALL METHOD H1->HONDA_CEO.

You might also like