I need help with calling my custom function module whenever an invoice gets posted through MIRO or FB60 transactions.
I’m working on a requirement where I need to execute some custom logic every time someone posts an invoice. I’ve been trying to figure out how to hook into the posting process but I’m running into issues.
I attempted to trace the events to see what gets triggered during the posting process, but I couldn’t find any existing function modules being called by default. This makes it difficult for me to understand how the event flow works.
What would be the best approach to achieve this? Should I be looking at user exits, BADIs, or some other enhancement technique? Any guidance on how to identify the right hook points would be really helpful.
Thanks in advance for any suggestions!
In your case, leveraging classic user exits for FB60 and MIRO is advisable. Each transaction has designated enhancement points that activate during the posting process. Specifically, for FB60, you should consider enhancement MF05XFF1, which triggers at EXIT_SAPMF05X_004 while posting. For MIRO, enhancement MM08005 is relevant, with exits such as EXIT_SAPMM08R_004. These methods have proven effective in my experience. However, if you’re utilizing a newer SAP version, exploring BADI options may be more beneficial, as they’re often more versatile than traditional user exits.
try badi INVOICE_UPDATE - it works for transactions and triggers right after document posting. way cleaner than user exits. just implement method CHANGE_AT_SAVE to call your custom fm. I’ve been using this approach for years with zero issues.
This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.