P_LastFallBackLeadTime

DDL: P_LASTFALLBACKLEADTIME Type: view_entity CONSUMPTION Package: PPH_DD_VDM_STLM

Demand Driven Product Lead Time From Material Master

P_LastFallBackLeadTime is a Consumption CDS View that provides data about "Demand Driven Product Lead Time From Material Master" in SAP S/4HANA. It reads from 3 data sources (I_MRPPlantControlParameter, I_MatlProcurementProfile, I_ProductPlantMRPArea) and exposes 7 fields with key fields Material, ProductionPlant, MRPArea. Part of development package PPH_DD_VDM_STLM.

Data Sources (3)

SourceAliasJoin Type
I_MRPPlantControlParameter _MRPControlParams left_outer
I_MatlProcurementProfile _prfl left_outer
I_ProductPlantMRPArea _ProductPlantMRPArea from

Annotations (4)

NameValueLevelField
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.private true view
VDM.viewType #CONSUMPTION view
ObjectModel.usageType.serviceQuality #C view

Fields (7)

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
IsBulkMaterial I_ProductPlantMRPArea IsBulkMaterial
IsPhantomItem I_ProductPlantMRPArea IsPhantomItem
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.private: true
@VDM.viewType: #CONSUMPTION
@ObjectModel.usageType.serviceQuality: #C

define view entity 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,
       
       _ProductPlantMRPArea.IsBulkMaterial,
       _ProductPlantMRPArea.IsPhantomItem 
       
}