I_MaintenanceOrderCostBalance
Calculates Balance per Ledger
I_MaintenanceOrderCostBalance is a Composite CDS View that provides data about "Calculates Balance per Ledger" in SAP S/4HANA. It reads from 1 data source (I_GLAccountLineItemRawData) and exposes 7 fields with key fields Ledger, MaintenanceOrder, Currency. It has 2 associations to related views.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| I_GLAccountLineItemRawData | ActualCosts | from |
Associations (2)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | I_Currency | _Currency | $projection.GlobalCurrency = _Currency.Currency or $projection.CompanyCodeCurrency = _Currency.Currency |
| [0..1] | I_MaintenanceOrder | _MaintenanceOrder | $projection.MaintenanceOrder = _MaintenanceOrder.MaintenanceOrder |
Annotations (7)
| Name | Value | Level | Field |
|---|---|---|---|
| VDM.viewType | #COMPOSITE | view | |
| AccessControl.authorizationCheck | #MANDATORY | view | |
| EndUserText.label | Calculates Balance per Ledger | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| ObjectModel.usageType.serviceQuality | #X | view | |
| ObjectModel.usageType.sizeCategory | #XL | view | |
| ObjectModel.usageType.dataClass | #MIXED | view |
Fields (7)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | Ledger | I_GLAccountLineItemRawData | SourceLedger | |
| KEY | MaintenanceOrder | I_GLAccountLineItemRawData | OrderID | |
| KEY | Currency | _Currency | Currency | |
| GlobalCurrency | I_GLAccountLineItemRawData | GlobalCurrency | ||
| CompanyCodeCurrency | I_GLAccountLineItemRawData | CompanyCodeCurrency | ||
| _MaintenanceOrder | _MaintenanceOrder | |||
| _Currency | _Currency |
@VDM.viewType: #COMPOSITE
@AccessControl.authorizationCheck: #MANDATORY
@EndUserText.label: 'Calculates Balance per Ledger'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
serviceQuality: #X,
sizeCategory: #XL,
dataClass: #MIXED
}
define view entity I_MaintenanceOrderCostBalance
as select from I_GLAccountLineItemRawData as ActualCosts
association [0..1] to I_Currency as _Currency on $projection.GlobalCurrency = _Currency.Currency
or $projection.CompanyCodeCurrency = _Currency.Currency
association [0..1] to I_MaintenanceOrder as _MaintenanceOrder on $projection.MaintenanceOrder = _MaintenanceOrder.MaintenanceOrder
{
key ActualCosts.SourceLedger as Ledger,
key ActualCosts.OrderID as MaintenanceOrder,
key _Currency.Currency as Currency,
ActualCosts.GlobalCurrency as GlobalCurrency,
ActualCosts.CompanyCodeCurrency as CompanyCodeCurrency,
@Semantics:{ amount: {currencyCode: 'Currency'} }
case _Currency.Currency
when ActualCosts.GlobalCurrency then sum(ActualCosts.AmountInGlobalCurrency)
when ActualCosts.CompanyCodeCurrency then sum(ActualCosts.AmountInCompanyCodeCurrency)
else cast(0 as fis_hsl)
end as MaintenanceOrderBalanceAmount,
_MaintenanceOrder,
_Currency
}
where
ActualCosts.OrderCategory = '30'
and ActualCosts.OrderID <> ''
and ActualCosts.IsOpenItemManaged = ''
group by
ActualCosts.GlobalCurrency,
ActualCosts.CompanyCodeCurrency,
ActualCosts.SourceLedger,
_Currency.Currency,
ActualCosts.OrderID;
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CURRENCY",
"I_GLACCOUNTLINEITEMRAWDATA"
],
"ASSOCIATED":
[
"I_CURRENCY",
"I_MAINTENANCEORDER"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA