0% found this document useful (0 votes)
17 views10 pages

G. Specifying Details of Variables

The document outlines various processing types for variables in SAP BW/4HANA, including Manual Input, Replacement Path, Authorization, Customer Exit, SAP HANA Exit, SAP Exit, and BRFplus Exit. It details how each processing type functions, the contexts in which they can be applied, and the specific requirements for implementation. Additionally, it describes the variable editor interface and the different tabs available for creating and managing variables.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views10 pages

G. Specifying Details of Variables

The document outlines various processing types for variables in SAP BW/4HANA, including Manual Input, Replacement Path, Authorization, Customer Exit, SAP HANA Exit, SAP Exit, and BRFplus Exit. It details how each processing type functions, the contexts in which they can be applied, and the specific requirements for implementation. Additionally, it describes the variable editor interface and the different tabs available for creating and managing variables.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

G.

Specifying Details of Variables

XVIII. Processing Types


A variable processing type defines how a variable receives its values. The following processing types
are available:

14. Manual Input / Default Value


If you select the processing type Manual Input for an input-ready variable, you can manually enter the
required value when executing the query.
You can specify a default value when you create the variable. The default value is displayed for input-
enabled variables in the input field of the variable screen. The default value can also be used as the
variable value for fields that are not input-enabled.

15. Replacement Path


You use the Replacement Path processing type to specify the value that automatically replaces the
variable when you execute the query.
The Replacement Path processing type can be used with characteristic value variables, text variables,
and formula variables.
For example, when you enter a Characteristic value for a a characteristic value variable, you do not
need to enter manually the text for the text variable straight away. Instead, it can be retrieved
dynamically from the characteristic value or even from the characteristic value variable.
• Replacement from Characteristic Value:
Text and formula variables with the processing type Replacement Path can be replaced with a
corresponding characteristic value. The value of a formula variable has to be a number. The
value of a text variable has to be a text.
• Replacement from CURRENT MEMBER:
CURRENT MEMBER variables (variables with the replacement path CURRENT MEMBER)
can only be defined for characteristics, which relate to a calendar. These include 0CALDAY,
0CALMONTH, 0FISCPER, and other similar characteristics, as well as characteristics that
reference these. This function is not possible for other characteristics, especially pseudo time
characteristics such as 0CALMONTH2 or 0FISCPER3.
The CURRENT MEMBER variable can be used in restricted key figures as a single value, or
as either the lower limit or the upper limit in combination with an offset. However, only one
restriction with a CURRENT MEMBER variable – with a maximum of one interval – is
allowed per restricted key figure.
For example, define the value from the previous month by defining a restricted key figure, and
restricting the 0CALMONTH characteristic with the Current Member variable with an offset of -1.

14
• Replacement from Query:
Characteristic value variables with the Replacement Path processing type can be replaced with
the results of a query. The variable is replaced from the data result of the selected query.
• Replacement from Variable:
Characteristic value variables, text variables, and formula variables with processing type
Replacement Path can be replaced by the value from a different variable, the source variable.
The value is determined either from the key, the external attribute of the key, the description,
or the attribute value. You can also define an offset start and offset length. The variable is
replaced in the Variables screen with each data release.

16. Authorization
With the Authorization processing type you can specify that a variable is automatically filled with the
values from the user authorization. When the user opens a query, the system automatically selects the
data according to his or her authorizations.
The Authorization processing type can be used with characteristic value variables and hierarchy node
variables. As a precondition, you must have maintained the authorizations.

17. Customer Exit


The processing type, Customer Exit, allows you to set up a processing type for variables that is
specially tailored for your requirements. A customer exit is designed as an enhancement that you can
configure with customer-specific logic. The customer exit enables you to generate default values for
variables, or create variable values from specified variables automatically. You can also check all the
variables after they have been entered.
The prerequisite here is that you need to create the enhancement implementation for the
RSROA_VARIABLES_EXIT_BADI enhancement spot (located in package RSROA_VAR) in the ABAP
Development Tools. The BADl implementation includes the IF_BADI_INTERFACE interface.
Note
The Customer Exit processing type cannot be used with external SAP HANA views.
Processing type SAP HANA Exit is provided for this purpose.

