SAP BW Business Content Variables

Advertisement

SAP BW Business Content VariablesSAP BW Business Content Variables are delivered for all the variable types. These Business Content Variables help you to build complex queries with ease and within less time.

For time characteristics, there are a lot of SAP BW Business Content variables that are delivered by SAP to replace frequently-used time periods.

Advertisement

Let us take a look at some of the Calendar Month (0CALMONTH) based variables:

Time Characteristic Business Content Variable Description
0CALMONTH 0CMCMLY Previous year’s current month
0CALMONTH 0CMLMLY Previous year’s last month
0CALMONTH 0CMLMON Last Month
0CALMONTH 0CML12CM Last 12 months (which includes current month)
0CALMONTH 0CML12LM Last 12 months (which excludes current month)
0CALMONTH 0CML3CM Last 3 months (which includes current month)
0CALMONTH 0CML3LM Last 3 months (which excludes current month)
0CALMONTH 0CMCQUAR Current Quarter

The purpose of each of the business content variables has also been mentioned in the last column of the above table.

Now, let us take a look at some of the Calendar Date (0CALDAY) based variables:

Time Characteristic Business Content Variable Description
0CALDAY 0DAT Current Calendar Day
0CALDAY 0L_DATE Last Calendar Date
0CALDAY 0P_LY_R Comparative Period for Last Year
0CALDAY 0CYTCD Cumulated to Current Day
0CALDAY 0LYTCLD Previous Year Cumulated to Current Day

Below given are some of the other Calendar Week (0CALWEEK), Calendar Quarter (0CALQUARTER), and Calendar Year (0CALYEAR) based variables:

Time Characteristic Business Content Variable Description
0CALWEEK 0CWEEK Current Calendar Week
0CALWEEK 0PREVWK Previous Week
0CALQUARTER 0CQUART Current Quarter
0CALYEAR 0CYEAR Current Calendar Year

Based on the list of SAP BW Business Content Variables mentioned so far, don’t run into the conclusion that we have Business Content Variables just for time characteristics. The following is the list of some of the Business Content Variables for characteristics that are non-time related:

Characteristic Business Content Variable
Actual/Plan Version (Single Value Entry, Optional) 0P_VERSN
Admission Category 0S_ADMCG
Admission Date 0P_ADMDA
Activity Status 0S_ACSTA
Account Number 0S_ACC
Business Partner Group 0S_BPGRP
Company Code (Single Value Entry, Required) 0P_COCD
Cost Center 0P_CCT
Cost Center (Single Value Entry, Required) 0P_CCTR
Region 0P_REGN
WBS Element (Selection Options, Mandatory) 0S_WBSEX
Storage Location 0S_STLOC
Sold-to Party 0I_CUSTO
Sales Document (Optional) 0P_DOCNU

Demo of SAP BW Business Content Variables

Next, let us take the Deliveries Report as an example. The Query definition is given below:

Deliveries Report: Query Definition (1)
Deliveries Report: Query Definition (1)

As can be seen from the above Query Definition, the report has Division and Ship-To Party in the rows, whereas it has Delivered quantity in the columns. The following screen shows the ‘Filters’ section of the Query. The report basically has restriction on ‘Division’.

Deliveries Report: Query Definition (2)
Deliveries Report: Query Definition (2)

Requirement

Advertisement

The requirement is to show the Delivered quantity for the current calendar year and previous calendar year respectively for Division and Ship-To Party. For instance, as the current calendar year is 2017, the report should display the Delivered Quantity values for the years 2017 and 2016 respectively. The users should not be given the option/flexibility to input the year.

Though the requirement for this tutorial is fairly similar to that of SAP BW Offset Variables Tutorial, it should be kept in mind that the approach is different. Also, the SAP BW Offset Tutorial allows user to choose the year based on which Current Year Delivered Quantity and Previous Year Delivered Quantity Values get calculated. However, in this tutorial, as mentioned above, the requirement is to always show Current Year Delivered Quantity and Previous Year Delivered Quantity Values based on the current calendar year.

This tutorial is divided into the following three sections:

  • Modification of the Query to include SAP BW Business Content Variables
  • Saving the Query
  • Executing the Query

Modification the Query to Include SAP BW Business Content Variables

Let us first create Current Year Delivered Quantity and Prior Year Delivered Quantity Selections.

