P_NUMBEROFSOS

DDL: P_NUMBEROFSOS SQL: PNOOFSOS Type: view BASIC

P_NUMBEROFSOS is a Basic CDS View in SAP S/4HANA. It reads from 3 data sources (I_Capacity, I_SchedProdnPlngDets, I_WorkCenter) and exposes 3 fields with key fields Product, Plant.

Data Sources (3)

SourceAliasJoin Type
I_Capacity _Capacity inner
I_SchedProdnPlngDets _plngdets left_outer
I_WorkCenter _WorkCenter inner

Annotations (6)

NameValueLevelField
AbapCatalog.sqlViewName PNOOFSOS view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
VDM.private true view
VDM.viewType #BASIC view
ClientHandling.algorithm #SESSION_VARIABLE view

Fields (3)

KeyFieldSource TableSource FieldDescription
KEY Product _prodvers Material
KEY Plant _prodvers Plant
NumberOfSOS
@AbapCatalog.sqlViewName: 'PNOOFSOS'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@VDM.private: true
@VDM.viewType: #BASIC
@ClientHandling.algorithm: #SESSION_VARIABLE
define view P_NUMBEROFSOS
  as select distinct from I_ProductionVersion as _prodvers
    left outer join I_SchedProdnPlngDets as _plngdets on _plngdets.UserName = $session.user
                                                      and _plngdets.SchedProdnAppName = 'SCH_PROD'
    inner join            I_WorkCenter        as _WorkCenter on  _WorkCenter.WorkCenter              = _prodvers.ProductionLine
                                                             and _WorkCenter.Plant                   = _prodvers.Plant
                                                             and _WorkCenter.WorkCenterTypeCode      = 'A'
                                                             and _WorkCenter.WorkCenterIsToBeDeleted = ''
    inner join            I_Capacity          as _Capacity   on  _WorkCenter.CapacityInternalID = _Capacity.CapacityInternalID
                                                             and _Capacity.CapacityIsFinite     = 'X'
{

  key _prodvers.Material as Product,
  key _prodvers.Plant,
      cast (count(*) as pph_cfs_sch_number_of_sos) as NumberOfSOS
}
where
  _prodvers.ProductionLine != '' and (_plngdets.IndustryType is null or _prodvers._BillOfOperationsType.BillOfOperationsApplication = _plngdets.IndustryType)
group by
  _prodvers.Material,
  _prodvers.Plant