I_MaintenanceOrderCostBalance

DDL: I_MAINTENANCEORDERCOSTBALANCE Type: view_entity COMPOSITE

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)

SourceAliasJoin Type
I_GLAccountLineItemRawData ActualCosts from

Associations (2)

CardinalityTargetAliasCondition
[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)

NameValueLevelField
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)

KeyFieldSource TableSource FieldDescription
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":""
}
}*/