I_StatKeyFigCostAllocCyc

DDL: I_STATKEYFIGCOSTALLOCCYC SQL: IWUSKFCAC Type: view BASIC

Cost Allocation Cycles

I_StatKeyFigCostAllocCyc is a Basic CDS View that provides data about "Cost Allocation Cycles" in SAP S/4HANA. It reads from 1 data source (I_StatisticalKeyFigure) and exposes 21 fields with key fields StatisticalKeyFigure, AllocationCycle, ControllingArea. It has 5 associations to related views.

Data Sources (1)

SourceAliasJoin Type
I_StatisticalKeyFigure I_StatisticalKeyFigure inner

Associations (5)

CardinalityTargetAliasCondition
[1..1] I_StatisticalKeyFigure _StatisticalKeyFigure $projection.StatisticalKeyFigure = _StatisticalKeyFigure.StatisticalKeyFigure and $projection.ControllingArea = _StatisticalKeyFigure.ControllingArea
[0..1] I_AllocationKeyField _PlanningCategory _PlanningCategory.AllocationType = $projection.allocationtype and _PlanningCategory.AllocationCycle = $projection.allocationcycle and _PlanningCategory.AllocationCycleStartDate = $projection.allocationcyclestartdate and _PlanningCategory.AllocationCycleSegment = '0000' and _PlanningCategory.AllocationSetType = '0' and _PlanningCategory.AllocationFieldName = 'CATEGORY'
[0..1] I_StatKeyFigWhereUsedAllocType _AllocationPostingType _AllocationPostingType.AllocationPostingType = $projection.allocationpostingtype and _AllocationPostingType.AllocationPostingTypeContext = $projection.AllocationPostingTypeContext
[0..1] I_AllocationContextTypeText _AllocationContextTypeText _AllocationContextTypeText.AllocationType = $projection.allocationtype and _AllocationContextTypeText.Language = $session.system_language
[0..1] I_AllocationStateText _AllocationStatusText _AllocationStatusText.AllocationStatus = $projection.allocationstatus

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName IWUSKFCAC view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #CHECK view
EndUserText.label Cost Allocation Cycles view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
VDM.viewType #BASIC view
ClientHandling.algorithm #SESSION_VARIABLE view

Fields (21)

KeyFieldSource TableSource FieldDescription
KEY StatisticalKeyFigure
KEY AllocationCycle _Cycle AllocationCycle
KEY ControllingArea ControllingArea
AllocationCycleNameText
AllocationCycleStartDate _Cycle AllocationCycleStartDate
AllocationCycleEndDate _Cycle AllocationCycleEndDate
LastChangeDate _Cycle LastChangeDate
LastChangedByUser _Cycle LastChangedByUser
AllocationLastExecutedDate _Cycle AllocationLastExecutedDate
AllocationLastExecutedByUser _Cycle AllocationLastExecutedByUser
AllocationType _Cycle AllocationType
AllocationStatus _Cycle AllocationStatus
AllocationActualPlanVariant _Cycle AllocationActualPlanVariant
AllocActualPlanVariantText
AllocationPostingType _Cycle AllocationPostingType
_StatisticalKeyFigure _StatisticalKeyFigure
_PlanningCategory _PlanningCategory
_AllocationPostingType _AllocationPostingType
_AllocationContextTypeText _AllocationContextTypeText
_AllocationStatusText _AllocationStatusText
LedgerelseendasLedger
@AbapCatalog.sqlViewName: 'IWUSKFCAC'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Cost Allocation Cycles'

@ObjectModel.usageType: {
  sizeCategory: #L,
  serviceQuality: #C,
  dataClass: #TRANSACTIONAL
}
@VDM.viewType: #BASIC
@ClientHandling.algorithm: #SESSION_VARIABLE

