SAP Restricted Key Figures

SAP Restricted Key FiguresIn this SAP BW tutorial, we will talk about SAP Restricted Key Figures. This tutorial is part of SAP BW course. Here you will learn what is a restricted key figure and how to use it in SAP Query Designer for reporting purposes.

SAP Restricted Key Figures

Key Figure

Key figure is a measurable object that defines and stores data of numerical type like quantity, revenue, weight, etc. Whereas SAP BW characteristics are informational attributes that describe an InfoObject, for example customer, material, product, etc.

Whenever we talk about the Key Figures, we can create them using three different types in the query designer:

  1. SAP Basic Key Figures
  2. SAP Restricted Key Figures
  3. SAP Calculated Key Figures

SAP Basic Key Figures

SAP Basic Key Figure is defined as any Key Figure that is coming directly from the InfoProvider because it’s already there in the system. You can see SAP basic key figures on the column panel in the picture below.

Basic key figures ZSP_QUANTITY, ZSP_REVENUE are already in the InfoCube and we can use them directly for reporting with no additional processing.

Basic Key Figures in Query Designer
Basic Key Figures in Query Designer

We should always use SAP basic key figures in reporting because it is beneficial. We don’t have to do any extra manipulation to show SAP basic key figures on the screen. The system doesn’t need extra processing to look at the basic data.

Unfortunately, this is not always possible in the real world. SAP basic key figures can probably be used in 50-60% of cases to do reporting. In other cases, we need to create some other kind of key figures during query definition time. That’s where SAP Restricted Key Figures and SAP Calculated Key Figures come into picture. Here we will talk about SAP Restricted Key Figures.

SAP Restricted Key Figures

SAP Restricted Key Figures are defined by restricting basic key figures using a set of characteristics or by applying a filter on the data based on a specific set of InfoObjects.

While creating SAP Restricted Key Figures we can add as many characteristics to restrict data as necessary. It means that the system will create a new key figure at query definition time. Normally we can’t filter on key figure information because it’s a measurable object without characteristic.

Now, let’s discuss a business scenario where we use SAP Restricted Key Figures.

SAP Restricted Key Figures: Business Scenario

We have sales data for CUSTOMER, MATERIAL, QUANTITY and REVENUE. In below picture, you can see how the data is structured for reporting.

Actual Sales data in the Report
Actual Sales data in the Report

Now, we have sales data and want to see revenue only for a particular material, for example M01. So, for that we have to restrict Revenue for Material to M01. We have to create SAP Restricted Key Figure on Material characteristic.

Here are the steps to create SAP Restricted Key Figures.

Step 1: Open SAP Query Designer.

Step 2: Create a new query.

Step 3: Select the required InfoCube from the InfoArea path or you can select from history also if you used one recently.

Selecting Required InfoProvider
Selecting Required InfoProvider

Next, click OK. Then, you will get SAP Query Designer screen with all the InfoObjects which are in the InfoCube.

After Opening InfoProvider in a New Query
After Opening InfoProvider in a New Query

Step 4: Now drag and drop characteristics to Rows and key figures to Columns on the right-hand side.

ZSP_CID (CUSTOMER), ZSP_MID (MATERIAL) to Rows.

ZSP_QUANTITY, ZSP_REVENUE to Columns.

Drag and drop Key Figures and Characteristics to Columns and Rows
Drag and drop Key Figures and Characteristics to Columns and Rows

Step 5: Select Key Figures and right-click to select New Selection.

Creating SAP Restricted Key Figure by Selecting New Selection Option
Creating SAP Restricted Key Figure by Selecting New Selection Option

Step 6: Next, click Edit button.

Opening Edit Tab
Opening Edit Tab

Step 7: It pop up a window to enter Description, Technical name and to select the restricted objects.

Description -> REV_RKF

Tech name -> REV_RKF

Drag and drop Material and Revenue to the right-hand side.

