01-02-2019 11:09 PM
hi all,
i want to assign current class reference to a variable.
ex; in the below example i am not knowing how to assign lref_A1 in class A2 with reference of A1.
may i know how to assign it.
class A1 defination,
methods first,
endclass
class A2,
data lref_A1 type ref to A1,
methods some_test,
endclass.
class A1 implementaion.
method first.
create object lref_new2 type ref to A2.
*****how to assign lref_A1 the current reference
***lref_new2-lref_A1 = this or lref_new2-lref_A1 = me "is not working
********how to assign
end method.
endclass.
create object lref_new type A1.
lref_new->first( ).
01-03-2019 5:10 AM
Hi Kiran,
ME should work
class a1 implementation.
method first.
data: lref_new2 type ref to a2.
create object lref_new2.
lref_new2->lref_A1 = me.
endmethod.
endclass.
Regards,
Muthu
01-03-2019 5:10 AM
Hi Kiran,
ME should work
class a1 implementation.
method first.
data: lref_new2 type ref to a2.
create object lref_new2.
lref_new2->lref_A1 = me.
endmethod.
endclass.
Regards,
Muthu
01-03-2019 8:33 AM
kiran rachamalla tried ME but it couldn't work because the true error was that an attribute cannot be assigned with the structure component selector (minus character), it can be assigned only with the object component selector ->.
01-03-2019 8:38 AM
01-03-2019 12:02 PM
hi Muthu,
i only placed wrong actually i placed type ref to data
that leads to issue.
now corrected .
Regards,
kiran rachamalla.
01-03-2019 12:41 PM
So, Kiran, as far as I understand, your question had so many typos that nobody could even find the right issue. Next time, post a compilable source code, PLEASE!