I_VarianceReason

DDL: I_VARIANCEREASON SQL: IVARCREASON Type: view BASIC

Variance Reason Code

I_VarianceReason (Basic)

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

Manufacturing

I_VarianceReason is a Basic CDS View (Dimension) that provides data about "Variance Reason Code" in SAP S/4HANA. It reads from 1 data source (trug) and exposes 4 fields with key fields Plant, VarianceReasonCode. It has 2 associations to related views.

SAP Help Documentation

CategoryCDS Views for Discrete and Process Manufacturing
Data CategoryDimension
Purpose
This CDS view provides the prerequisites for answering the following business questions: Which variance reason codes are maintained in a plant?

Prerequisites
Authorizations Users who want to use this CDS view don't need any special authorization.

Structure
Main input parameters This view does not have any input parameters. Measures and attributes The following attribute is provided: Plant Variance reason code

View on SAP Help Portal →

SAP API Hub

StateC1
Line of BusinessManufacturing
Application ComponentPP-VDM
CapabilitiesAnalytical Dimension, Association Target for Defining CDS Entities, Data Source in SQL Select, Data Source for Defining CDS Entities, Data Source for Search, Data Provider for Value Help
PackageManufacturing for SAP S/4HANA Cloud Private Edition
Description <p>This CDS view provides the prerequisites for answering the following business questions:</p> <ul> <li><p>Which variance reason codes are maintained in a plant?</p></li> </ul>

Documentation

Data Sources (1)

SourceAliasJoin Type
trug trug from

Associations (2)

CardinalityTargetAliasCondition
[1..1] I_Plant _Plant $projection.Plant = _Plant.Plant
[0..*] I_VarianceReasonText _Text $projection.Plant = _Text.Plant and $projection.VarianceReasonCode = _Text.VarianceReasonCode

Annotations (23)

NameValueLevelField
AbapCatalog.sqlViewName IVARCREASON view
AbapCatalog.buffering.status #ACTIVE view
AbapCatalog.buffering.type #GENERIC view
AbapCatalog.buffering.numberOfKeyFields 001 view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
Analytics.dataCategory #DIMENSION view
Analytics.internalName #LOCAL view
ClientHandling.algorithm #SESSION_VARIABLE view
Consumption.ranked true view
Metadata.allowExtensions true view
Metadata.ignorePropagatedAnnotations true view
ObjectModel.compositionRoot true view
ObjectModel.dataCategory #VALUE_HELP view
ObjectModel.modelingPattern #ANALYTICAL_DIMENSION view
ObjectModel.representativeKey VarianceReasonCode view
ObjectModel.usageType.serviceQuality #A view
ObjectModel.usageType.sizeCategory #S view
ObjectModel.usageType.dataClass #CUSTOMIZING view
Search.searchable true view
VDM.lifecycle.contract.type #PUBLIC_LOCAL_API view
VDM.viewType #BASIC view
EndUserText.label Variance Reason Code view

Fields (4)

KeyFieldSource TableSource FieldDescription
KEY Plant trug werks Receiving Plant
KEY VarianceReasonCode Reason for Variance
_Plant _Plant
_Text _Text

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 I_VarianceReason.
-- 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.
-- SQL view name: IVARCREASON

CREATE VIEW I_VarianceReason AS
SELECT
  trug.werks AS Plant,
  cast(trug.grund as pph_agrnd preserving type) AS VarianceReasonCode
FROM trug
LEFT OUTER JOIN I_Plant AS _Plant ON Plant = _Plant.Plant  -- association [1..1]
LEFT OUTER JOIN I_VarianceReasonText AS _Text ON Plant = _Text.Plant AND VarianceReasonCode = _Text.VarianceReasonCode  -- association [0..*]
;