@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":""
}
}*/