SAP IBP Hooks (VBA Events)
The SAP Integrated Business Planning, add-in for Microsoft Excel (Excel add-in) provides multiple hooks (entry points for custom coding) to enhance functions of the Excel add-in through Microsoft Visual Basic for Applications (VBA) coding.
You can use SAP IBP hooks in a similar way as you would use VBA events provided by Microsoft (for example, Worksheet_Activate()), (see https://docs.microsoft.com/en-us/office/vba/api/excel.worksheet.activate(even)
).
| SAP IBP Hook Name | Description |
|---|---|
| IBPBeforeSend |
The IBPBeforeSend hook is called, if a user has chosen Save Data or Simulate in the SAP IBP ribbon in the Data Input group or Create in the Scenarios group. Your custom coding runs right before the Excel add-in sends an update request to the back end. It is also possible to cancel the save or simulate action by setting the IBPBeforeSend hook to False. |
| IBPAfterRefresh |
The IBPAfterRefresh hook is called after the user chooses Refresh in the SAP IBP ribbon in the Data Input group. Your custom coding runs after the SAP IBP system has refreshed the data and the planning view is rewritten. |
| IBPMDAfterRefresh |
The IBPMDAfterRefresh hook is called after opening a master data favorite, creating a new master data workbook, or choosing Refresh in the Master Data group of the SAP IBP ribbon. Using this hook, you can manipulate the layout and appearance of master data worksheets, such as reordering, coloring, or hiding columns, for example. |
| IBPMDBeforeUpdate |
The IBPMDBeforeUpdate hook is called before the changes in the master data worksheet are sent to the back end after choosing Save Changes… in the Master Data group of the SAP IBP ribbon. You can use it, for example, to validate that naming conventions have been followed before saving data. It is also possible to cancel the save action by setting the IBPMDBeforeUpdate hook to False. |
| AFTER_REFRESH |
The AFTER_REFRESH hook is called after the SAP IBP system has refreshed the data and rewritten the planning view. This happens, for example, after a user chooses Save Data, Simulate or Refresh in the SAP IBP ribbon in the Data Input group or after planning view settings or options have been changed. |
| BEFORE_REFRESH |
The BEFORE_REFRESH hook is called before the data gets refreshed (rewritten) in the planning view. |
| AFTER_WORKBOOK_OPEN |
The AFTER_WORKBOOK_OPEN hook is called after opening a Microsoft Excel workbook. As an example you could use this hook to implement some checks after opening an SAP IBP planning view template or favorite. |
Depending on your use case, you can combine the hooks listed in the table with the available APIs that can be called using the SAP IBP automation object. For more information, see SAP IBP APIs (VBA Methods), check the VBA samples at VBA Samples, as well as the SAP Note 2421657
.
| SAP IBP Hook | How to Enable |
|---|---|
| IBPBeforeSend | Use the global configuration parameter ACTIVATE_VBA_HOOKS in parameter group PLAN_VIEW. |
| IBPAfterRefresh | |
| IBPMDAfterRefresh | Use the global configuration parameter ACTIVATE_MD_VBA_HOOKS in parameter group PLAN_VIEW. |
| IBPMDBeforeUpdate |
The hooks AFTER_REFRESH, BEFORE_REFRESH, and AFTER_WORKBOOK_OPEN can’t be disabled. They have been taken over from SAP EPM solutions, add-in for Microsoft Office.