Enter Description, Technical Name and Select Restricted Objects
Enter Description, Technical Name and Select Restricted Objects

Step 8: Right-click on Material and select Restrict option.

Restricting the Material by Selecting Restrict Option
Restricting the Material by Selecting Restrict Option

Step 9: Now, select Single Values in Selection drop-down field. Next, drag M01 value to the right-hand side.

Selecting M01 Value and Dragging to Right Side
Selecting M01 Value and Dragging to Right Side

Step 10: Click OK. Here, you can see that a new SAP Restricted Key Figure is created in the Columns area – REV_RKF. Now, save the query.

SAP Restricted Key Figure REV_RKF and Saving the Query
SAP Restricted Key Figure REV_RKF and Saving the Query

Step 11: After clicking Save button, the system will show a pop-up window to give Query name in your selected folder.

Saving the Query in Selected Folder
Saving the Query in Selected Folder

After completion of saving the Query, open SAP BEx Analyzer to run the report as shown in the below image.

BEx Analyzer Screen to Run the Query
BEx Analyzer Screen to Run the Query

Now, it will ask for Query which we want to run. Select the Query that you’ve just created and then click OK.

Select the Query to Run
Select the Query to Run

The report will be executed in Analyzer. It shows a new SAP restricted key figure (REV_RKF) and got the revenue data only for material M01.

Report with SAP Restricted Key Figure REV_RKF
Report with SAP Restricted Key Figure REV_RKF

Comparing to SAP basic key figures we have some disadvantages of using SAP restricted key figures. The main disadvantage of a Restricted Key Figure is additional processing and time taken to run the report. Whereas for basic key figure we don’t do any additional processing.

Here is an example. If we want to see revenue for material M01, firstly the report will pass this condition to OLAP engine, then the OLAP engine passes it to a corresponding InfoProvider. From there the data then comes to the report screen. After coming to the report screen, it can’t be displayed directly because the system has to do some processing (to apply the restrictions). That’s why it’s not recommended.

Whenever it is possible to store the InfoObjects at InfoProvider level, use SAP Basic Key Figures. Only in essential situations when you can’t store them at InfoProvider level, use SAP Restricted Key Figures.

Local and Global SAP Restricted Key Figures

SAP Restricted Key Figures can be created in two ways:

1. As local objects

2. As global objects

Local Objects

Local Objects means the objects which are available to one specific query only. These objects are not available for other queries. Whatever we did till now (REV_RKF restricted key figure) is saved as a Local Object.

REV_RKF Local Object
REV_RKF Local Object

If we want to use same restricted key figure in other queries for the same InfoProvider, it will not be possible. That’s why it’s called Local Object.

Global Objects

Global Objects are defined as objects which we can use in other queries under the same InfoProvider. If we create a global SAP Restricted Key Figure, then we can also use it in other queries. To create a global key figure, go to the left-hand side of SAP Query Designer screen.

Step 1: Select Key Figures then right-click and select New Restricted Key Figure.

Creating Restricted Key Figure Globally
Creating Restricted Key Figure Globally

Step 2: Create SAP Restricted Key Figure

Step 3: Click Edit button.

Edit Button
Edit Button

Step 4: A pop-up window will be shown. Here, we should enter Description, Technical name and drag objects to the right side.

Enter Description, Technical Name and Restricted Objects
Enter Description, Technical Name and Restricted Objects

Step 5: Restrict material by selecting M01 value.

Step 6: The system will then create a new global SAP Restricted Key Figure.

You can use this Restricted Key Figure in any Query under the same InfoProvider.

Global SAP Restricted Key Figure
Global SAP Restricted Key Figure

Once we’ve create a Global SAP Restricted Key Figure it also directly comes with that specific InfoProvider to other queries. We can reuse this restricted key figure in any other queries. We can create any number of queries under a specific InfoProvider.

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 Calculated Key Figures

Go to previous lesson: SAP BW InfoCube

Go to overview of the course: SAP BW Training

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 *