Skip to Content
0
Former Member
Jan 10, 2008 at 09:52 AM

OOPS

12 Views

Hi all,

I am new to OOPS I have written a small program. can anybody please rectify the error. I am getting error in last line

TEST_OBJ->SET_ATTRIBUTES EXPORTING NAME = 'Raja'

PLANE = 'JET AIRWAYS'.

Thanks in advance

REPORT Y_OOPS_02.

CLASS LCL_AIRPLANE DEFINITION.

PUBLIC SECTION.

METHODS : SET_ATTRIBUTES IMPORTING NAME TYPE STRING

PLANE TYPE STRING,

DISPLAY_ATTRIBUTES.

CLASS-METHODS: DISPLAY_N_O_PLANES.

PRIVATE SECTION.

DATA : NAME TYPE STRING,

PLANE TYPE STRING.

CLASS-DATA : N_O_AIRPLANES TYPE I.

ENDCLASS.

CLASS LCL_AIRPLANE IMPLEMENTATION.

METHOD SET_ATTRIBUTES.

N_O_AIRPLANES = N_O_AIRPLANES + 1.

ME->NAME = NAME.

ME->PLANE = PLANE.

ENDMETHOD.

METHOD DISPLAY_ATTRIBUTES.

ENDMETHOD.

METHOD DISPLAY_N_O_PLANES.

WRITE : N_O_AIRPLANES.

ENDMETHOD.

ENDCLASS.

DATA TEST_OBJ TYPE REF TO LCL_AIRPLANE.

START-OF-SELECTION.

CREATE OBJECT TEST_OBJ.

TEST_OBJ->SET_ATTRIBUTES EXPORTING NAME = 'Raja'

PLANE = 'JET AIRWAYS'.