P_LastFallBackLeadTime

DDL: P_LASTFALLBACKLEADTIME SQL: PDDLASTLT Type: view CONSUMPTION

P_LastFallBackLeadTime is a Consumption CDS View in SAP S/4HANA. It reads from 3 data sources (I_MRPPlantControlParameter, I_MatlProcurementProfile, I_ProductPlantMRPArea) and exposes 5 fields with key fields Material, ProductionPlant, MRPArea.

Data Sources (3)

SourceAliasJoin Type
I_MRPPlantControlParameter _MRPControlParams left_outer
I_MatlProcurementProfile _prfl left_outer
I_ProductPlantMRPArea _ProductPlantMRPArea from

Annotations (7)

NameValueLevelField
AbapCatalog.sqlViewName PDDLASTLT view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.private true view
VDM.viewType #CONSUMPTION view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.serviceQuality #C view

Fields (5)

KeyFieldSource TableSource FieldDescription
KEY Material I_ProductPlantMRPArea Material
KEY ProductionPlant I_ProductPlantMRPArea Plant
KEY MRPArea I_ProductPlantMRPArea MRPArea
MRPType I_ProductPlantMRPArea MRPType
MRPController I_ProductPlantMRPArea MRPController
@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":""
}
}*/