Introduction
This document provides guidelines for using BADIs for Variable Exit processing. It will act like a step by step guide for creating new exits as needed in BW 7.3 or higher versions.
Overview of Variable Exits
There are 4 different processing steps that can occur during the execution of a BEx query.
- I_STEP = 0: Is called for all variables of processing type “authorization”. This allows for a dynamic approach of identifying the data level authorizations of a given user.
- I_STEP = 1: Is individually called for all query variables of processing type “customer exit” and is processed before the variable pop-up screen is displayed to the users. This allows for a dynamic pre-population of variable values which can then be manually adjusted by the user as needed. For a variable to be processed in I_STEP 1, the variable should be ready for input.
- I_STEP = 2: Is individually called for all query variables of processing type “customer exit” and is processed after the variable pop-up is displayed to the users. This allows for dynamic derivation of variable value based on the selections that user made for other variables in the query. For a variable to be processed in I_STEP 2, the variable should NOT be ready for input.
- I_STEP = 3: Is collectively called once per query and is used to validate the selections made by the user.
Why to use BADIs for variable exits
- Transport variable code changes without dependency on other variable exits
- Avoid conflicts within the team while working on parallel developments of variables on two different infoobjects
- Have the ability for independent testing and versioning
- Right direction strategically -> Transition to ABAP objects is imminent - sooner or later
How to Use BADIs for variable exits
In the version BW 7.3, SAP released a new enhancement spot -“RSROA_VARIABLES_EXIT”, the implementations against which are automatically called multiple times (different I_STEPs) during the execution of the query.
As can be noted, this is a multiple use BADI and hence can have different implementations with a different filter value on Infoobject.
Step 1: Go to SE19 -> Create new Implementation -> Choose the enhancement spot “RSROA_VARIABLES_EXIT””.
Step 2: Provide a meaningful technical name for the implementation with the naming standard of ZBW_VAR_EXIT_XXXXXXX – where XXXXXXX is the technical name of the variable.
Step 3: Provide the BADI implementation name and Class Name as required and choose the BADI definition from the dropdown.
Step 4: Populate the filter value for the BADI implementation by keying in the technical name of the info object.
Step 5: Populate the variable exit logic in the method “IF_RSROA_VARIABLES_EXIT_BADI~PROCESS” of the Implementation Class.
5. Appendix
- By using standard enhancement spot provided by SAP, we need not populate any logic in the include “ZXRSRU01” and hence can be left blank.
- This approach gives the flexibility to modularize the coding by Infobject and hence all variables on a given infoobject would be grouped in a given method of the implementation class.
- Since I_STEP = 3 is not called by info object, an implementation for all I_STEP 3 validations can be created with filter value OBJNM = ‘’.