Skip to Content

Introduction:


With BW 7.3 version, SAP delivers the BAdI RSROA_VARIABLES_EXIT_BADI (BADI to fill variables).
The BAdI is the Customer upstream exit, that is, the calls the BAdI customer exit on. The below figure shows the call sequence and using the BAdI’s in combination with Customer Exits and BAdI implementations by the customer
.


/wp-content/uploads/2014/04/1_434034.jpg


This BAdI Class calls the PROCESS method of all active BAdI implementations and the interface of the BAdI method PROCESS interface is identical to the interface of the function module EXIT_SAPLRRS0_001 the customer exit. This means that the source code of the customer exit can be fully adopted; this will reduce the migration effort.


The step by step procedure to create an implementation for a customer exit variable using this new BAdI has been discussed in detail in the subsequent section.

Step by Step Procedure:


To create a BAdI implementation of the new technology, there are several ways.

       1. About the BAdI definition (transaction SE18)

       2. Use the BAdI implementation (transaction SE19)

       3. Üsing the ABAP Workbench (transaction SE80)

Go to transaction SE18, give the BAdI name as ‘RSROA_VARIABLES_EXIT_BADI’ and press the ‘Display’ button as shown below.

/wp-content/uploads/2014/04/2_434035.jpg


Now, Click on the ‘Create BAdI Implementation’ button as shown below.

/wp-content/uploads/2014/04/3_434036.jpg


A BAdI implementation cannot be created directly within a BAdI definition. First we have to create an Enhancement Implementation.


The subsequent screen prompts us to select the existing standard ‘CL_RSROA_VAR_SMOD’ implementation or to create a new one. Since we need to create a new one we click on the ‘Create Enhancement Implementation’ button as shown below.

/wp-content/uploads/2014/04/4_434037.jpg

Give the details of the Custom Enhancement Implementation as shown below and proceed.

/wp-content/uploads/2014/04/5_434038.jpg

This creates the new Enhancement Implementation ZRSROA_ENHANCEMENT_IMPL,  Select it and proceed further.

/wp-content/uploads/2014/04/6_434039.jpg


Now create the new BAdI implementation ZRSROA_BADI_IMPL by specifying  the new implementing class ZCL_ RSROA_VARIABLES_EXIT_BADI as shown below and continue and complete the activation process as shown in the below screenshots.


/wp-content/uploads/2014/04/7_434040.jpg


/wp-content/uploads/2014/04/8_434041.jpg


/wp-content/uploads/2014/04/9_434042.jpg


Once the activation of BAdI Implementation, Enhancement Implementation and Implementing Class is complete we need to specify the info objects for which the customer exit variables are to be defined in the ‘Filter Val.’ Selection of BAdI.


Now, double click upon the ‘Filter Val.’ and Create a new filter combination as shown below.

/wp-content/uploads/2014/04/10_434043.jpg


Change the filter combination value as = blank for IOBJNM. This step is required as for I_STEP = 3 there is no clear variable and no clear info object name. As in I_STEP 3 all variables in the current report are available in the form of a table parameter, for the BAdI implementation to be used for processing in I_STEP 3 the filter value of  IOBJNM must be expanded to =” (blank).

/wp-content/uploads/2014/04/11_434044.jpg


/wp-content/uploads/2014/04/12_434045.jpg


Now, the info objects for which customer exit variables are to be processed need to be added separately. For e.g., If a variable on 0CALMONTH needs to be processed in Customer Exit mode then it should be added as shown below.

/wp-content/uploads/2014/04/13_434046.jpg


Note: To extend the above functionality to Formula and Text variables of processing type Customer Exit the IOBJNM filter needs to be populated with the values ‘1FORMULA‘ and ‘1TEXT‘ respectively in new Filter Combinations.

After the completion of above steps double click on the Implementing Class and click the ‘Change Class’ button as highlighted below.

/wp-content/uploads/2014/04/14_434047.jpg


Click to change the ‘Code’ button as shown now.

/wp-content/uploads/2014/04/15_434048.jpg


Change the code in the METHOD as below and activate.

/wp-content/uploads/2014/04/16_434049.jpg

/wp-content/uploads/2014/04/17_434050.jpg

/wp-content/uploads/2014/04/18_434051.jpg

Explanation of Code:


Since each of the individual steps for I_STEP has different meanings we made a generic definition that calls the individual function modules. This improves flexibility w.r.t transport of existing and new variables as and when they are changed/created and also facilitates the modularization of code.


For example If we have a customer exit variable ZCAL_BADI_TEST on the info object 0CALMONTH and if its logic needs to be implemented for I_STEP = 1 we need to create/define a new function module with the naming convention ZVAR_PRE_POPUP_ZCAL_BADI_TEST.


Similarly if the logic needs to be implemented for I_STEP = 2 of the same variable we need to create/define a function module with the naming convention ZVAR_POST_POPUP_ZCAL_BADI_TEST and for I_STEP =0 it has to be ZVAR_AUTHORITY_ZCAL_BADI_TEST.


For I_STEP = 3 since it’s not specific to a clear variable or info object we can use a common function module ZVAR_CHECK_VALIDITY.


All the function modules corresponding to the variables are to be created with the below parameters.


/wp-content/uploads/2014/04/19_434052.jpg

/wp-content/uploads/2014/04/20_434053.jpg

/wp-content/uploads/2014/04/21_434054.jpg

In the next section a test scenario has been explained which incorporates this procedure.

Test Scenario:


Created a custom InfoCube ZTESTBADI and populated it with data as shown below.

/wp-content/uploads/2014/04/22_434055.jpg


Created a Query on top of it with the structure as shown below.

/wp-content/uploads/2014/04/23_434056.jpg


The current month counter is restricted with an input variable ZTEST_INPUT for 0CALMONTH info object as shown under.

/wp-content/uploads/2014/04/24_434057.jpg


The previous month counter is restricted with a customer exit variable ZCAL_BADI_TEST.
In our scenario the logic needs to be defined such that it takes the input value from ZTEST_INPUT and populates the previous month value for the variable ZCAL_BADI_TEST
.


/wp-content/uploads/2014/04/25_434058.jpg

Since the processing needs to be done for I_STEP = 2 we create/define a function module ZVAR_POST_POPUP_ZCAL_BADI_TEST  as per the naming convention and with the import/export parameters as mentioned before with the appropriate code and populate the desired output into C_T_RANGE.

/wp-content/uploads/2014/04/26_434059.jpg


Upon executing the Query in debug mode we can observe that the I_STEPs 1, 2 and 3 are successfully accessed and the logic is working as desired.

/wp-content/uploads/2014/04/27_434060.jpg


I_STEP = 1 hit before variable input.

/wp-content/uploads/2014/04/28_434061.jpg


After I_STEP =1 enter the variable input for CALMONTH variable ZTEST_INPUT.  E.g., 03/2013.

/wp-content/uploads/2014/04/29_434062.jpg


Now at I_STEP =2 after variable input.

/wp-content/uploads/2014/04/30_434063.jpg


Finally I_STEP = 3 and then the output.

/wp-content/uploads/2014/04/33_433948.jpg


/wp-content/uploads/2014/04/34_434033.jpg


We can observe that the output results are matching with those of InfoCube data for current input month entered and its previous month and the exit variable implemented through the BAdI RSROA_VARIABLES_EXIT_BADI Implementation is working correctly as desired.

To report this post you need to login first.

4 Comments

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

  1. Roman Bukarev

    So you do all these steps just to introduce a dynamic function call in the BADI implementation class.

    And just what advantage does it have over directly using that dynamic function call in ZXRSRU01 ?

    (0) 

Leave a Reply