Child pages
  • Constants used in HCPR Definition
Skip to end of metadata
Go to start of metadata

Introduction

Basically there are two ways of defining constants in a Hana CompositeProvider(see HCPR). The effect of these different types of constants on query results are very different. Let's discuss this with the help of simple examples:

(I) Constant Value assigned to Output Field

This selection(filter) is automatically applied to all InfoProviders. Therefore, only the relevant part of the data from all Partproviders(where there is a corresponding mapping) is passed to the HCPR. See Example I.

(II) Source Specific Constant assigned to Target Field

This means that the target field is always filled with the provider specific constant when running a query on the HCPR. This does not imply any filters/restrictions on Partproviders. See Example II.

Example I

The sample HCPR has three partproviders, one is also a HCPR. The relevant characteristic is Plant(ZATSTPEI3) which is mapped with all partproviders.

On the tab Output the constant value P01 is assigned to the characteristic Plant. 

We now run a simple adhoc query in RSRT(see Transaction RSRT) and check the Hana statements:

So, even there are no query filters at all for this adhoc query, we can see a restriction(WHERE clause) which was added automatically by the Analytic Engine. The SID 2 of ZATSTPEI3 corresponds to the value P01. Hence, only the relevant part of the data from all Partproviders(where there is a corresponding mapping) is passed to the HCPR. Hence, when you check the HCPR, the following warning appears(BRAIN 463):

In case you need a quick way to search for such a constant in the definition of a complex HCPR, you could proceed as follows: run transaction RSOHCPR and open the XML. There you can search for the string "restriction element":

Note that this InfoObject Plant(ZATSTPEI3) isn't available at all in the Query Designer:

In case this HCPR is used in another one(stacked HCPR), it is possible to define a corresponding assignement and use it again in a query. E.g. see

This HCPR is based on a HCPR which uses again a the constant value P01 for the characteristic Plant. In contrast to the QueryDesigner it is possible to use this InfoObject when defining a HCPR. The adhoc queries show then the same key figure values but only the one based on STPE_HCPR_3C can also use the characteristc Plant for navigation:

Example II

We now create a HCPR and use the feature 'Assign Constant...' for certain partproviders:

This means that the target field ZATSTPEI3 is always filled with the provider specific constants(P03 for STPE_DBIF and P01 for all partproviders of HCPR ZATSTPEHCPR3) when running a query on this HCPR. This does not imply any filters/restrictions on these Partproviders. The sub-HCPR ZATSTPEHCPR3 contains the following two InfoCubes: STPE_AT1 and STPE_AT2. We now run a simple adhoc query in RSRT(see Transaction RSRT) and check the result:

As expected, P03 is displayed for STPE_DBIF and P01 for STPE_AT1 and STPE_AT2. However, when we e.g. check the content of the cube STPE_DBIF we notice that there are many more plants but the key figure overall result is the same:

So, this means that, so to speak, all plants of this partprovider are renamed' to P03 when a query is run on the HCPR.

In case you need a quick way to search for such a constant in the definition of a complex HCPR, you could proceed as follows: run transaction RSOHCPR and open the XML. There you can search for the string "ConstantElementMapping":

  • No labels