Current Year Delivered Quantity

Right-click on Key Figures to create a new selection. The screenshot is given below:

Creating Selection for CY Delivered Quantity Key Figure
Creating Selection for CY Delivered Quantity Key Figure

Let us now click on “New Selection” highlighted in the above screen. The following screen appears:

Removing Delivered Quantity Key Figure (1)
Removing Delivered Quantity Key Figure (1)

Let’s remove the key figure ‘Delivered Quantity’ highlighted in the above screen. The screenshot is given below:

Removing Delivered Quantity Key Figure (2)
Removing Delivered Quantity Key Figure (2)

Double click on ‘Selection 1’ and enter description of the Selection as ‘CY Delivered quantity’. The screenshot is given below:

Changing the Selection
Changing the Selection

Now, drag and drop ‘0QUANT_B’ key figure. The screenshot is given below:

Adding Key Figure to the Selection
Adding Key Figure to the Selection

As this selection corresponds to Current Year Delivered Quantity, we will add the Business Content Variable (0CYEAR) restriction. The screenshot is given below:

Adding Current Calendar Year Restriction to the Selection
Adding Current Calendar Year Restriction to the Selection

Let us now click on ‘OK’ button highlighted in the below screen to continue:

Saving the Selection
Saving the Selection

Prior Year Delivered Quantity

Let us right-click on Key Figures to create one more new selection. The screenshot is given below:

Creating Selection for PY Delivered Quantity Key Figure (1)
Creating Selection for PY Delivered Quantity Key Figure (1)

Let us now click on “New Selection” highlighted in the above screen. The following screen appears:

Creating Selection for PY Delivered Quantity Key Figure (2)
Creating Selection for PY Delivered Quantity Key Figure (2)

Double click on ‘Selection 2’ and enter description of the Selection as ‘PY Delivered quantity’. The screenshot is given below:

Changing the Selection
Changing the Selection

Now, drag and drop ‘0QUANT_B’ key figure. The screenshot is given below:

Adding Key Figure to the Selection
Adding Key Figure to the Selection

As this selection corresponds to Prior Year Delivered Quantity, we will add the Business Content Variable (0CYEAR-1) restriction. The screenshot is given below:

Adding Current Calendar Year-1 Restriction to the Selection
Adding Current Calendar Year-1 Restriction to the Selection

Now click on ‘OK’ button highlighted in the below screen to proceed.

Saving the Selection
Saving the Selection

Saving the Query

Click on highlighted in the below screen to save the Query.

Saving the Query
Saving the Query

The Query got saved successfully without any errors. The screenshot is given below:

Saved Query
Saved Query

Executing the Query

Let us now run the Query through BEx Analyzer. The variable screen is given below:

Variable Screen
Variable Screen

Select values for Division as per the following screen:

Select Values for Variables in BEx Analyzer
Select Values for Variables in BEx Analyzer

Click on ‘OK’ button highlighted in the below screen to execute the query.

Execute the Query
Execute the Query

As can be seen from the above output, Current Year Delivered Quantity and Prior Year Delivered Quantity shows the data for the years 2017 and 2016 respectively.

Report Output
Report Output

This can be tallied with the underlying BW InfoProvider Data for the years 2017 and 2016 respectively.

InfoCube Data for Year ‘2016’
InfoCube Data for Year ‘2016’
InfoCube Data for Year ‘2017’
InfoCube Data for Year ‘2017’

SAP BW Business Content Variables can be used in specific contexts readily without the need to create new variables. It is a best practice to use SAP BW Business Content Variables whenever possible without creating new variables when the Business Content Variables serve your purpose.

Advertisement

Did you like this tutorial? Have any questions or comments? We would love to hear your feedback in the comments section below. It’d be a big help for us, and hopefully it’s something we can address for you in improvement of our free SAP BW tutorials.

Navigation Links

Go to next lesson: SAP BW Offset Variables

Go to previous lesson: SAP BW Formula Variable

Advertisement

Go to overview of the course: SAP BW Training

1 thought on “SAP BW Business Content Variables”

  1. Hey I liked your content.Thank you for it.
    I am looking for SAP BW on hana 7.5 certification material do you have it?

Leave a Reply

Do you have a question and want it to be answered ASAP? Post it on our FORUM here --> SAP FORUM!

Your email address will not be published. Required fields are marked *