As @Ernie commented there’s some good posts on here already, here’s two you could try as a start:
We did this a few years ago in E10 using an In-Transaction data directive on the Customer table, and it allows for spaces, special characters etc (format is AAA111, so similar to yours) but I suspect there is a better way of doing it in Kinetic (Functions?) so I’ll let you investigate first, but happy to share more nothing else you find quite fits.