cancel
Showing results for 
Search instead for 
Did you mean: 

RE-FX: How to use method if_ex_recn_contract~substitute in BADI_RECN_CONTRACT_IN

Former Member
0 Kudos

Hi Guru's,

I'm trying to change the profit center field in the Organizational Assignment of a contract so that it automatically places a value in the field to lessen errors in encoding. We've already implemented the BADI_RECN_CONTRACT_IN IF_EX_RECN_CONTRACT~CHECK_ALL method for checking of values. But I have no idea how to substitute values of the profit center in the Organizational Assignment using IF_EX_RECN_CONTRACT~SUBSTITUTE method. Any tips or sample steps on using this method?

Thank You very much

-Eric

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Eric,

basically to achieve this you would do following :

1. populate an internal table let's say lt_term_oa_new TYPE bapi_re_t_term_oa_intc according to your suitable logic ,

2. call the following function module towards the end of you coding:

    CALL FUNCTION 'API_RE_CN_CHANGE'

          EXPORTING
          io_object                       = io_object
          ....

          it_term_org_assignment          = lt_term_oa_new

          ...
   EXCEPTIONS
     error                           = 1
     OTHERS                    = 2.

This way it works for us usually pretty well and not only with Organizational Assignment. Keep in mind that it is probably better to make only one call for all kinds of changes you need to make in this contract and to avoid unnecessery calls when nothing needs to be changed .

Regards,

Siarhei

Former Member
0 Kudos

Hi Siarhei,

Thanks for the help, it worked for me. At first I couldn't get it to work because I was using function API_RE_OF_CHANGE good thing I saw your reply and saw that I was using a wrong function. I needed to use API_RE_CN_CHANGE. Thanks again.

- Eric

Answers (0)