Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Torsten_
Advisor
Advisor
45,092

The original blog can be found here: ekessler.de

In this blog I would like to try some clarity in the processing of exit variables (EXIT_SAPLRRS0_001) to bring. The emerged with BW 7.30 BAdI RSROA_VARIABLES_EXIT_BADI has to deal with Exit variable not exactly simplified. In addition, the BAdI is unfortunately not documented in the SAP Help. Furthermore, it has now also changed 60 with the 7.4 domain RSCHAVL of CHAR to SSTRING.


All exit variables described here are used to the range of values of a report limit or expand the scope of permissions. In addition, the properties described here by Exit variables for Exit variables are to be used as part of the staging in DTP's or InfoPackages.


First, however, let us first of all deal with the different types of exit variables and their processing order.


1.1      Variablentypen


If I talk about exit variables I distinguish the following types of use:

  • Ready for input
  • Not ready for input
  • Use for authorization or staging


Ready for input variables come then to use if the user should be given the opportunity to influence the outcome report individually. The basic concept of an input-ready variables provides the user determines the value for the variable, and the value could not be changed by internal processing processes (customer exit). In section 1.3, "Overriding input values", I describe how this concept can be bypassed and the user-entered value of an input-ready variables in the customer exit can be overwritten.


Reday for input variables would be processed in I_STEP = 1 and I_STEP = 3, see Section 1.2 "processing steps (I_STEP)".


Not ready for input variables come then to use if the value is to be determined by rules. Here rules are often defined (implemented) in which the variable values for input-ready variables not depending on ready for input variables are determined.

Not ready for input variables would be processed in I_STEP = 1 and I_STEP = 2, see Section 1.2 "processing steps (I_STEP)".


Exit variables can also be used as part of authorization or to staging. At exit variables that must be considered are used here, that there is no interaction with a user is usually held. This means here is the processing order another.


Therefore, it must be ensured here that combinations as ready for input, mandatory and no default value (Default value) that cause a variable dialog is needed. Process of staging (DTP, InfoPackage) are usually scheduled processes in place that are executed by background-users.


Variables of usage authorization and staging are processed only in I_STEP = 0, see Section 1.2 "processing steps (I_STEP)".


1.2 Processing steps (I_STEP)


Exit variables depending on the usage and purpose in one or more steps, the I_STEP's processed. In the section "Dependencies for Variables of Type Customer Exit" the SAP Help the I_STEP's are briefly explained. The description in the online help is unfortunately incomplete and omitted entirely on examples. Therefore, I will briefly explain each step again using examples.


1.2.1 Authorization and Staging (I_STEP = 0)


In I_STEP = 0 exit variables are processed in the authorization and are used in staging. Figure 1.1 shows the use of an exit variables within the authorization. For the processing of exit variables within the entitlement only the I_STEP = 0 is traversed.

Figure 1.1: Exit variables within the authorization


Figure 1.2 shows the use of an exit variables in staging the example of selection within an InfoPackage.

Figure 1.2: Exit variables within the Staging

1.2.2 Initialization (I_STEP = 1)


The I_STEP = 1 is used for initialization of variables and exit is run separately for each exit variable. In the first stage the input-ready variables and then not ready for input variables are processed, see Figure 1.7. (The order could be differ, depends on the release (here BW 7.31 SP06)!)


Figure 1.3 shows a typical example of initializing an input-ready variables. The variable is initialized with the current month of last year.

Figure 1.3: Initialization

1.2.3 Derivation of variable values (I_STEP = 2)

The I_STEP = 2 is used to derive the values for the non-input-ready variables Exit. Again, the variables are processed separately analogous to I_STEP = 1. To derive the values for non-input-ready variables Exit all previously detected variable values in the parameter I_T_VAR_RANGE available. In section 1.3, "Overriding values entered" I describe as well as input-ready variables can be processed here.

Figure 1.4 shows how the current variable (examination of the variable name is not shown here), the value is derived based on the value of the variable ZTKE_MONTH.

Figure 1.4: Derivation of variables

1.2.4 validation (I_STEP = 3)

