SAP BW: How To Create And Use Precalculated Value Sets (Buckets)
Precalculated Value Sets (Buckets)
To make SAP BW BEx queries more flexible & interactive, SAP Has given numerous functionalities in BEx Designer and Analyzer. BEx variables is one of those. There are multiple types of variables provided by SAP.
This document helps you to understand BEx variable with precalculated value set (Buckets) along with creation and use of it in BEx query.
Author : Pradip Nikam
Company : Cognizant Technology Solutions
Created on : 28 Nov 2018
Author Bio :
Pradip Nikam is working with Cognizant Technology Solutions. Pradip has worked on various SAP BW implementation & support projects.
Table of Contents
- Step By Step Procedure
- Bucket Definition
- Variable Creation
- Use in Query
This Article describes how to create Pre-calculated value set functionality in SAP BW & use it in BEx query.
A bucket is a pre-calculated value set that is stored either in a database table or in an index in SAP BW Accelerator and can be used as a filter in a BEx query.
The filter is defined in a BEx query as a variable of type Pre-calculated Value Set and executed at runtime.
Use of Precalculated Value Sets (Buckets) results in significant runtime improvements if large amounts of data are processed in the bucket.
Step By Step Procedure to create & use Precalculated Value Set (Bucket):
- Bucket Definition
Transaction Code – RSBUCKET
Specify the characteristic for which you want to use Precalculated value set.
Also specify the name of Bucket.
You can also enter a description.
To fill a bucket with data, you can either use a reference table or add the data directly.
If you want to use an existing reference table, select Use Existing Sources. You can select the reference table under Existing Table or Index. The system can read the data either from a specified column in a database table or from a column in an index in SAP BW Accelerator.
Here we use reference table Data.
Specify whether the reference is an ABAP table or an index in SAP BW Accelerator.
Choose either key values or SID values.
In the Field Name in Table/Index field, specify the column that you want the characteristic values to be read from.
Save the settings.
- BEx Variable Creation:
Create the characteristic value variable with type pre-calculated value set on the same characteristic on which bucket has been defined.
- Use the same variable in the query:
Upon query execution
You can see the same bucket you defined for characteristic.
The system has precalculated the required value set, which is now available in the form of a bucket. If you have updated bucket values manually, you can add, change, delete the bucket values.
A variable that refers to buckets can only be used as a filter in characteristic restrictions.
At first, I thought of it as a quick hack before implementing something more structural. But makes sense, for overlapping sets as an example. Though you could achieve the same with attributes or hierarchies, who needs an attribute only for a couple of queries? Especially makes sense if you give RSBUCKET tcode to a knowledgeable key user.