A very specific and interesting question!
You're looking for a Business Add-In (BAdI) that triggers when an opportunity is saved in SAP CRM (or SAP Cloud for Customer, or SAP Sales and Service Cloud, I assume).
After digging through the SAP documentation and OSS notes, I found a few potential BAdIs that might fit the bill. Before I share them with you, let's clarify a few assumptions:
- SAP CRM version: I'm assuming you're working with SAP CRM 7.0 EHP 3 or higher (released 2011 or later). If you're on an older version, the BAdIs might differ.
- Opportunity object: In SAP CRM, the opportunity object is called
CRM_OPPORTUNITY. We'll focus on BAdIs related to this object.
Now, here are the BAdIs that might fire when an opportunity is saved:
1. CRM_OPPORTUNITY_BADI - Method SAVE
This is a classic BAdI, available since SAP CRM 5.0. It's specifically designed for opportunities. The SAVE method is called before the opportunity is saved to the database.
- BAdI Name:
CRM_OPPORTUNITY_BADI
- Interface:
IF_CRM_OPPORTUNITY_BADI
- Method:
SAVE
- Event: Before saving the opportunity (includes create, update, and delete operations)
To find this BAdI in transaction SE18 (BAdI Builder), enter CRM_OPPORTUNITY_BADI and press F4. Then, navigate to the Interface tab and double-click on IF_CRM_OPPORTUNITY_BADI to see the method SAVE.
2. CRM_GENIL_MODEL_SAVE - Method SAVE_OBJECT
This BAdI is part of the Generic Interaction Layer (GenIL) framework, which is the foundation for many SAP CRM objects, including opportunities. SAVE_OBJECT is a more generic method, but it's called after the opportunity object has been saved.
- BAdI Name:
CRM_GENIL_MODEL_SAVE
- Interface:
IF_GENIL_MODEL_SAVE
- Method:
SAVE_OBJECT
- Event: After saving any GenIL object (including opportunities)
Find this BAdI in SE18 by entering CRM_GENIL_MODEL_SAVE. In the Interface tab, double-click on IF_GENIL_MODEL_SAVE to see the SAVE_OBJECT method.
3. CRM_BUPA_FR_BADI - Method POST_SAVE_OPPORTUNITY (Indirect relation)
This BAdI is primarily focused on Business Partner (BP) and Relationship processing. However, opportunities are often linked to BPs, and this BAdI might be triggered after an opportunity is saved, as a side effect of updating the related BP data.
- BAdI Name:
CRM_BUPA_FR_BADI
- Interface:
IF_CRM_BUPA_FR_BADI
- Method:
POST_SAVE_OPPORTUNITY (yes, opportunity is in the method name!)
- Event: After saving opportunity-related BP data ( indirect opportunity save event)
Additional hint: If you're working with SAP Cloud for Customer (C4C) or SAP Sales and Service Cloud, there might be different, cloud-specific BAdIs or event handlers (e.g., CE_OPPORTUNITY.Save event in the SAP Cloud Applications Studio). Verify the relevant SAP Cloud documentation for these environments.
How to verify the correct BAdI for your scenario?
- Activate the
SAVE method in CRM_OPPORTUNITY_BADI ( easiest one to start with).
- Set a breakpoint in your implementation class (using transaction
SE24 or SE80).
- Save an opportunity in your SAP CRM system.
- If your breakpoint is hit, voilà! You've found the right BAdI.
- If not, repeat the process with
CRM_GENIL_MODEL_SAVE and SAVE_OBJECT.
- As a last resort, try
CRM_BUPA_FR_BADI with POST_SAVE_OPPORTUNITY.
Final tips:
- Always check the SAP OSS Notes (e.g., 1945339 or 2219898) for BAdI-related corrections or prerequisites.
- Make sure your BAdI implementation is correctly registered and active (transaction
SE18 or SE80).
Now, go forth and catch that opportunity save event!
Best of luck, fellow SAP developer!