Not an easy way.
There is an ItemID that is generated for each item / subitem but you can't control the number so you can guarantee a sequential number / code for each item type. You can get to the ItemId via an advance function.
There are web services alerts (new item created) that can fire off code using the OPPM API to create a sequential number / code for each item type. Requires knowing how to use the API and installing web service alerts.
I think the easiest is to create an import category and run a nightly sql job that build the PSRAW table for new numbers / codes base on what already exists for each item type. Not real time as the import job is run via the task scheduler.