C_TrsyValueAtRiskQuery

DDL: C_TRSYVALUEATRISKQUERY Type: view CONSUMPTION

Treasury Value At Risk Query

C_TrsyValueAtRiskQuery (Consumption)

Package: Explore, extend and adapt the SAP S/4HANA Cloud Private Edition with built-in and side-by-side extension capabilities.

Financial Operations

C_TrsyValueAtRiskQuery is a Consumption CDS View that provides data about "Treasury Value At Risk Query" in SAP S/4HANA. It reads from 1 data source (I_TrsyValueAtRiskCube) and exposes 22 fields with key fields ValidityDate, TreasuryFinancialObject, MarketRiskKeyFigureSet.

SAP Help Documentation

CategoryRisk Management
Data CategoryQuery
StatusReleases
Corresponding DataSource2CCTRVARQ
Purpose
This CDS query view calculates the market risk key figures for value at risk and mean excess loss based on the parameters of the market risk key figure sets. This CDS view provides the prerequisites for answering the following business questions: What is the overall value at risk for all company codes? What is the value at risk for a specific company code of lower aggregation levels? For market risk key figure sets with VaR calculation using simulation methods: What is the mean excess loss? Note The query calls the Treasury Value at Risk Cube ( I_TrsyValueAtRiskCube ), which delegates the calculation of the value-at-risk key figures to an analytical exit class. The value at risk is a non-additive key figure. Therefore, the value at risk on aggregated level differs from the aggregation of the single transaction value at risks. The value at risk is calculated on the dimensions selected by the query user. For market risk key figure sets with VaR calculation using simulation methods, the mean excess loss is also calculated. The VaR is only calculated taking into account all the risk factors defined in the risk factor set. VaR at individual risk factor level is not supported. The query enables the concurrent reporting of several market risk key figure sets to enable you to compare calculations of value at risk based on different calculation methods. As different key figure sets can have different evaluation currencies, the query converts the data into the display currency. For performance reasons, this happens after VaR calculation. The query also calculates the unconverted amounts. Note If you build your own evaluations using this query and you know that all market risk key figure sets use the same currency, you can optimize performance by accessing the fields in evaluation currency.

Prerequisites
Authorization object for Market Risk Key Figures ( T_MRM_KF ) Company Code Portfolio Users who want to run reports using this CDS query view must have executed the Calculate Market Risk Key Figures report at the specific key date. The report calculates the profits and losses/delta positions and saves the values in the database table. The VaR calculations of the query are based on these profits and losses/delta positions.

Integration
Process Overview This image is interactive. Hover over each area for a description. Click highlighted areas for more information.

Structure
Main CDS parameters and filters The main CDS parameters are: Confidence level used for value-at-risk calculation. Validity date Display currency Exchange rate type The main filters are: Market risk key figure set Company code Product category Product type Measures and attributes Some important measures and attributes are: Validity date Treasury financial object Market risk key figure set Company code Treasury contract type Product category Product type Portfolio Financial transaction Exposure Position Loan ID Security class Securities account Futures account Business partner Market risk characteristic currency Country Financial instrument characteristic (not relevant) Value at risk in evaluation currency Mean excess loss in evalaution currency Evaluation currency

Example of the Consumption of this Query View
This query view is consumed in the Treasury Executive Dashboard story, which is predefined as example content in the SAP Analytics Cloud application.

View on SAP Help Portal →

SAP API Hub

StateC1
Line of BusinessFinancial Operations
Application ComponentFIN-FSCM-TRM-MR
CapabilitiesAnalytical Query
PackageFinancial Operations for SAP S/4HANA Cloud Private Edition
Description <p>This CDS query view calculates the market risk key figures for value at risk and mean excess loss based on the parameters of the market risk key figure sets.</p> <p>This CDS view provides the prerequisites for answering the following business questions:</p> <ul> <li><p>What is the overall value at risk for all company codes?</p></li> <li><p>What is the value at risk for a specific company code of lower aggregation levels?</p></li> <li><p>For market risk key figure sets with VaR calculation using simulation methods: What is the mean excess loss?</p></li> </ul>

Documentation

Data Sources (1)

SourceAliasJoin Type
I_TrsyValueAtRiskCube I_TrsyValueAtRiskCube from

