Solution : https://service.sap.com/sap/support/notes/873466 (SAP Service marketplace login required)
Summary : 
      This SAP Note addresses issues related to program terminations with the MESSAGE_TYPE_X runtime error in CO transactions post ECC500 upgrade when using Funds or Grants Management. The issue is caused by non-initialized fields (SEGMENT, PSEGMENT) in COKEY2 table leading to duplicate entries and subsequent posting errors. The provided solution includes source code corrections, a check for incorrect entries, and corrective reports (Z_873466_REPAIR_AFTER_UPGRADE, Z_873466_CHECK, Z_873466_REPAIR_COKEY2, Z_873466_REPAIR_POSTINGS). Immediate action through specified reports is required depending on whether new postings are created post-upgrade and the system version upgrades.
Key words : 
z_873466_check                     z_873466_repair_cokey2                     z_873466_repair_postingsselection texts, program terminations occur, key field subkey2, source code correction, hrkft_n   correct hrkft, hrkft_o   wrong hrkft, testrun  test run, sap service marketplace, find incorrect records, prerequisites funds management
Related Notes : 
       
| 788218 | Add. info. on upgrading to SAP ERP Central Component 5.0 SR1 |