SAP BW Structures

SAP BW StructuresWelcome to SAP BW tutorial where we will talk about SAP BW Structures. After completing this tutorial you will learn how to create SAP BW structures and how to use them in Query Designer for reporting. If you are interested in learning SAP BW, check out other tutorials in our free SAP BW training course.

SAP BW Structures

Definition

SAP BW structure is defined as a grouping of objects together where we can group key figures or characteristics in structures. In other words, SAP BW structures are combinations of InfoProvider key figures and characteristics. These are basic structural components of a BEx query that are used to define the layout of the query for a row or column.

The two different types of structures that can be created in a query for report are:

  1. Structures with key figures
  2. Structures with characteristics (without key figures)
Two Types of SAP BW Structures
Two Types of SAP BW Structures

One query can have a maximum of two structures. We can use one structure in a report rows and one structure in the report columns or use both structures in the columns or in the rows.

Key Figure Structures

Whenever we add any field into the query panel, we will see that it is automatically created under a key figure structure in the columns section as shown in below image.

Key Figure Structure
Key Figure Structure

Here we have dragged quantity and revenue to the columns section. A key figure structure automatically is created in the query when we drag and drop key figures from the InfoProvider screen to query rows and columns. This structure is by default named key figures.

Key figure structure includes the components that are based on key figures such as basic, formula, restricted key figures and calculated key figures. Each component included in a key figure structure should include a key figure. This means we can include key figures, formula key figures, selection with key figures, restricted key figures, and calculated key figures in a key figure structure.

However, a characteristic or a selection without a key figure cannot be included in the key figure structure.

Create New Key Figure Structure

To create a key figure structure other than the default one, select Key Figures, right click, and select New Structure.

Creating Structure for Key Figures
Creating Structure for Key Figures

Then, select New Selection.

Choose New Selection
Choose New Selection

After clicking New Selection, give an appropriate description, technical name and drag material object to the right side (details of the selection).

Giving Description, Technical name and Selecting Material Object
Giving Description, Technical name and Selecting Material Object

Select Restrict option from the context menu of a material object.

Selection of Restrict Option
Selection of Restrict Option

Choose M01 from single values and drag M01 to the right-side selection screen.

Choosing M01 Value and Dragging to the Right Side
Choosing M01 Value and Dragging to the Right Side

Then click OK. Now, the key figure structure has been created with Material selection.

Key Figure Structure with Selection
Key Figure Structure with Selection

Similarly, we will add customer object to the structure with some restrictions.

Key Figure Structure with Two Objects
Key Figure Structure with Two Objects

When we use two structures in the query, a new function will be available in the Query Designer. This function is cell definition in the cell editor. Here, we can additionally define a separate logic (selection or formula) for each of the cells formed due to intersection of the two structures.

To open Cell Editor, click on the cell definition button on top of properties tabs or use menu path to view cell editor. When cell definition is enabled, an additional cells tab area is visible on the Query Designer layout as shown in below image.

Cells Tab
Cells Tab

Here we can see Cells screen. This option is activated only when there are two structures in the query.

Characteristic Structure

We can create a characteristic structure by adding characteristics into the new structure in the rows section. We can add as many characteristics to the structure as necessary. Characteristic structures determine the sequence and number of key figures and characteristics in the columns and rows of a query. The components of characteristic structures cannot contain key figure selections.

For example, if we want to always use customer and material in our queries, then we can create a characteristic structure with customer and material and use it in our queries.

To do this, we have to create a structure (customer, material) in the rows section. Go to rows, right click, and select New Structure.

Creating Characteristic Structure
Creating Characteristic Structure

Right click on the new structure and choose New Selection.

Creating New Selection
Creating New Selection

To edit and add characteristics choose the selection and click on Edit button as shown below.

Edit for Selection
Edit for Selection

Then, give a proper description and add a customer characteristic to the right-hand side.

Dragging Customer Characteristic to the Right-hand Side
Dragging Customer Characteristic to the Right-hand Side

For Material, we also need to create another selection with adding material characteristic to the selection.

Dragging Material Characteristic to the Right-hand Side
Dragging Material Characteristic to the Right-hand Side

After saving the query the Cell editor is enabled. Now, the query has two SAP BW structures. One is the key figure structure and another is the characteristic structure.

Query with Two SAP BW Structures
Query with Two SAP BW Structures

Save the query and the Cell editor will become enabled.

Cell Editor

When we have two structures created in our query, cell definitions are automatically created and Cell editor becomes active. Cell definition is useful functionality of a Query Designer which helps us define logic for each individual cell.

As explained above, based on the two structures (characteristic and key figures) SAP BW will generate the report. However, to avoid errors or wrong results due to intersection of these two structures, we can also define logic for individual cells. Using Cell editor, we can go to each of the cells and can control its behavior. Using Cell editor, we can write a new formula, selection or restriction in each individual cell.

Overall, Cell editor in BEx Query Designer enables us to:

  • Define formulas and selection conditions for a cell to override the automatically created cell values.
  • Define help cells that have no direct relationship to the structures.
Choosing Cell Editor
Choosing Cell Editor

Choose cell tab to create the logic. Here, we can control each and every individual cell on the cell tab.

Cell Editor Tab
Cell Editor Tab

Select Revenue cell and then choose Edit button.

Choosing Edit for Revenue Cell
Choosing Edit for Revenue Cell

We will be presented with all the properties to restrict or write formula to control the individual Revenue cell.

Benefits of SAP BW Structures

The benefit of using a structure is reusability of certain objects several times. We are able to reuse combination of fields at any point of time. No need to drag one by one many times. The reusability here becomes very useful. The structure will let us bring those objects every time we want to use them.

Reusable SAP BW Structures

When we save SAP BW structures as reusable structures, we can also use them in other queries for the same InfoProvider. For that we need to save this structure using Save As command from the context menu.

Saving Structure for Global Reuse
Saving Structure for Global Reuse

Then, give an appropriate description and technical name for the structure.

Giving Description and Technical Name for Global Structure
Giving Description and Technical Name for Global Structure

Next, this structure will be saved as a reusable structure under Structures folder in the InfoProvider tab.

Reusable SAP BW Structures
Reusable SAP BW Structures

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 Variables

Go to previous lesson: SAP Key Figures Properties

Go to overview of the course: SAP BW Training

3 thoughts on “SAP BW Structures”

  1. Kudos… Very well explained the structure and cell functionalities in Bex. Everything is neatly articulated.
    Well done.

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 *