18. SAP HANA Exit


Processing type SAP HANA Exit is a specific form of processing type Customer Exit. It allows
you to use an AMDP class implementation to determine default values for variables. We
particularly recommend using the SAP HANA Exit in queries that you want to generate an
external SAP HANA view for, and for which special requirements apply for in terms of
determining the variable values and processing performance.
In the ABAP Development Tools, you create the enhancement implementation for the
RSROA_VARIABLES_HANA_EXIT enhancement spot. This is contained in package RSROA_VAR.
The BADI implementation class requires an AMDP class containing the following interfaces:
IF_BADI_INTERFACE, IF_AMDP_MARKER_HDB, and IF_RSROA_VAR_HANA_EXIT.

15
19. SAP Exit
The SAP exit processing type is contained in variables that are delivered with SAP
BW/4HANA Content Add-On.
Note that you can use the variables provided by SAP only once they exist as an active version.
You may have to activate these delivered variables before you can use them.

20. BRFplus Exit


Variables of processing type BRFplus Exit make it possible to access the functions of the SAP
rule engine Business Rules Framework plus (BRFplus) in SAP BW/4HANA.
Variables of processing type BRFplus Exit have a BRFplus Function tab page. On this tab page,
you can assign a BRFplus function to the variable. This BRFplus function is then executed when
the variable is processed
These BRFplus functions must have a corresponding BRFplus context (signature) and a
corresponding result data object (result object).
You can set the required logic for this kind of BRFplus function in the Business Rules
Framework plus (transaction BRFPLUS).

21. Variable Types and available Processing Types


Table 1: Variable Types and available Processing Types
Characteristic Hierarchy
Text Formula Hierarchy
Value Node
Manual Input /
Yes Yes Yes Yes Yes
Default Value
Replacement from
Replacement Replacement
Replacement query, variable, or
from InfoObject from InfoObject
Path CURRENT
or variable or variable
MEMBER
Customer Exit,
Yes Yes Yes Yes Yes
SAP Exit
SAP HANA
Yes Yes
Exit
BRF plus Exit Yes Yes Yes
Authorization Yes Yes

XIX. Variable Editor


You create variables using the SAP HANA Studio variable editor. Settings are organized using the
following tabs:
• General

16
• Replacement Path
• Default Values
• Currencies and Units
• Dependencies
Only the General and Dependencies tabs always appear; the other tabs are shown depending on the
context in which you are defining the variable.
The easiest way to create a new variable is as follows:

Figure 10: Create a new variable

To find and open an existing variable, you can proceed as follows:

17
Figure 11: Find and open an existing variable

22. General Tab


You enter the technical name and the description of the variable. You enter the variable type and,
depending on the context, you can choose one of the following methods to populate the variables:
• Manual input/default value
• Replacement path
• Customer exit
• SAP HANA Exit
• BRF plus Exit
• Authorization
Depending on the context, you also have to enter the reference characteristic.
Finally, choose the display area for the Var. Represents field.

a. Variable Represents
Variable Represents is used to select the display area that the variable represents. You can choose from
the following options:

Table 2: Variable Represents


Variable Result
Represents Value
Single Value The variable represents one value only.
Multiple Single The variable represents a range of single values. As an example, use this

18
Variable Result
Represents Value
Values setting with hierarchy nodes to enable the user to enter several single nodes.
Interval The variable represents a from value and a to value.
The variable represents a combination of selected single values and intervals.
Selection Option In addition, when you select values for variables, you can use operators (>,<,=,
and so on), patterns (for example, A*), and exclude values.

The variable represents a precalculated value set of characteristic values. You


