Paul Mynarik

IT Consultant

SAP® HANA Information Model XML Definition

Every active SAP® HANA Information Model (Attribute views, Analytic views, Calculation views)  is saved in the standard table: _SYS_REPO.ACTIVE_OBJECT, in the form of XML code.

The columns of the table are the following:

NameSQL Data TypeDimensionColumn Store Data TypeKeyNot NullDefaultComment
PACKAGE_IDNVARCHAR256STRINGX(1)X
OBJECT_NAMENVARCHAR256STRINGX(2)X
OBJECT_SUFFIXNVARCHAR255STRINGX(3)X
VERSION_IDINTEGERINTX
ACTIVATED_ATTIMESTAMPLONGDATEX
ACTIVATED_BYNVARCHAR256STRINGX
EDITTINYINTINTX1
CDATANCLOB2147483647LOBXML version of the saved object
BDATABLOBLOB
COMPRESSION_TYPEINTEGERINT
FORMAT_VERSIONNVARCHAR16STRING
DELIVERY_UNITNVARCHAR256STRING
DU_VERSIONNVARCHAR256STRING
DU_VENDORNVARCHAR256STRING
DU_VERSION_SPNVARCHAR16STRING
DU_VERSION_PATCHNVARCHAR16STRING
OBJECT_STATUSTINYINTINTX0
CHANGE_NUMBERINTEGERINT0
RELEASED_ATTIMESTAMPLONGDATE

The XML presentation of the information model is saved in the column: CDATA, and the main structure of the XML code, depending on the model itself, can be the following:

<?xml version="1.0" encoding="UTF-8"?>
<Calculation:scenario xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ...>
  <origin/>
  <descriptions defaultDescription="Description"/>
  <metadata changedAt="2020-05-20 23:58:10.531"/>
  <localVariables>
    ...
  </localVariables>
  <variableMappings>
    ...
  </variableMappings>
  <informationModelLayout relativeWidthScenario="61"/>
  <dataSources>
    ...
  </dataSources>
  <calculationViews>
    ...
  </calculationViews>
  <logicalModel id="Logical_model_ID">
    ...
  </logicalModel>
  <layout>
    ...
  </layout>
</Calculation:scenario>

The XML structure is sorted the way that the input of the model is presented in the lower part of the XML where the top part of the XML contains the data sources of the model.

The logic of the XML nodes is the following:

Calculation views model

Calculation:scenario

The top node consists of the main information about the model such as the version and so on.

Logical Model

The logical model node is the main entrance XML node, where all the fields available in the information model are presented. The main types of the field are presented with its own XML nodes:

  • Simple attribute
    <attributes>
  • Calculated attribute
    <calculatedAttributes>
  • Simple measure
    <baseMeasures>
  • Calculated measure
    <calculatedMeasures>

Based on the field type the link to the next object in the model is shared. For example, in the case of an attribute, it can be its key mapping to the Calculation View node.

Calculation Views

The Calculation Views node consists of Calculation views and its fields.

Calculation View

Every Calculation View node has a similar structure as the Logical Model node and can contain simple mapping or for example field’s specific calculation. The mapping to another object is presented within the Input node.

Data Sources

The Data Sources node contains the mapping between the fields of the current model (the last object – calculation view) and another model, table, or in general another source.

Local variables

The Local Variable node consists of the input variables presented in the model.

 

Leave a Reply