‎2009 Nov 04 8:28 PM
Perform stmt: PERFORM get_delta_position_increases USING l_p_accumulator
CHANGING l_wrk_position.
Subroutine:
FORM get_delta_position_increases
USING i_p_accumulator TYPE REF TO cl_accumulator_trg
CHANGING c_wrk_rep_position TYPE trls_rep_position.
DATA: l_p_accumulator TYPE REF TO cl_accumulator_trg,
Get Clone of Accmumulator
l_p_accumulator = i_p_accumulator->get_clone( ). --> Syntax error pointing here
CALL METHOD l_p_accumulator->reset_values( ).
ENDFORM.
Syntax error I am getting:
Result Type of function method cannot be converted into the type of l_p_accumulator.
Any pointers please.
Thanks,
Kiran
‎2009 Nov 04 9:16 PM
what is the type of the returning parameter in method iget_clone( ) from class cl_accumulator_trg?
‎2009 Nov 04 9:26 PM
‎2009 Nov 04 9:30 PM
Well, that's why. It's returning an interface, not a class.
I don't have your class in my system, but most likely the interface implements that class
Something you could try is
l_p_accumulator ?= i_p_accumulator->get_clone( ).
‎2009 Nov 04 9:28 PM
Hi,
DATA: l_p_accumulator TYPE REF TO cl_accumulator_trg,Are you actually using a comma (,) instead of period, hope not.
Well, I tried to create a routine in my system and I do not get a syntax error.
If you still get an error you may try this.
l_p_accumulator ?= i_p_accumulator->get_clone( )..
Regards
Prasenjit
‎2009 Nov 04 9:42 PM
Nope. I just pasted the required code. I have couple more declarations.
even the ? did not solve the error. Any more clues plz.
Thanks,
Kiran
Edited by: kiran dasari on Nov 5, 2009 3:37 AM
‎2009 Nov 04 10:09 PM
Hmm.. thats interesting.
Try to define the variable l_p_accumulator type ref to IF_ACCUMULATOR_TRG
Let me know if that helps.
Regards
Prasenjit
‎2009 Nov 05 2:28 PM
Hi Prashant,
I tried this yesterday only and still the same error. My bad...I should have included that.
ANy more clues please.
Thanks,
Kiran
Infact when I add ? to the line, save and then do syntax check...? disappears automatically. so is this something to look into also?
Thanks,
Kiran
Edited by: kiran dasari on Nov 5, 2009 9:57 PM
‎2009 Nov 05 5:57 PM
Hi Kiran,
This is really weird. When I try in my system, the code that you have given works fine. Surprizing!
As an alternative you may try this,
data l_p_accumulator type ref to object.
data method type string VALUE 'RESET_VALUES'.Then call the method as
CALL METHOD l_p_accumulator->(METHOD).Regards
Prasenjit