Precalculated Value
can use this variable type to select value sets created for an InfoObject at query
Set
runtime.

b. Details
Table 3: Details Value
Details Value Result
Used to specify whether the variable input is Optional, Mandatory With
Initial, or Mandatory Without Initial. A mandatory variable entry means that
Input Type the blank value # is permitted to signify an unassigned value. You can select
all data records within which the characteristic has no characteristic value.

Used to determine whether the variable is input-enabled when the query is


executed. When this option is active, the Variables screen opens when you
Input-Ready execute the query. On the Variables screen, you enter the required values,
confirm the default values, or change the default values.

Copy Personalization Used to personalize variable values for input-enabled variables for each user.
Data from Variable Personal values are saved for each variable and each user.

A. Replacement Path Tab


Use Replacement Path for text variables, formula variables, and characteristic value variables with the
replacement path processing type. Replacement path options vary, according to the type of variable
you are using.

19
Figure 12: Replacement Path Tab

With the Replacement Path Processing type, text variables and formula variables are replaced by a
value from a corresponding characteristic or from a different variable. The value for a formula variable
must be a number. The value for a text variable must be text.

c. Replacement Path: Replacement with


The table outlines the Replacement with options for text and formula variables.

Table 4: Replacement Path: Replacement with


Value Result
The value of the variable is replaced with the internal characteristic key value,
Key
for example, 201612.
External The value of the variable is replaced with an external characteristic value
Characteristic (external/internal conversion), for example, 12.2016.
The value of the variable is replaced with the name of the characteristic value,
Name
for example, Dec 2016.
The value of the variable is replaced with the value of a key figure attribute, for
Attribute Value
example, 0GROSS_WT (Gross Weight).

d. Replacement Path: Details


The table outlines the Details options for text and formula variables.

Table 5: Replacement Path: Details


Value Result
Determine whether the from value, the to value, or the difference is used
Use if Interval
when the value to be replaced is an interval.

20
Value Result
Determine the start and the length of the text output. For example, if the
Offset Start and Offset
first 10 characters of the text are to be used, the offset start value would be
Length
0 and the offset length value would be 10.
This function is only available for formula variables.
• The value of the variable is 0 if the value to be replaced is a string
Interpret Result as
Boolean Value with only blank characters or a zero.
(True=1; False=0) • The value of the variable is 1 if the value to be replaced is a string
with characters that are not blank or a number that is not zero.

Characteristic value variables are replaced by a query result with the Replacement Path Processing
type. Using a variable, you can reuse the data result of a selected query in another query as a prequery.
Each time that the query is executed, the prequery is executed first.
Note
Running a prequery may contribute to slow performance. If you do not need to run a prequery
every time you run the query, use a variable that represents a precalculated value set, so that
the variable values are stored over time.

23. Default Values


On the Default Values tab, when you define a variable, you enter one or more default values. The
default values appear on the Variables screen when you execute the query.

24. Currencies and Units


On the Currencies and Units tab, you select from these dimensions when creating formula variables:
• Amount
• Quantity
• Price (= currency/unit)
• Number (= default setting)
• Date

21
XX. Managing Functions for Variables
In the SAP BW Repository tree, the variables are listed according to the variable type and whether
they refer to a characteristic or are unassigned.
Variable maintenance functions can be accessed from the context menu, as shown in the following two
figures.
The first figure shows Characteristic Value variables, Hierarchy variables, and Hierarchy Node
variables. These variable types always refer to a characteristic, whereby Formula variables and Text
variables can refer to a characteristic, for example, in case of the processing type Replacement Path.

Figure 13: Characteristic Value variables, Hierarchy variables, and Hierarchy Node variables

The second figure shows Formula variables and Text variables without a reference to a characteristic,
for example, in case of the processing type Manual Input / Default Value.

22
Figure 14: Formula variables and Text variables without a reference to a characteristic

23

You might also like