Skip to Content
author's profile photo Former Member
Former Member

OOPS

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'.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2008 at 10:02 AM

    Hi,

    You have forgotten to mention call method while calling the method.

    CALL METHOD TEST_OBJ->SET_ATTRIBUTES EXPORTING NAME = 'Raja'

    PLANE = 'JET AIRWAYS'.

    Thanks & Regards

    Haritha.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.