Parameters (4)

NameTypeDefault
P_ConfidenceLevelInPercent ftr_mra_confidence_level
P_ValidityDate vdm_v_key_date
P_DisplayCurrency vdm_v_display_currency
P_ExchangeRateType kurst

Annotations (17)

NameValueLevelField
AbapCatalog.sqlViewName CTRVARQ view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #PRIVILEGED_ONLY view
AccessControl.personalData.blocking #NOT_REQUIRED view
Analytics.query true view
Analytics.internalName #LOCAL view
ClientHandling.algorithm #SESSION_VARIABLE view
Metadata.allowExtensions false view
Metadata.ignorePropagatedAnnotations true view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.modelingPattern #ANALYTICAL_QUERY view
OData.publish true view
VDM.viewType #CONSUMPTION view
EndUserText.label Treasury Value At Risk Query view

Fields (22)

KeyFieldSource TableSource FieldDescription
KEY ValidityDate ValidityDate Key Date in Results Databases
KEY TreasuryFinancialObject TreasuryFinancialObject Object Number for Financial Transactions
KEY MarketRiskKeyFigureSet MarketRiskKeyFigureSet Market Risk Key Figure Set
CompanyCode CompanyCode Receiver Company Code
TreasuryContractType TreasuryContractType Treasury Contract Type
FinancialInstrProductCategory FinancialInstrProductCategory Product Category
FinancialInstrumentProductType FinancialInstrumentProductType Product Type
Portfolio Portfolio Portfolio
FinancialTransaction FinancialTransaction Financial Transaction
SecurityClass SecurityClass Security Class ID Number
SecurityAccount SecurityAccount Securities Account
TreasuryPositionAccount TreasuryPositionAccount Futures Account for Listed Options and Futures
FinancialExposurePosition FinancialExposurePosition Exposure Position ID
LoanContract LoanContract Contract Number
BusinessPartner BusinessPartner Business Partner Number
MktRiskCharacteristicCurrency MktRiskCharacteristicCurrency Analytic Characteristic Currency
Country Country Country/Region Key
FinancialInstrCharacteristic FinancialInstrCharacteristic Characteristics
DisplayCurrency Display Currency
ValueAtRiskInEvaluationCrcy Value at Risk in Evaluation Currency
MeanExcessLossAmtInEvalCrcy Mean Excess Loss in Evaluation Currency
EvaluationCurrency EvaluationCurrency Evaluation Currency

Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.

-- Derived SQL interpretation of CDS view C_TrsyValueAtRiskQuery.
-- Reconstructed from parsed metadata (data sources, associations, fields).
-- SAP annotations are omitted and the structure is reformulated as SQL;
-- this is a functional approximation, not the verbatim SAP source. Some join
-- conditions may be unavailable and a few CDS constructs are kept as-is.
-- Parameters: P_ConfidenceLevelInPercent : ftr_mra_confidence_level, P_ValidityDate : vdm_v_key_date, P_DisplayCurrency : vdm_v_display_currency, P_ExchangeRateType : kurst

CREATE VIEW C_TrsyValueAtRiskQuery AS
SELECT
  ValidityDate,
  TreasuryFinancialObject,
  MarketRiskKeyFigureSet,
  CompanyCode,
  TreasuryContractType,
  FinancialInstrProductCategory,
  FinancialInstrumentProductType,
  Portfolio,
  FinancialTransaction,
  SecurityClass,
  SecurityAccount,
  TreasuryPositionAccount,
  FinancialExposurePosition,
  LoanContract,
  BusinessPartner,
  MktRiskCharacteristicCurrency,
  Country,
  FinancialInstrCharacteristic,
  cast( $parameters.P_DisplayCurrency as vdm_v_display_currency preserving type ) AS DisplayCurrency,
  cast( ValueAtRiskInEvaluationCrcy as ftr_mra_var_in_evalcrcy preserving type ) AS ValueAtRiskInEvaluationCrcy,
  cast( MeanExcessLossAmtInEvalCrcy as ftr_mra_mel_in_evalcrcy preserving type ) AS MeanExcessLossAmtInEvalCrcy,
  EvaluationCurrency
FROM I_TrsyValueAtRiskCube
;