This blog has been translated with Google Translate. the original blog can be found here: ekessler.de
In the blog BAdI RSROA_VARIABLES_EXIT_BADI I have shown how exit variables using the BAdI RSROA_VARIABLES_EXIT_BADI can be processed.
Now In this blog I want to deal with the coexistence of BAdI and customer exit. First, you should always consider I need the new technical way the SAP me here provides or can I also use the (customer exit) life?
The customer exit for BEx variables has always been a good candidate for unstructured, extensive and historically (often hysterical) grown Coding. This is due to the fact that the exit (Include ZXRSRU01) usually from many different developers (often short-term purchased external consultants) will be processed with different programming views (functional or Objektorientier). Not infrequently, bring this their procedures and approaches to structuring the customer exit (call dynamic function blocks / methods, nesting Includes, ...) from other projects with a.
Another reason that makes a structuring of the customer exits so complicated is the interleaving of two case distinctions. Firstly, it must be distinguished according to the current process step, the I_STEP, and secondly, by the variable to be processed. This nested branching nearly impossible to exit structuring. For this reason, a lot of different methods have been developed for customers all over how to tackle the problem. The following methods can be found in practice (partly slightly modified):
Often customers have invested a lot of work into the development of such a concept and a migration towards the BAdI RSROA_VARIABLES_EXIT_BADI is made difficult by this method. It is therefore important that is initially clarified whether the use of the new BAdI also brings much added value that the migration effort worthwhile. To understand where the added value of using the BAdI's against the customer exit is I want to describe the use and the internal processing of exit variables and the interaction of the BAdI RSROA_VARIABLES_EXIT_BADI and the customer exit briefly here.
To understand the internal processing process, it is first necessary to understand how the BAdI RSROA_VARIABLES_EXIT_BADI works. In the BAdI RSROA_VARIABLES_EXIT_BADI is a "new" BAdI. New BAdI are organized in enhancement spot. As known in the rule of the BAdI name, not the enhancement spots I always climb in through the BAdI Builder (transaction SE18) to edit the BAdI implementations. Furthermore, the BAdI RSROA_VARIABLES_EXIT_BADI is a filter-based BADI. As filter the BAdI uses the info object that forms the basis for the BEx variable. Figure 1.1 shows on the left the SAP code to handle variables. If it is in the current variables to be processed by an exit variable by means
GET BADI variable_exit
FILTERS
iobjnm = i_iobjnm.
tested whether an active BAdI implementation exists in the filter settings to the info object names match. That is the calling process within the SAP standard variable processing, checks whether the BAdI Framework is an active BAdI implementation for a filter value.
If an active BAdI implementation found PROCESS method of the class of the BAdI implementation is called:
CALL BADI variable_exit->process
EXPORTING
i_vnam = i_vnam
i_vartyp = i_vartyp
i_iobjnm = i_iobjnm
i_s_cob_pro = i_s_cob_pro
i_s_rkb1d = i_s_rkb1d
i_periv = i_periv
i_t_var_range = i_t_var_range
i_step = i_step
CHANGING
c_t_range = e_t_range
c_no_screen = e_no_screen
c_check_again = e_check_again
c_s_customer = c_s_customer.
The definition of the BAdIs RSROA_VARIABLES_EXIT_BADI allows more than one active implementation (Multible use) to form a filter value. Find the BAdI framework for a filter value several active implementations are all performed sequentially. Here, the order is indeterminate.
Figure 1.1: Processing of exit variables
In addition to the BAdI definition RSROA_VARIABLES_EXIT_BADI were running SAP in the standard of an active BAdI implementation (SMOD_EXIT_CALL). (= IOBJNM <>'' or IOBJNM'') of the filter value of this implementation is defined so that this implementation will always be used as BAdI active implementation.
The BAdI implementation SMOD_EXIT_CALL is characterized in Release 7:30 as the default implementation. As a result, this implementation is called only if no other active implementation is found. It must be noted that the filter value is taken into account when determining the active implementations.
I will illustrate this with a small example. As part of a migration project, we want to change the processing of the exit variables of the processing in the customer exit to the BAdI based variant. The migration project can not be implemented in a Big Bang but due to the scope. So that some variables in the customer exit and some in the BAdI be processed.
Variables and basic information items:
BAdI implementations for variables and the filter
Query and variable
Query processing ZTKE_Q_DAY
First, we consider the processing in I_STEP = 1
When you call the query ZTKE_Q_DAY the standard SAP processing determines all active Implementation to the filter 0CALDAY that are not marked as a default implementation.
GET BADI variable_exit
FILTERS
iobjnm = i_iobjnm.
Here the BAdI Framework will only find the BAdI implementation ZTKE_IMPL_CALDAY (filter IOBJNM = '0 CALDAY ').
In I_STEP = 3 BAdI BAdI Implementation Framework only ZTKE_IMPL_CALDAY place again (filter IOBJNM =''). In I_STEP = 3 all variables for validation (i_t_var_range) are available. I_vnam The parameters and i_iobjnm are I_STEP = 3 initial.
Query processing ZTKE_Q_YESTERDAY
Again, we first consider the processing in I_STEP = 1
When you call the query ZTKE_Q_YESTERDAY the standard SAP processing determines all active implementation to the filter 0CALDAY that are not marked as a default implementation.
GET BADI variable_exit
FILTERS
iobjnm = i_iobjnm.
Here the BAdI Framework will only find the BAdI implementation ZTKE_IMPL_CALDAY (filter IOBJNM = '0 CALDAY ')! But we want to take advantage of the processing in the customer exit. This can be the case if, as have, the processing for this variable is not yet migrated in our example. Below I show how this can be implemented.
In I_STEP = 3 BAdI BAdI Implementation Framework only ZTKE_IMPL_CALDAY place again (filter IOBJNM =''). Here the same applies as I_STEP = 1
Query processing ZTKE_Q_WEEK
Again, we first consider the processing in I_STEP = 1 When you call the query ZTKE_Q_WEEK the standard SAP processing determines all active implementation to the filter 0CALWEEK that are not marked as a default implementation.
GET BADI variable_exit
FILTERS
iobjnm = i_iobjnm.
Here you will find the BAdI Framework no active implementation that is not marked as a default implementation!
The default implementation SMOD_EXIT_CALL is used as the active implementation.
In I_STEP = 3 BAdI BAdI Implementation Framework finds the ZTKE_IMPL_CALDAY (filter IOBJNM ='').
The following points should be noted:
In a SAP BW / .3 system of BAdI RSROA_VARIABLES_EXIT_BADI and the customer exit EXIT_SAPLRRS0_001 can not be operated in parallel without further ado, see example above. To ensure that the customer exit is always run, it is necessary to set up your own BAdI implementation to this. For the BAdI implementation, the filter values are defined analogously to the SAP standard implementation.
Figure 2.1 shows a BAdI implementation to call the customer exits.
Figure 2.1: BAdI definition for Customer Exit
Figure 2.2 shows the filter values of the BAdI implementation.
Figure 2.2: Filter values of the BAdI implementation
Listing 2.1 shows the implementation of the PROCESS method of BAdI implementation. Within the implementation of the call to the customer exit is passed. It should be noted that it must be ensured not be deleted that may have already been determined value. The parameter E_T_RANGE of the function block is a pure export parameters, ie if the parameter C_T_RANGE was already filled in another BAdI implementation, this value must be saved before calling the exit.
METHOD if_rsroa_variables_exit_badi~process.
DATA: lt_range_tmp TYPE rsr_t_rangesid.
IF c_t_range IS NOT INITIAL.
APPEND LINES OF c_t_range TO lt_range_tmp.
ENDIF.
CALL FUNCTION 'EXIT_SAPLRRS0_001'
EXPORTING
i_vnam = i_vnam
i_vartyp = i_vartyp
i_iobjnm = i_iobjnm
i_s_cob_pro = i_s_cob_pro
i_s_rkb1d = i_s_rkb1d
i_periv = i_periv
i_t_var_range = i_t_var_range
i_step = i_step
IMPORTING
e_t_range = c_t_range
* E_MEEHT =
* E_MEFAC =
* E_WAERS =
* E_WHFAC =
e_no_screen = c_no_screen
e_check_again = c_check_again
CHANGING
c_s_customer = c_s_customer.
IF lt_range_tmp IS NOT INITIAL.
APPEND LINES OF lt_range_tmp TO c_t_range.
ENDIF.
ENDMETHOD.
Listing 2.1: Implementation of the PROCESS method
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
32 | |
24 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |