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: 

abstract class inheritance and method redifinition

crepmaster
Participant
0 Kudos

Hello Expert i'm trying to redefine a method GET_CONDITIONS from the class CL_FTR_RPS_REPAYMENT_SCHEDULE but the redefine method is not triggered.

1) i have a ZCL_FTR_RPS_REPAYMENT_SCHEDULE with a superclass CL_FTR_RPS_REPAYMENT_SCHEDULE

i have then redefine the get_condition method

TRY.
CALL METHOD SUPER->GET_CONDITIONS
IMPORTING
et_conditions = ET_CONDITIONS
ev_calc_method = EV_CALC_METHOD
et_mt_conditions = ET_MT_CONDITIONS
.
CATCH cx_ftr_root.
ENDTRY.

but when i call the method it's not trigger, can you explain me what i'm missing?

TRY.
DATA(lo_inst) = zcl_ftr_rps_repayment_schedule=>get_instance_for_db_data(
iv_bukrs = p_bukrs
iv_rfha = p_rfha
).
IF lo_inst IS BOUND.
lo_inst->get_conditions(
IMPORTING
et_conditions = lt_cond
ev_calc_method = ev_calc
).
1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor

Make sure that the type returned by get_instance_for_db_data is of type zcl_ftr_rps_repayment_schedule.

4 REPLIES 4

Sandra_Rossi
Active Contributor
0 Kudos

Please edit your question, select your code and press the button [CODE], which makes the code appear colored/indented, it will be easier for people to look at it. Thank you!

Sandra_Rossi
Active Contributor

Make sure that the type returned by get_instance_for_db_data is of type zcl_ftr_rps_repayment_schedule.

crepmaster
Participant
0 Kudos

Hello Thank you, that solved my issue.

I close the threat.

abo
Active Contributor

not so fast 🙂

sandra.rossi should convert the comment to answer, so that you may accept it 🙂

also, "thread" 🙂