Hi George,
the ID number is written to field BSEG-SGTXT (together with the update type). You could read it from there. Or if you prefer you can use BAdI TPM_ACCIF_TRAC to fill an additional field in the FI document. In the BAdI you can find method ACCIT_EXIT which can be used for this purpose. The security id you can find in import parameter IM_DATA.
Best regards,
Andrea