define view I_StatKeyFigCostAllocCyc as select distinct from I_AllocationKeyField
    inner join I_StatisticalKeyFigure
    on I_AllocationKeyField.AllocationFieldMinimumValue = I_StatisticalKeyFigure.StatisticalKeyFigure
    association [1..1] to I_StatisticalKeyFigure as _StatisticalKeyFigure 
      on $projection.StatisticalKeyFigure = _StatisticalKeyFigure.StatisticalKeyFigure
      and $projection.ControllingArea = _StatisticalKeyFigure.ControllingArea
    association [0..1] to I_AllocationKeyField as _PlanningCategory on _PlanningCategory.AllocationType = $projection.allocationtype
                                                                   and _PlanningCategory.AllocationCycle = $projection.allocationcycle
                                                                   and _PlanningCategory.AllocationCycleStartDate = $projection.allocationcyclestartdate
                                                                   and _PlanningCategory.AllocationCycleSegment = '0000'
                                                                   and _PlanningCategory.AllocationSetType = '0'
                                                                   and _PlanningCategory.AllocationFieldName = 'CATEGORY'
    association [0..1] to I_StatKeyFigWhereUsedAllocType as _AllocationPostingType on _AllocationPostingType.AllocationPostingType = $projection.allocationpostingtype
                                                                                  and _AllocationPostingType.AllocationPostingTypeContext = $projection.AllocationPostingTypeContext
    association [0..1] to I_AllocationContextTypeText as _AllocationContextTypeText on _AllocationContextTypeText.AllocationType = $projection.allocationtype
                                                                                   and _AllocationContextTypeText.Language = $session.system_language
    association [0..1] to I_AllocationStateText as _AllocationStatusText on _AllocationStatusText.AllocationStatus = $projection.allocationstatus
{    
    key cast (AllocationFieldMinimumValue as fis_stagr) as StatisticalKeyFigure,
    key _Cycle.AllocationCycle,
    key ControllingArea,
    _Cycle._Text[1: LanguageCode = $session.system_language ].AllocationCycleNameText,
    _Cycle.AllocationCycleStartDate,
    _Cycle.AllocationCycleEndDate,
    _Cycle.LastChangeDate,
    _Cycle.LastChangedByUser,
    _Cycle.AllocationLastExecutedDate,
    _Cycle.AllocationLastExecutedByUser, 
    _Cycle.AllocationType, //actually it is AllocationContext

    _Cycle.AllocationStatus,
    _Cycle.AllocationActualPlanVariant,
    _Cycle._ActualPlanText[1: Language = $session.system_language ].AllocActualPlanVariantText,
    _Cycle.AllocationPostingType,
    _StatisticalKeyFigure,
    _PlanningCategory,
    _AllocationPostingType,
    _AllocationContextTypeText,
    _AllocationStatusText,
        
    case left(_Cycle.AllocationType, 5)
    when 'ACDOC'
        then case _Cycle.AllocationPostingType
            when 'U'
                then 'N'
                else 'O'
            end
        else 'O'
    end as AllocationPostingTypeContext,
    
    case left(_Cycle.AllocationType, 5)
    when 'ACDOC'
        then cast(substring(AllocationCycle, 3, 8) as cycle)
        else cast(substring(AllocationCycle, 5, 6) as cycle)
    end as AllocationCycleName,
    
    case left(_Cycle.AllocationType, 5)
    when 'ACDOC'
        then _Cycle.Ledger
        else ''
    end as Ledger
} 
where AllocationFieldName = 'STAGR'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_ALLOCACTUALPLANVARIANTTEXT",
"I_ALLOCASSMTDISTRLONGTEXT",
"I_ALLOCATIONCYCLE",
"I_ALLOCATIONKEYFIELD",
"I_STATISTICALKEYFIGURE"
],
"ASSOCIATED":
[
"I_ALLOCATIONCONTEXTTYPETEXT",
"I_ALLOCATIONKEYFIELD",
"I_ALLOCATIONSTATETEXT",
"I_STATISTICALKEYFIGURE",
"I_STATKEYFIGWHEREUSEDALLOCTYPE"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/