‎2013 Mar 05 8:58 AM
How can we pass object reference variable of one class in importing parameter to the method of other classs to call mehtod of first class ?
Thanks in advance.
‎2013 Mar 05 9:13 AM
The parameter must be typed as reference to object.
E. g.:
METHODS tetmeth importing im_object type ref to your_class.
Regards
Stefan
‎2013 Mar 08 9:24 AM
Hello Dipesh,
Can You Please Elobarate Your requirement more specifically.
Regards,
Santosh
‎2013 Mar 08 10:05 AM
‎2013 Mar 13 12:10 PM
by using INHERITENCE IT IS POSSIBLE
declare class c1
Declare method m1 importing obj type ref to class_name.
implement c1
create class c2 inherting for c1
method m1 redefiniton.
implement c2.
create object form class c2
call method m1 using object of class c2 and pass your reference as exporting parameter.
thanks & Regards
rajeshkumar
‎2013 Mar 13 12:28 PM
CLASS A DEFINITION.
PUBLIC SECTION.
METHODS M1.
ENDCLASS.
CLASS A IMPLEMENTATION.
METHOD M1.
WRITE: 'Hi'.
ENDMETHOD.
ENDCLASS.
CLASS B DEFINITION.
PUBLIC SECTION.
METHODS M2 IMPORTING OB23 TYPE REF TO A.
ENDCLASS.
CLASS B IMPLEMENTATION.
METHOD M2.
* WRITE: 'HELLO'.
OB23->M1( ).
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
DATA: OB TYPE REF TO A.
CREATE OBJECT OB.
DATA: OB1 TYPE REF TO B.
CREATE OBJECT OB1.
CALL METHOD OB1->M2( OB23 = OB ).