Skip to Content
avatar image
-1
Former Member

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

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)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    May 23, 2017 at 06:49 PM

    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
    ).
    Add comment
    10|10000 characters needed characters exceeded