P_WhereUsdIntOrdAlloc

DDL: P_WHEREUSDINTORDALLOC Type: view_entity COMPOSITE

P_WhereUsdIntOrdAlloc is a Composite CDS View in SAP S/4HANA. It reads from 5 data sources (I_AllocationKeyField, I_AllocationKeyField, I_AllocationKeyField, I_InternalOrder, I_InternalOrder) and exposes 60 fields with key fields InternalOrder, AllocationType, AllocationCycle, AllocationCycleStartDate, AllocationCycleSegment. It has 1 association to related views.

Data Sources (5)

SourceAliasJoin Type
I_AllocationKeyField _AllocationKeyField inner
I_AllocationKeyField _AllocationKeyField inner
I_AllocationKeyField I_AllocationKeyField union_all
I_InternalOrder I_InternalOrder from
I_InternalOrder I_InternalOrder union_all

Associations (1)

CardinalityTargetAliasCondition
[0..1] P_WhereUsdIntOrdAllocPlnCat _AllocationPlanCategory $projection.AllocationType = _AllocationPlanCategory.AllocationType and $projection.AllocationCycle = _AllocationPlanCategory.AllocationCycle and $projection.AllocationCycleStartDate = _AllocationPlanCategory.AllocationCycleStartDate

Annotations (7)

NameValueLevelField
AccessControl.authorizationCheck #CHECK view
Metadata.ignorePropagatedAnnotations true view
ObjectModel.usageType.serviceQuality #X view
ObjectModel.usageType.sizeCategory #S view
ObjectModel.usageType.dataClass #MIXED view
VDM.private true view
VDM.viewType #COMPOSITE view

Fields (60)

KeyFieldSource TableSource FieldDescription
KEY InternalOrder I_InternalOrder InternalOrder
KEY AllocationType I_AllocationKeyField AllocationType
KEY AllocationCycle I_AllocationKeyField AllocationCycle
KEY AllocationCycleStartDate I_AllocationKeyField AllocationCycleStartDate
KEY AllocationCycleSegment I_AllocationKeyField AllocationCycleSegment
KEY AllocationSetType I_AllocationKeyField AllocationSetType
KEY AllocDocumentSequenceNumber I_AllocationKeyField AllocDocumentSequenceNumber
AllocationFieldMinimumValue I_AllocationKeyField AllocationFieldMinimumValue
AllocationFieldMaximumValue I_AllocationKeyField AllocationFieldMaximumValue
AllocationSetId I_AllocationKeyField AllocationSetId
IntervalIsDefinedByHierarchy
InternalOrderDescription I_InternalOrder InternalOrderDescription
ControllingArea I_InternalOrder ControllingArea
ControllingAreaName
CompanyCode I_InternalOrder CompanyCode
CompanyCodeName
OrderType I_InternalOrder OrderType
OrderTypeName
_Cycle I_AllocationKeyField _Cycle
_Segment I_AllocationKeyField _Segment
InternalOrder
KEY AllocationType I_AllocationKeyField AllocationType
KEY AllocationCycle I_AllocationKeyField AllocationCycle
KEY AllocationCycleStartDate I_AllocationKeyField AllocationCycleStartDate
KEY AllocationCycleSegment I_AllocationKeyField AllocationCycleSegment
KEY AllocationSetType I_AllocationKeyField AllocationSetType
KEY AllocDocumentSequenceNumber I_AllocationKeyField AllocDocumentSequenceNumber
AllocationFieldMinimumValue I_AllocationKeyField AllocationFieldMinimumValue
AllocationFieldMaximumValue I_AllocationKeyField AllocationFieldMaximumValue
AllocationSetId I_AllocationKeyField AllocationSetId
IntervalIsDefinedByHierarchy
InternalOrderDescription I_InternalOrder InternalOrderDescription
ControllingArea I_InternalOrder ControllingArea
ControllingAreaName
CompanyCode I_InternalOrder CompanyCode
CompanyCodeName
OrderType I_InternalOrder OrderType
OrderTypeName
_Cycle I_AllocationKeyField _Cycle
_Segment I_AllocationKeyField _Segment
KEY AllocationType AllocationType
KEY AllocationCycle AllocationCycle
KEY AllocationCycleStartDate AllocationCycleStartDate
KEY AllocationCycleSegment AllocationCycleSegment
KEY AllocationSetType AllocationSetType
KEY AllocDocumentSequenceNumber AllocDocumentSequenceNumber
AllocationFieldMinimumValue AllocationFieldMinimumValue
AllocationFieldMaximumValue AllocationFieldMaximumValue
AllocationSetId AllocationSetId
IntervalIsDefinedByHierarchy
InternalOrderDescription
ControllingArea
ControllingAreaName
CompanyCode
CompanyCodeName
OrderType
OrderTypeName
_Cycle _Cycle
_Segment _Segment
_AllocationPlanCategory _AllocationPlanCategory
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #CHECK
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
  serviceQuality: #X,
  sizeCategory: #S,
  dataClass: #MIXED
}
@VDM: {
  private: true,
  viewType: #COMPOSITE
}
define view entity P_WhereUsdIntOrdAlloc
  as select from I_InternalOrder
    inner join I_AllocationKeyField as _AllocationKeyField
      on I_InternalOrder.InternalOrder = _AllocationKeyField.AllocationFieldMinimumValue
        and _AllocationKeyField.AllocationFieldMinimumValue is not initial
        and _AllocationKeyField.AllocationFieldMaximumValue is initial
    association [0..1] to P_WhereUsdIntOrdAllocPlnCat as _AllocationPlanCategory
      on $projection.AllocationType = _AllocationPlanCategory.AllocationType
        and $projection.AllocationCycle = _AllocationPlanCategory.AllocationCycle
        and $projection.AllocationCycleStartDate = _AllocationPlanCategory.AllocationCycleStartDate
{
  key I_InternalOrder.InternalOrder,
  key _AllocationKeyField.AllocationType,
  key _AllocationKeyField.AllocationCycle,
  key _AllocationKeyField.AllocationCycleStartDate,
  key _AllocationKeyField.AllocationCycleSegment,
  key _AllocationKeyField.AllocationSetType,
  key _AllocationKeyField.AllocDocumentSequenceNumber,

  _AllocationKeyField.AllocationFieldMinimumValue,
  _AllocationKeyField.AllocationFieldMaximumValue,
  _AllocationKeyField.AllocationSetId,
  cast( '' as abap_boolean ) as IntervalIsDefinedByHierarchy,
  I_InternalOrder.InternalOrderDescription,
  I_InternalOrder.ControllingArea,
  I_InternalOrder._ControllingArea.ControllingAreaName,
  I_InternalOrder.CompanyCode,
  I_InternalOrder._CompanyCode.CompanyCodeName,
  I_InternalOrder.OrderType,
  I_InternalOrder._InternalOrderTypeText[ Language = $session.system_language ].OrderTypeName,

  _AllocationKeyField._Cycle,
  _AllocationKeyField._Segment,
  _AllocationPlanCategory
}
where _AllocationKeyField.AllocationFieldName = 'AUFNR'

