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.

Pic1.png

Step 1: Go to SE19 -> Create new Implementation -> Choose the enhancement spot “RSROA_VARIABLES_EXIT””.

Pic2.png

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.

Pic3.png

Step 3: Provide the BADI implementation name and Class Name as required and choose the BADI definition from the dropdown.

Pic4.png

Step 4: Populate the filter value for the BADI implementation by keying in the technical name of the info object.

Pic5.png

Step 5: Populate the variable exit logic in the method “IF_RSROA_VARIABLES_EXIT_BADI~PROCESS” of the Implementation Class.

Pic6.png

Pic7.png

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 = ‘’.
To report this post you need to login first.

5 Comments

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

  1. peng zhang

    Hi Sudheer, thanks for your infomation article. I have one doubt in the step 2.  The name of the enhancement implmentation should be ZBW_VAR_EXIT but ZBW_VAR_EXIT_XXXX since you can create individue implementation element for each variable. you don’t need create a lot or enhancement implmentation for each variable.

    please correct me if I am wrong.

    (0) 
    1. Sudheer Bethanabotla Post author

      Hello Peng Zhang –

      Not sure I understand your question right. Yes, the name of the enhancement implementation should be ZBW_VAR_EXIT_XXXX where XXXX is the name of the infoobject. As mentioned in the document above, the implementations are split by “Info objects” and not by individual “variables”.

      Hence all variables on a given infoobject (irrespective of the processing – STEP 1, 2) would be coded in the same implementation.

      Let me know if I need to clarify this a bit more. Good luck!

      (0) 
      1. peng zhang

        Hi Sudheer,

        Thanks for you reply. sorry, the variable I mentioned should be infoobject. and I mean we only need to create one enhancement implementation and for each infoobject create implementation element for each infoobject. 😆

        /wp-content/uploads/2014/03/20140330225245_421508.jpg

        (0) 
  2. S Simran

    Hi Sudheer,

    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) 

Leave a Reply