We have lots of ways to set CO object when posting in TRM.
Check note 1885696 for details, it explains in detail.
-Financial Supply Chain Management
-Treasury and Risk Management
-Link to Other Accounting Components
-Allocate Additional Account Assignment to Account Assignment References
2. Use BADI TPM_ACCIF_TRAC~ACCIT_KOSTL_EXIT
You can use the IM_DATA to archive your selecting logic and save the object to CH_ACCIT_KOSTL_D and CH_ACCIT_KOSTL_C.
3, Set it in the position indicator FTR_EDIT or TPM56A.
4. using the CO setting like T-code OKB9, OKC9
5. Implement BADI BADI_TPM_ENHANCE_ACCFIG_TRAC.
6. Use the derivation tool