union all select from I_InternalOrder
  inner join I_AllocationKeyField as _AllocationKeyField
    on I_InternalOrder.InternalOrder >= _AllocationKeyField.AllocationFieldMinimumValue
      and I_InternalOrder.InternalOrder <= _AllocationKeyField.AllocationFieldMaximumValue
      and _AllocationKeyField.AllocationFieldMaximumValue is not initial
  association [0..1] to P_WhereUsdIntOrdAllocPlnCat as _AllocationPlanCategory
    on $projection.AllocationType = _AllocationPlanCategory.AllocationType
      and $projection.AllocationCycle = _AllocationPlanCategory.AllocationCycle
      and $projection.AllocationCycleStartDate = _AllocationPlanCategory.AllocationCycleStartDate
{
  key I_InternalOrder.InternalOrder,
  key _AllocationKeyField.AllocationType,
  key _AllocationKeyField.AllocationCycle,
  key _AllocationKeyField.AllocationCycleStartDate,
  key _AllocationKeyField.AllocationCycleSegment,
  key _AllocationKeyField.AllocationSetType,
  key _AllocationKeyField.AllocDocumentSequenceNumber,

  _AllocationKeyField.AllocationFieldMinimumValue,
  _AllocationKeyField.AllocationFieldMaximumValue,
  _AllocationKeyField.AllocationSetId,
  cast( '' as abap_boolean ) as IntervalIsDefinedByHierarchy,
  I_InternalOrder.InternalOrderDescription,
  I_InternalOrder.ControllingArea,
  I_InternalOrder._ControllingArea.ControllingAreaName,
  I_InternalOrder.CompanyCode,
  I_InternalOrder._CompanyCode.CompanyCodeName,
  I_InternalOrder.OrderType,
  I_InternalOrder._InternalOrderTypeText[ Language = $session.system_language ].OrderTypeName,

  _AllocationKeyField._Cycle,
  _AllocationKeyField._Segment,
  _AllocationPlanCategory
}
where _AllocationKeyField.AllocationFieldName = 'AUFNR'

union all select from I_AllocationKeyField
  association [0..1] to P_WhereUsdIntOrdAllocPlnCat as _AllocationPlanCategory
    on $projection.AllocationType = _AllocationPlanCategory.AllocationType
      and $projection.AllocationCycle = _AllocationPlanCategory.AllocationCycle
      and $projection.AllocationCycleStartDate = _AllocationPlanCategory.AllocationCycleStartDate
{
  key cast( '000000000000' as fins_int_aufnr ) as InternalOrder,
  key AllocationType,
  key AllocationCycle,
  key AllocationCycleStartDate,
  key AllocationCycleSegment,
  key AllocationSetType,
  key AllocDocumentSequenceNumber,

  AllocationFieldMinimumValue,
  AllocationFieldMaximumValue,
  AllocationSetId,
  cast( 'X' as abap_boolean ) as IntervalIsDefinedByHierarchy,
  cast( '' as fis_internalorder_text ) as InternalOrderDescription,
  cast( left( AllocationCycle, 4 ) as fis_kokrs ) as ControllingArea,
  cast( '' as fis_kokrs_name ) as ControllingAreaName,
  cast( '' as fis_bukrs ) as CompanyCode,
  cast( '' as butxt ) as CompanyCodeName,
  cast( '' as aufart ) as OrderType,
  cast( '' as auarttext ) as OrderTypeName,

  _Cycle,
  _Segment,
  _AllocationPlanCategory 
}
where AllocationFieldName = 'AUFNR'
  and AllocationSetId is not initial
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_ALLOCATIONKEYFIELD",
"I_COMPANYCODE",
"I_CONTROLLINGAREA",
"I_INTERNALORDER",
"I_INTERNALORDERTYPETEXT"
],
"ASSOCIATED":
[
"I_ALLOCATIONCYCLE",
"I_ALLOCATIONSEGMENT",
"P_WHEREUSDINTORDALLOCPLNCAT"
],
"BASE":
[
"I_ALLOCATIONKEYFIELD"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/