Skip to Content
-1

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

May 23, 2017 at 05:57 PM

40

avatar image

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 ).
changing.png (18.3 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Sandra Rossi May 23, 2017 at 06:49 PM
2

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
).
Show 1 Share
10 |10000 characters needed characters left characters exceeded

OK that works.

I had no idea there is a certain order!

0