Query Creation Rules

Test Queries

Core/Specific Queries

Before creating a new query, check if an existing one can be used instead directly, or by doing a simple modification.

Adding a variable/characteristic or changing the default characteristics is NOT a reason to create a new query !

Should the query be "Core" ?

To know if a query is core, then you can ask 2 questions : 

  1. Can it be used for any perimeter (GBU/Zone/Country...) and give correct results?
  2. Is the main purpose of the query something that is interesting for all perimeters (WW) ?

If yes, then it's CORE ! If not, it's specific and has to be indicated as such.

Usually specific queries are created for special cases :

Query Naming conventions

Query naming rules can be found in the Naming Conventions.

Query Performance Optimization

To optimize the performances, please follow the following rules :

More in details : 

http//scn.sap.com/community/business-explorer/blog/2013/07/25/how-to-optimize-reporting-performance

Query Publication Rules

The rule to assign Queries/Workbooks into a rule are based on a very simple principle : 

The roles must look clean/organised AND only include queries that can be run directly by the users.
Basically, we want the users to feel that they can use safely and trust any query in the folders.

The rule is :


This means, these queries should NOT be published in the roles 

How to create BEx Variant based on Security Authorization

 

Query cleaning procedure (Un-used query deletion)

In order to delete un-used queries that may polute the system, it is necessary to run a cleaning process from time to time.

To do so :

Rules for deletion :

You can safely delete :

You should not delete :

+ you can check the usage of the query on the 18 months ago to be sure that the queries are not used anymore by someone.

How to compare Queries between 2 systems

  1. On both systems, run transaction SE38
  2. Launch program "RSRQ_QUERYDEFINITION"
  3. Run the program for the Query you want to analyse.

  1. Click on the "Download" button. Then OK.
  2. Go to "System" -> List -> Save --> Local File

  1. Export to the "Clipboard"
  2. Open a txt file and paste the content.
  3. Use a code comparison tool to compare both files. Exemple : http//www.tareeinternet.com/scripts/comparison-tool/

How to find queries using an info object

You can use the following function modules in order to display the queries using an info object.

Function modules

RSZ_I_BASIC_CHA_WHERE_USED

RSZ_I_BASIC_KEYFIG_WHERE_USED

It’s much more efficient than using the metadata repository.
Example for info object 0GL_ACCOUNT__C_GL_TYPE. With metadata repository I list around 40 queries with this object.
The reality is much more different because with the function module I obtain 96 queries!

There are also some tables to list the info provider using the nav attributes

RSDODSOATRNAV – For DSO

RSDCUBEIOBJ – For Cubes and MPR

In this page, there is a list of very useful tables

http//wiki.scn.sap.com/wiki/display/BI/Important+Tables+in+SAP+BW+7.x

Managing query descriptions in the roles

+When you change a query description in the query designer, it does NOT update it in the roles.

+When you add a query to a role, the description for all languages is the one in the current language.

Example in the PP role:

2 ways to solve this problem:

Step by step :

  1. - Go to transaction PFCG

2 - Enter the menu role :

3 - Go to Menu and select the query

4 - Click on “Translate Node”

5 - Change the text in English and any other relevant language.