Customer Exit OLAP Variables require ABAP coding which often can be found in a single INCLUDE program
ZXRSRU01 as part of legacy Enhancement
RSR00001 (a.k.a. Customer Exit
EXIT_SAPLRRS0_001). Usually the INCLUDE program becomes bigger and bigger. Moreover, various people and/or project teams are working in the same place. You can imagine that it is dangerous because one programming or transport sequence mistake can destabilize the entire system. The solution is encapsulation of the coding of individual variables and you will need a framework to realize it.
I would like to share via this document detailed technical instructions how to implement such a framework. Please refer to my blog Framework for Customer Exit OLAP Variables for an introduction of the framework and additional information.
Please have a look here to download the attachments.
Step 1: Create Enhancement Spot
SAP Menu: Tools > ABAP Workbench > Utilities > Business Add-Ins > Definition
T/code:
SE18
Create Enhancement Spot
YBW_OLAP_VAR as shown in the screenshots.
Figure 1: Creating an Enhancement Spot
On the overview screen of the Enhancement Spot you are able to create one or more BAdI Definitions. You have to create the following 4 BAdI Definitions:
- YBW_OLAP_VAR_BEFORE_POPUP - OLAP Customer Exit Variables - Before Popup (i_step = 1);
- YBW_OLAP_VAR_AFTER_POPUP - OLAP Customer Exit Variables - After Popup (i_step = 2);
- YBW_OLAP_VAR_VALIDATION - OLAP Customer Exit Variables - Validation (i_step = 3);
- YBW_OLAP_VAR_AUTHORIZATION - OLAP Customer Exit Variables - Authorization (i_step = 0).
Figure 2: Example of creating a BAdI Definition
Figure 3: Overview of all BAdI Definitions
The settings of all BAdI Definitions are basically the same and will be explained by showing the screenshots for BAdI Definition
YBW_OLAP_VAR_BEFORE_POPUP.
Figure 4: Example of BAdI Definition - general settings
Interface
IF_RSROA_VARIABLES_EXIT_BADI is reused from standard SAP BAdI
RSROA_VARIABLES_EXIT_BADI as part of Enhancement Spot
RSROA_VARIABLES_EXIT.
Figure 5: Example of BAdI Definition - Interface
With the Filter only BAdI Definition
YBW_OLAP_VAR_VALIDATION has an exception. Processing step 3 (i.e. i_step = 3) is only called once (i.e. not variable dependent). The suggested approach is to define a filter on Query.
Figure 6: Example of BAdI Definition – Filter (1)
Figure 7: Example of BAdI Definition – Filter (2)
Figure 8: Example of BAdI Definition – Filter (3)
Step 2: Implement Standard SAP Enhancement Spot
SAP Menu: Tools > ABAP Workbench > Utilities > Business Add-Ins > Implementation
T/code:
SE19
Implement standard SAP Enhancement Spot
RSROA_VARIABLES_EXIT as shown in the screenshots.
Figure 9: Creating an Enhancement Implementation (1)
Figure 10: Creating an Enhancement Implementation (2)
Figure 11: Creating an Enhancement Implementation (3)
Figure 12: Enhancement Implementation - general settings
Figure 13: Enhancement Implementation - Implementing Class
Don’t forget to implement method
IF_RSROA_VARIABLES_EXIT_BADI~PROCESS. Entering a comment will do for this moment.
Note that you don’t have to create a new filter. The Enhancement Spot Implementation always has to be processed.
Step 3: Maintain Class
SAP Menu: Tools > ABAP Workbench > Development > Class Builder
T/code:
SE24
In Step 2 as part of the Enhancement Spot Implementation, Implementing Class
YCL_RSROA_VARIABLES_EXIT was created without actual coding. You now have to maintain the class to provide the coding.
Refer to the attached file
YCL_RSROA_VARIABLES_EXIT_v1.txt. From here you can quite easily copy & paste the source code.
Step 4: Implement Enhancement Spot
SAP Menu: Tools > ABAP Workbench > Utilities > Business Add-Ins > Implementation
T/code:
SE19
This is a recurring action for every new Customer Exit Variable. You have to choose an appropriate BAdI which corresponds to the purpose.
Implement Enhancement Spot
YBW_OLAP_VAR as shown in the screenshots.
Figure 14: Creating an Enhancement Implementation (1)
Figure 15: Creating an Enhancement Implementation (2)
Figure 16: Creating an Enhancement Implementation (3)
Figure 17: Enhancement Implementation - general settings
Figure 18: Enhancement Implementation - Implementing Class
Figure 19: Enhancement Implementation - Filter
Refer to the attached file
YCL_0FISCPER_C_C_I_0000_v1.txt for an example of the coding in a random implementation.