Hey everyone,
I’m stuck on a problem and could use some advice. I’m trying to figure out how to run my own function module whenever someone posts an invoice in MIRO or FB60.
I’ve been messing around with event tracing, but I can’t seem to find any default function modules that are created. This is making it really hard for me to get the event details I need.
Has anyone dealt with this before? Any tips or tricks would be super helpful. I’m not sure if I’m missing something obvious or if there’s a different approach I should be taking.
Thanks in advance for any help you can offer!
I’ve actually tackled this issue before in a project. Instead of relying on event tracing, I found success by using the BADI ME_PROCESS_PO_CUST enhancement spot. This allows you to implement custom logic during the invoice posting process.
To set it up, create a custom implementation of the BADI and define your function module there. Then, in the implementation, you can hook into various points of the invoice posting workflow, like before or after the document is created.
One caveat: make sure your custom logic is efficient, as it will run for every invoice. Also, thorough testing is crucial to avoid any unintended impacts on the standard process.
If you need more granular control, you might also look into user exits specific to MIRO. They can offer additional intervention points, though they’re sometimes trickier to implement.