Skip to Content

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_01_Creating_Enhancement_Spot.jpg

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_02_Example_Creating_BAdI_Definition.jpg

Figure 2: Example of creating a BAdI Definition

 

Figure_03_Overview_All_BAdI_Definitions.jpg

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_04_Example_BAdI_Definition_General_Settings.jpg

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_05_Example_BAdI_Definition_Interface.jpg

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_06_Example_BAdI_Definition_Filter_1.jpg

Figure 6: Example of BAdI Definition – Filter (1)

 

Figure_07_Example_BAdI_Definition_Filter_2.jpg

Figure 7: Example of BAdI Definition – Filter (2)

 

Figure_08_Example_BAdI_Definition_Filter_3.jpg

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_09_Creating_Enhancement_Implementation_1.jpg

Figure 9: Creating an Enhancement Implementation (1)

 

Figure_10_Creating_Enhancement_Implementation_2.jpg

Figure 10: Creating an Enhancement Implementation (2)

 

Figure_11_Creating_Enhancement_Implementation_3.jpg

Figure 11: Creating an Enhancement Implementation (3)

 

Figure_12_Enhancement_Implementation_General_Settings.jpg

Figure 12: Enhancement Implementation – general settings

 

Figure_13_Enhancement_Implementation_Implementing_Class.jpg

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_Enhancement_Implementation_1.jpg

Figure 14: Creating an Enhancement Implementation (1)

 

Figure_15_Creating_Enhancement_Implementation_2.jpg

Figure 15: Creating an Enhancement Implementation (2)

 

Figure_16_Creating_Enhancement_Implementation_3.jpg

Figure 16: Creating an Enhancement Implementation (3)

 

Figure_17_Enhancement_Implementation_General_Settings.jpg

Figure 17: Enhancement Implementation – general settings

 

Figure_18_Enhancement_Implementation_Implementing_Class.jpg

Figure 18: Enhancement Implementation – Implementing Class

 

Figure_19_Enhancement_Implementation_Filter.jpg

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.

To report this post you need to login first.

12 Comments

You must be Logged on to comment or reply to a post.

  1. Yasemin ULUTURK

    Hi Sander,

    For many of the bw consultants it is difficult to deal with abap coding, I just think that we should know as much as we require and this is something we need to know 🙂 Thank you for sharing this document…

    (1) 
    1. Sander van Willigen Post author

      Hi Suman,

      First of all, thanks a lot for your positive feedback. Let me try to reply to your question.

      The main motivation for this approach is not performance although all BAdIs are kernel-based (i.e. the latest and fastest enhancement technology available). The rationale is achieving a safer system that is much better/easier to manage and support. I decided to update the introduction part of my blog to better highlight the advantages.

      Best regards,

      Sander

      (0) 
      1. S Simran

        Hi Sander,

        we have this “Raise no_processing” statement earlier that we used to write in CMOD for customer exits.

        Now with this enhancement spot, what would be the appropriate statement to write as the older one is giving errors saying as :

        “Method IF_RSROA_VARIABLES_EXIT_BADI~P  Old exceptions and class-based exceptions cannot be used at the same time”.

        Any suggestions?

        (0) 
        1. Sander van Willigen Post author

          Hi,

          Interface IF_RSROA_VARIABLES_EXIT_BADI is reused from standard SAP BAdI RSROA_VARIABLES_EXIT_BADI as part of Enhancement Spot RSROA_VARIABLES_EXIT. In method PROCESS class-based exception CX_RS_ERROR is defined. This exception is catched in the generic coding.

          So you have to replace statement RAISE NO_PROCESSING by:

          RAISE EXCEPTION TYPE CX_RS_ERROR.

          Best regards,

          Sander

          (0) 
            1. Sander van Willigen Post author

              Hi,

              C_CHECK_AGAIN is useful if your scenario is as follows. A Variable has to be appear on the Variable Pop-up so that a user can input values. At the same time, the Variable must be post-processed by the customer-exit. In this case you can define a”customer-exit” Variable which is “ready for input”. Write a small piece of coding for i_step = 1 so that the same Variable is processed again in i_step = 2.

              Sample code:

              CASE vnam.

                WHEN <variable_x>.

                  IF i_step = 1.

                    c_check_again = ‘X’.

                  ELSEIF i_step = 2.

                    …  “your coding to post-process…

                  ENDIF.

              The user can input on the variable pop-up but setting the parameter C_CHECK_AGAIN to ‘X’ will trigger the same Variable in i_step = 2. Now your “post-processing” coding will be called.

              Best regards,

              Sander

              (0) 
  2. Cynara Kidwell

    Hi! Thank you for this framework.  That said, I cannot find the attached “YCL_RSROA_VARIABLES_EXIT_v1.txt” and  ‘YCL_0FISCPER_C_C_I_0000_v1.txt”  Can you please provide a link to these files?  or email them to cynarasap@yahoo.com?

    Thank You!

    Cynara

    (1) 
  3. Jonathan SABY

    Hi! Many Thanks for this framework.  By the way, as Cynara, I cannot find the following files  “YCL_RSROA_VARIABLES_EXIT_v1.txt” and  ‘YCL_0FISCPER_C_C_I_0000_v1.txt”

    Could you please provide me a link to these files?  or email them to jsaby@karamba.fr ?

    Cheers!

    Jonathan

    (1) 
  4. Sunil Kattagummula

    Hi Sander

    Thanks for your information and step by step instructions.

    I got struck at Step 3, when maintaining code in class YCL_RSROA_VARIABLES_EXIT.

    ERROR: (“L_R_BEFORE_POPUP” is not a valid BAdI handle here).

    Any suggestions?

     

    Thank You!

    Sunil

    (0) 

Leave a Reply