2007 Aug 07 6:43 PM
Hi,
I have created two classes, class A and sub class- classB, using class builder how can I call consture of super class A .
getting following error - In the constructor method, you can only access instance attributes
after the constructor of the superclass (SUPER->CONSTRUCTOR) has been
called.
Thanks for you help.
jog
2007 Aug 07 6:51 PM
2007 Aug 07 6:58 PM
Similar to this in a local class.
report zrich_0001.
*---------------------------------------------------------------------*
* CLASS lcl_a DEFINITION
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
class lcl_a definition.
public section.
methods: constructor.
endclass.
*---------------------------------------------------------------------*
* CLASS lcl_a IMPLEMENTATION
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
class lcl_a implementation.
method constructor.
write:/ 'A constructor'.
endmethod.
endclass.
*---------------------------------------------------------------------*
* CLASS lcl_b DEFINITION
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
class lcl_b definition inheriting from lcl_a.
public section.
methods: constructor.
endclass.
*---------------------------------------------------------------------*
* CLASS lcl_b IMPLEMENTATION
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
class lcl_b implementation.
method constructor.
call method super->constructor( ).
write:/ 'b constructor'.
endmethod.
endclass.
data: o_clb type ref to lcl_b.
start-of-selection.
create object o_clb.
Regards,
Rich Heilman