0% found this document useful (0 votes)
6 views

B. Creating Characteristic Value and Text Variables

The document discusses the creation and implementation of characteristic value and text variables in SAP BW/4HANA queries. It explains how these variables can enhance query flexibility by allowing dynamic values and descriptions, as well as the use of pre-defined variables from the SAP BW/4HANA Content Add-On. Additionally, it covers the use of CURRENT MEMBER variables for time-related characteristics and their constraints.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

B. Creating Characteristic Value and Text Variables

The document discusses the creation and implementation of characteristic value and text variables in SAP BW/4HANA queries. It explains how these variables can enhance query flexibility by allowing dynamic values and descriptions, as well as the use of pre-defined variables from the SAP BW/4HANA Content Add-On. Additionally, it covers the use of CURRENT MEMBER variables for time-related characteristics and their constraints.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

B.

Creating Characteristic Value and


Text Variables

III. Characteristic Value Variables


When selecting characteristic values in the query definition, you can select variables instead of fixed
values. Variables act as placeholders and are filled with values when you execute the query. You can
use variables to select single values, value ranges, or combinations of these.

6. Usage Options for Characteristic Value Variables


• Fixed Filter values
• Default Filter values
• Restricted key figures
• Selections without key figures (within Characteristic Structures)

IV. Text Variables


Text variables are used when any description used in a query should be dynamic. For example, if your
restricted key figure is defined as the quantity sold in Austria for 2023, then it would be helpful if the
description of the column in the result would include the country and the year. In this case, the
description would then be Quantity Sold in Austria during 2023.. If you didn't use text variables then
the description would simply be Quantity Sold, which is certainly not helpful to the report consumer.
You can use text variables in query descriptions, calculated and restricted key figures, and structural
components.
Text variables can be processed by the replacement path method so that they are replaced with a value
from a corresponding characteristic or from a different variable at run-time. The replacement value
can be determined from the Name (for example Dec 2023), from the External Key (for example,
12.2023), or from the Key (for example, 202312). Additionally, you can define an offset start and
offset length for the text.

V. Characteristic Value Variables and Text


Variables
In the following videos, we increase the flexibility of Queries by using Characteristic Value Variables
and Text Variables.

3
C. Implementing Variables delivered by
SAP BW/4HANA Content Add-on

VI. Variables delivered by SAP BW/4HANA


Content Add-On (Business Content Variables)
SAP provide ready-to-use variables for many common scenarios. All types of variable are supported
such as characteristic value type and text variables. These SAP-provided variables are delivered in the
SAP BW/4HANA Content Add-On.
Before you can use these variables, they must be activated. Activating objects delivered by SAP
BW/4HANA Content Add-On is a task that is typically carried out by SAP BW/4HANA
administrators or architects.

7. Features of Variables delivered by SAP BW/4HANA


Content Add-On
• Must be activated before they can be used.
• Help to accelerate query design.
• Contain processing type SAP Exit as well as other processing types.

8. Types of Variables delivered by SAP BW/4HANA Content


Add-On
Variables delivered by SAP BW/4HANA Content Add-On may be of different types, for example,
there are simple characteristic value variables: 0P_PRODUCTS that allows a manual entry for the
Product ID (0D_NW_PRID) characteristic, for example.
Some variables delivered by SAP BW/4HANA Content Add-On have the processing type SAP Exit,
meaning that they contain program code. An example of such a variable is the 0CXIO_CML12CMCY
variable for the Cal. year / Month (0CALMONTH) characteristic. This variable returns the Last 12
Months including Current Month. You can adapt content variables (and of course self-built variables as
well) with offsets; for example, if you need to go six months into the past, you can add an offset of -6.
When you need a variable with program logic, search in SAP BW/4HANA Content Add-On. If you
find a suitable variable with an SAP Exit, you do not need to create an own variable with a Customer
Exit or an SAP HANA Exit.

VII. Variable Offset


You use variable offsets to analyze key figures that have a fixed time relationship to each other, for
example, to compare the net order amount from the current time period with the net order amount of
the same time period in the previous year.

4
You can use the same variable several times to restrict key figures and determine a difference from the
input value.

Figure 1: Variable Offset

You can also define the range between two variables as a restriction. Select the required start variable
and end variable and choose Create Range. If the variables are characteristic value variables (Single
Value), you can also specify offset values for the interval built from these variables in the Enter Offsets
Values for Range dialog box.

Figure 2: Create Range and enter Offset Values for Ranges

5
Figure 3: Change Offset Values for Range

VIII. Variables from SAP BW/4HANA Content Add-


On and Variable Offset
In the following video, we use variables from SAP BW/4HANA Content Add-On and Variable Offset
to compare different time periods with each other.

IX. Variables with Replacement Path Current


Member
CURRENT MEMBER variables are not a variable type, they are processed by Replacement Path with
Replacement SourceCurrent Member. With a CURRENT MEMBER variable, you can define filters for
structure elements of a query; these filters have limits that depend on the value of a characteristic in
the drilldown.
CURRENT MEMBER variables 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

Figure 4: The technical content in SAP BW∕4HANA

The corresponding variables for the content time characteristics are delivered with the technical
content in SAP BW∕4HANA. The technical name of the variables is made up of the prefix 0CURMEM_
and the technical name of the time characteristic, 0CURMEM_CALDAY or 0CURMEM_CALMONTH for
example. You can also create a variable of your own

6
CURRENT MEMBER variables have been introduced with BW7.4.

Figure 5: The example query P_QD_CURRENT_MEMBER_VARIABLE_001

The example query P_QD_CURRENT_MEMBER_VARIABLE_001 above illustrates a variety of ways in


which a CURRENT MEMBER variable can be used. There are six structure elements in this example.
• Net Order Amount USD: This is the basic key figure. It retrieves the net sales of the month
in drilldown.
• Net Order Amount USD - 1: In this selection, there is a restriction on Calendar Year/Month
with variable 0CURMEM_CALMONTH with an offset value -1.
• 01.2013 to Current Member: In this selection, there is a restriction on Calendar Year/Month
with variable 0CURMEM_CALMONTH with a range between January 2013 to current member.
• Current Member to 12.2013: In this selection, there is a restriction on Calendar Year/Month
with variable 0CURMEM_CALMONTH with a range between current month that is being processed
to December 2013.
• (Current Member - 2) to Current Member: In this selection, there is a restriction on Calendar
Year/Month with variable 0CURMEM_CALMONTH with a range between current month that is
being processed with an offset value -2 to current month.
• AVG ((Current Member - 2) to Current Member): An exception aggregation Average on
reference characteristics Calendar Year/Month.

9. Constraints for CURRENT MEMBER variables


• Can only be defined for time characteristics.
• Can only be used if the time characteristics of the selected InfoProvider have the same
semantics and are thus dependent on each other.
• Can only be used in selections of a structure element or in a restricted key figure, but not in
the filter for the query

You might also like