you can set up derivation rule under Additional Account Assignment settings.
Define Derivation of Additional Account Assignments (T-code -TPM_DERIVE_ACCNT)
IMG ->Financial Supply Chain Management -> Treasury and Risk Management -> Transaction Manager -> General Settings -> Accounting -> Link to Other Accounting Components -> Additional Account Assignments -> Define Derivation of Additional Account Assignments
Please check the my blog for more details.
Best regards,
Alex.