CA Sam,
There are BADIs for this such as FMAVC_DERI_AFMA. But before you use the BADIs please take a look at the IMG Activity in BCS called Define Derivation Strategy for Control Objects.In this activity you can define Control Objects that are derived from the FM Account assignments in a document. The control object is typically a higher level account assignment at which budget availability is checked.
Thanks
Shyam