Execute custom function module during invoice posting in FB60 and MIRO

I need help with running my custom function module automatically when users post invoices through FB60 or MIRO transactions.

I’ve been trying to figure out how to make this work but I’m stuck. When I tried to trace the events, I couldn’t find any function module that gets created by default during the posting process. This makes it really hard for me to understand what events are being triggered.

I want my custom function module to execute every time someone posts an invoice document in these transactions. Has anyone successfully implemented something like this before? What approach did you use?

I’m looking for guidance on the best way to hook into the posting process and call my function module at the right moment. Any help would be greatly appreciated since I’m not sure what the next steps should be.

Skip tracing function modules - use a BAdI instead. For FB60 and MIRO, grab the INVOICE_UPDATE BAdI. It’s got clean exit points right in the invoice posting process. The methods you want are CHANGE_AT_SAVE and CHANGE_BEFORE_UPDATE - they fire at different stages of posting. Find it in SE18, implement through SE19. Drop your custom function module call right into the BAdI implementation with the invoice document data. Way more stable than hacking standard function modules, and it won’t break when you upgrade. You’ll get all the document data and control structures you need for your custom function. Just test the hell out of it in dev first - invoice posting breaks, people get mad.