The I_STEP = 3 is used to validate all recorded variables. In I_STEP = 3 all previously recorded values in the parameter I_T_VAR_RANGE are testing and validation.

The I_T_VAR_RANGE parameter contains only the variables that contain a value. That is here are the only variables included:

  • value set by default value or
  • value set by an implementation (I_STEP = 1 or I_STEP = 3) or
  • user entered a value in the variable dialog

In I_STEP = 3 can not be changed, the values of the individual variables. It is possible to generate messages which would be display with the report-result or the variable dialog. In the event that the validation of the variables means that it makes no sense to run the report by throwing an exception (RAISE EXCEPTION) to prevent the report is run. The exception means that the user re-enters the values in the variables dialog.

Figure 1.5 shows the values for the two variables ZYEARFROM and ZYEARTO determined and then compared as in I_STEP = 3. If the FROM value greater than TO value of a message is issued and using the RAISE statement wrong_value prevents the report is run. The user has the opportunity to correct the value in the variable dialog.

Figure 1.5: Validation - Customer Exit

Figure 1.6 shows similar to the example in Figure 1.5, as in the object-oriented context to run the report can be prevented. The exception must be thrown here in the object-oriented context.

Figure 1.6: Validation - BAdI

1.3 Execution Order of I_STEP

Figure 1.7 shows the sequence in which the individual's I_STEP under a BEx reports. I distinguish the two phases:

  • Präparation (preparation phase) and
  • Validierung (Validation Phase)

The I_STEP's the preparation phase are run before the variable dialogue and I_STEP's validation phase will only go through if the values of the input-ready variables change in the variables dialog.

Figure 1.7: Processing of exit variables (I_STEP's)

That is the calling SAP standard processing procedure initially assumes that the user accepts the default values of the variables dialog without changing. In this case, the validation phase is not run again!

The process steps of the validation phase will only go through if the values in the dialog variables were changed by the user.

1.4 Processing of process variables Exit

With BW 7.3 the BAdI RSROA_VARIABLES_EXIT_BADI was introduced and presented to the customer exit EXIT_SAPLRRS0_001. The blog Coexistence of BAdI RSROA_VARIABLES_EXIT_BADI and Customer-Exit EXIT_SAPLRRS0_001 shows how the BAdI and the customer exit behave in a BW 7.3 system.

Figure 1.8 shows the individual processing blocks which are executed as part of the variable processing of exit variables.

Figure 1.8: Variables processing

The standard processing process first checks whether an active BAdI implementation by Type RSROA_VARIABLES_EXIT_BADI is available. As a filter value here, the technical name of the InfoObject is used on the exit variable based currently being processed. From a technical perspective, this test is performed within the function block RRS_VAR_EXIT via GET BADI.

The blog New BAdI RSROA_VARIABLES_EXIT_BADI describes the manufacturing process of the BAdI's in the details.

1.5 Overriding input values

The basic principle for input-ready variables was initially that user entered values can not be overwritten. An input-ready variable is not processed by default after the variable dialog as a single variable.

In I_STEP = 3, the variable can indeed be validated but not be changed. If it is determined during validation that the user entered value is not meaningful, in the I_STEP = 3 is a message that the user generated informed. In addition, an exception will be thrown. The exception ensures that the variables dialog appears again.

With the introduction of the parameter E_CHECK_AGAIN (see Note 1272242 - Renewed Variablenverprobung in I_STEP = 2), the concept was canceled. The parameter allows the developer to the user-entered value of an input-ready variables after the variable dialog in I_STEP = 2 to overwrite as needed.

As described in Section 1.2 "processing steps (I_STEP)" input-ready variables only in I_TEP = 1 and I_STEP = 3 processed, the value only in I_STEP = 1 changes (initialiesiert) can be. To ensure that an input-ready variables in I_STEP = 2 is again processed must be in I_STEP = 1 for this variable is the export parameters E_CHECK_AGAIN (E_CHECK_AGAIN = 'X') are set. If the parameter is set E_CHECK_AGAIN so this is ready for input variable is processed into a not ready for input variables in I_STEP = 2 analogous to the variables dialog.

26 Comments