cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Methods in Classes - non unique parameters (one changing, one importing)

Former Member
0 Likes
460

I want to call a custom function (CALC_MONTHLY_CASHTO), which is part of the same class as the calling method IF_RSPLFA_SRVTYPE_IMP_EXEC_REF~EXECUTE.

I manage to send data to CALC_MONTHLY_CASHTO, but I struggle to get that data back to EXECUTE.
So far it only works when I define C_TH_DATA and I_TH_REF_DATA as IMPORT.

So I have some questions, which maybe help me to fill some knowledge gaps.

I want to pass C_TH_DATA from EXECUTE to CALC_MONTHLY_CASHTO, modifiy it and then pass it back.
Furthermore I am passing I_TH_REF_DATA and do not change it and do not pass it back.

1) So I should define C_TH_DATA as Changing and I_TH_REF_DATA as importing?

2) When calling the function, I should do like that?

CALL METHOD CALC_MONTHLY_CASHTO(
CHANGING C_TH_DATA = C_TH_DATA
EXPORTING I_TH_REF_DATA = I_TH_REF_DATA ).

Accepted Solutions (1)

Accepted Solutions (1)

Sandra_Rossi
Active Contributor

It looks like your only issue is the order of words in the CALL METHOD. Try this:

CALC_MONTHLY_CASHTO(
  EXPORTING
    I_TH_REF_DATA = I_TH_REF_DATA 
  CHANGING
    C_TH_DATA = C_TH_DATA
).
Former Member
0 Likes

OK that works.

I had no idea there is a certain order!

Answers (0)