Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

still the same error...

Former Member
0 Kudos

Hi!

i've done as u've said:

CALL METHOD ref_passenger_airplane->display_attributes.

CALL METHOD ref_cargo_plane->display_attributes.

instead of:

CALL METHOD passenger_airplane->display_attributes.

CALL METHOD cargo_plane->display_attributes.

but there is still the same error that points cursor on Includes ZBC404_88_LCL_CARGO_PLANE

You may only define methods between "CLASS ... IMPLEMENTATION" and "ENDCLASS".

any other suggestions?

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Maja, please don't open another thread for the same problem. Please close this thread and refer to the one that has all the solutions in it.

Regards,

Rich Heilman

3 REPLIES 3

Former Member
0 Kudos

no one to help?

please people!

maja

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Maja, please don't open another thread for the same problem. Please close this thread and refer to the one that has all the solutions in it.

Regards,

Rich Heilman

former_member181962
Active Contributor
0 Kudos

I think the problem is with the includes:

Because the below code is absolutely alright in my system.

&----


*& Module pool YRT_TEST1

*&

&----


*&

*&

&----


REPORT YRT_TEST1 line-size 500.

*INCLUDE zbc400_88_lcl_airplane.

*INCLUDE zbc404_88_lcl_passanger_plane.

*INCLUDE zbc404_88_lcl_cargo_plane.

*

CLASS lcl_airplane DEFINITION.

PUBLIC SECTION.

TYPES: name_type(25) TYPE c.

CONSTANTS: pos_1 TYPE i VALUE 30.

METHODS: constructor IMPORTING

im_name TYPE name_type

im_planetype TYPE saplane-planetype,

display_attributes.

*set_attributes IMPORTING im_name TYPE name_type

*im_planetype TYPE saplane-planetype

CLASS-METHODS: display_n_o_airplanes.

PROTECTED SECTION.

DATA: name TYPE name_type,

planetype TYPE saplane-planetype.

PRIVATE SECTION.

CLASS-DATA: n_o_airplanes TYPE i.

ENDCLASS.

----


  • CLASS lcl_airplane IMPLEMENTATION

----


  • ........ *

----


CLASS lcl_airplane IMPLEMENTATION.

METHOD constructor.

name = im_name.

planetype = im_planetype.

n_o_airplanes = n_o_airplanes + 1.

ENDMETHOD.

*METHOD set_attributes.

*name = im_name.

*planetype = im_planetype.

*n_o_airplanes = n_o_airplanes + 1.

*ENDMETHOD.

METHOD display_attributes.

WRITE: / 'Name of the airplane: '(001), AT pos_1 name,

/ 'Plane type: '(002), AT pos_1 planetype.

ENDMETHOD.

METHOD display_n_o_airplanes.

WRITE: /, / 'Total number of airplanes: '(ca1),

AT pos_1 n_o_airplanes LEFT-JUSTIFIED, /.

ENDMETHOD.

ENDCLASS.

&----


*& Report ZBC404_88_LCL_CARGO_PLANE *

*& *

&----


*& *

*& *

&----


*REPORT zbc404_88_lcl_cargo_plane.

----


  • CLASS lcl_cargo_airplane DEFINITION

----


  • ........ *

----


CLASS lcl_cargo_airplane DEFINITION INHERITING FROM lcl_airplane.

PUBLIC SECTION.

METHODS: constructor IMPORTING

im_name TYPE name_type

im_planetype TYPE saplane-planetype

im_cargo_max TYPE p,

display_attributes REDEFINITION.

PRIVATE SECTION.

DATA: cargo_max TYPE scplane-cargomax.

ENDCLASS.

----


  • CLASS lcl_cargo_airplane IMPLEMENTATION

----


  • ........ *

----


CLASS lcl_cargo_airplane IMPLEMENTATION.

METHOD constructor.

CALL METHOD super->constructor EXPORTING

im_name = im_name

im_planetype = im_planetype.

cargo_max = im_cargo_max.

ENDMETHOD.

METHOD display_attributes.

CALL METHOD super->display_attributes.

WRITE: / 'Maximal cargo: '(004),

AT pos_1 cargo_max LEFT-JUSTIFIED, /.

ENDMETHOD.

ENDCLASS.

&----


*& Report ZBC404_88_LCL_PASSANGER_PLANE *

*& *

&----


*& *

*& *

&----


*REPORT zbc404_88_lcl_passanger_plane.

----


  • CLASS lcl_passanger_airplane DEFINITION

----


  • ........ *

----


CLASS lcl_passanger_airplane DEFINITION INHERITING FROM lcl_airplane.

PUBLIC SECTION.

METHODS: constructor IMPORTING

im_name TYPE name_type

im_planetype TYPE saplane-planetype

im_n_o_seats TYPE sflight-seatsmax,

display_attributes REDEFINITION.

PRIVATE SECTION.

DATA: n_o_seats TYPE sflight-seatsmax.

ENDCLASS.

----


  • CLASS lcl_passanger_airplane IMPLEMENTATION

----


  • ........ *

----


CLASS lcl_passanger_airplane IMPLEMENTATION.

METHOD constructor.

CALL METHOD super->constructor EXPORTING

im_name = im_name

im_planetype = im_planetype.

n_o_seats = im_n_o_seats.

ENDMETHOD.

METHOD display_attributes.

CALL METHOD super->display_attributes.

WRITE: / 'Number of seats: '(003), 25 n_o_seats, /.

ENDMETHOD.

endclass.

DATA: ref_lcl_passanger_airplane TYPE REF TO lcl_passanger_airplane,

ref_lcl_cargo_airplane TYPE REF TO lcl_cargo_airplane.

START-OF-SELECTION.

CALL METHOD lcl_airplane=>display_n_o_airplanes.

CREATE OBJECT ref_lcl_passanger_airplane EXPORTING

im_name = 'LH Berlin'

im_planetype = '747-400'

im_n_o_seats = 580.

CREATE OBJECT ref_lcl_cargo_airplane EXPORTING

im_name = 'US Hercules'

im_planetype = 'Galaxy'

im_cargo_max = 30000.

CALL METHOD ref_lcl_passanger_airplane->display_attributes.

CALL METHOD ref_lcl_cargo_airplane->display_attributes.

CALL METHOD lcl_airplane=>display_n_o_airplanes.

REgards,

Ravi