@AbapCatalog.sqlViewName : 'PDDLASTLT'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.private: true
@VDM.viewType: #CONSUMPTION
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType.serviceQuality: #C
define view P_LastFallBackLeadTime
as select from I_ProductPlantMRPArea as _ProductPlantMRPArea
left outer join I_MatlProcurementProfile as _prfl on _ProductPlantMRPArea.Plant = _prfl.Plant
and _ProductPlantMRPArea.MaterialProcurementProfile = _prfl.MaterialProcurementProfile
left outer join I_MRPPlantControlParameter as _MRPControlParams
on _ProductPlantMRPArea.Plant = _MRPControlParams.MRPPlant
{
key _ProductPlantMRPArea.Material as Material,
key _ProductPlantMRPArea.Plant as ProductionPlant,
key _ProductPlantMRPArea.MRPArea as MRPArea,
_ProductPlantMRPArea.MRPType,
_ProductPlantMRPArea.MRPController,
case
when _ProductPlantMRPArea.ProcurementType = 'F'
then
case
when _prfl.MaterialProcurementExtType = '7'
then 'T'
else
'B'
end
else
'M'
end as ReplenishmentType,
cast (
case
when _ProductPlantMRPArea.Plant != _ProductPlantMRPArea.MRPArea
or (_ProductPlantMRPArea.Plant = _ProductPlantMRPArea.MRPArea and _ProductPlantMRPArea.ProcurementType = 'F')
then
case
when _ProductPlantMRPArea.GoodsReceiptDuration > 0
then _ProductPlantMRPArea.PlannedDeliveryDurationInDays + _ProductPlantMRPArea.GoodsReceiptDuration + cast (_MRPControlParams.PurchasingProcessingDuration as abap.int1 )
else
_ProductPlantMRPArea.PlannedDeliveryDurationInDays + cast (_MRPControlParams.PurchasingProcessingDuration as abap.int1 )
end
else
case
when _ProductPlantMRPArea.GoodsReceiptDuration > 0
then _ProductPlantMRPArea.MaterialPlannedProductionDurn + _ProductPlantMRPArea.GoodsReceiptDuration
else
_ProductPlantMRPArea.MaterialPlannedProductionDurn
end
// case
// when _ProductPlantMRPArea.ProcurementType = 'F'
// then
// case
// when _ProductPlantMRPArea.GoodsReceiptDuration > 0
// then _ProductPlantMRPArea.PlannedDeliveryDurationInDays + _ProductPlantMRPArea.GoodsReceiptDuration
// else
// _ProductPlantMRPArea.PlannedDeliveryDurationInDays
// end
// else
// case
// when _ProductPlantMRPArea.GoodsReceiptDuration > 0
// then _ProductPlantMRPArea.MaterialPlannedProductionDurn + _ProductPlantMRPArea.GoodsReceiptDuration
// else
// _ProductPlantMRPArea.MaterialPlannedProductionDurn
// end
end
as pph_ind_lead_time) as IndividualLeadTime
}
/*+[internal] {
"BASEINFO":
{
"FROM ":
[
"I_MATLPROCUREMENTPROFILE",
"I_MRPPLANTCONTROLPARAMETER",
"I_PRODUCTPLANTMRPAREA"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
Depth:
1
2
3
4
5
All
Reload
P_LastFallBackLeadTime view