P_ProductPlantWD

DDL: P_PRODUCTPLANTWD SQL: PPRDPLANTWD Type: view COMPOSITE Package: VDM_MD_PRODUCT_OBSOLETE

Union

P_ProductPlantWD is a Composite CDS View that provides data about "Union" in SAP S/4HANA. It reads from 5 data sources (I_ProductPlant, I_DraftAdministrativeData, P_ProductPlantD, P_ProductPlantD, P_Productplantreferences) and exposes 59 fields with key fields Draftkey, ActiveProduct, ActivePlant, ActiveProduct, ActivePlant. Part of development package VDM_MD_PRODUCT_OBSOLETE.

Data Sources (5)

SourceAliasJoin Type
I_ProductPlant ActiveDocument from
I_DraftAdministrativeData DraftAdministrativeData inner
P_ProductPlantD DraftDocument left_outer
P_ProductPlantD DraftDocument union_all
P_Productplantreferences Reference left_outer

Annotations (6)

NameValueLevelField
AbapCatalog.sqlViewName PPRDPLANTWD view
VDM.viewType #COMPOSITE view
VDM.private true view
ClientDependent true view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view

Fields (59)

KeyFieldSource TableSource FieldDescription
KEY Draftkey
KEY ActiveProduct I_ProductPlant Product
KEY ActivePlant I_ProductPlant Plant
ParentDraftKey
Product I_ProductPlant Product
Plant I_ProductPlant Plant
PurchasingGroup I_ProductPlant PurchasingGroup
CountryOfOrigin I_ProductPlant CountryOfOrigin
RegionOfOrigin I_ProductPlant RegionOfOrigin
ProductionInvtryManagedLoc I_ProductPlant ProductionInvtryManagedLoc
ProfileCode I_ProductPlant ProfileCode
ProfileValidityStartDate I_ProductPlant ProfileValidityStartDate
AvailabilityCheckType I_ProductPlant AvailabilityCheckType
FiscalYearVariant I_ProductPlant FiscalYearVariant
PeriodType I_ProductPlant PeriodType
ProfitCenter I_ProductPlant ProfitCenter
MaintenanceStatusName I_ProductPlant MaintenanceStatusName
IsMarkedForDeletion
ConsumptionTaxCtrlCode I_ProductPlant ConsumptionTaxCtrlCode
IsCoProduct I_ProductPlant IsCoProduct
ProductIsConfigurable I_ProductPlant ProductIsConfigurable
StockDeterminationGroup I_ProductPlant StockDeterminationGroup
StockInTransferQuantity I_ProductPlant StockInTransferQuantity
StockInTransitQuantity I_ProductPlant StockInTransitQuantity
HasPostToInspectionStock I_ProductPlant HasPostToInspectionStock
GoodsReceiptBlockedStockQty I_ProductPlant GoodsReceiptBlockedStockQty
HasConsignmentCtrl I_ProductPlant HasConsignmentCtrl
IsPurgAcrossPurgGroup I_ProductPlant IsPurgAcrossPurgGroup
IsInternalBatchManaged I_ProductPlant IsInternalBatchManaged
ProductCFOPCategory I_ProductPlant ProductCFOPCategory
SourceOfSupplyCategory I_ProductPlant SourceOfSupplyCategory
ProductUnitGroup I_ProductPlant ProductUnitGroup
DistrCntrDistributionProfile I_ProductPlant DistrCntrDistributionProfile
ConsignmentControl I_ProductPlant ConsignmentControl
GoodIssueProcessingDays I_ProductPlant GoodIssueProcessingDays
SalesOrganization P_Productplantreferences SalesOrganization
DistributionChannel P_Productplantreferences DistributionChannel
PlantCategory P_Productplantreferences PlantCategory
ReferenceDistributionCenter P_Productplantreferences ReferenceDistributionCenter
ReferenceStore P_Productplantreferences ReferenceStore
IsReferenceDistributionCenter P_Productplantreferences IsReferenceDistributionCenter
IsReferenceStore P_Productplantreferences IsReferenceStore
IsActiveEntity
HasActiveEntity
Draftkey
KEY ActiveProduct P_ProductPlantD ActiveProduct
KEY ActivePlant P_ProductPlantD ActivePlant
Parentdraftkey P_ProductPlantD Parentdraftkey
product P_ProductPlantD product
plant P_ProductPlantD plant
profilecode P_ProductPlantD profilecode
periodtype P_ProductPlantD periodtype
profitcenter P_ProductPlantD profitcenter
IsMarkedForDeletion
iscoproduct P_ProductPlantD iscoproduct
IsActiveEntity
HasActiveEntity
HasDraftEntity
DraftAdministrativeDataUUID
@AbapCatalog.sqlViewName: 'PPRDPLANTWD'
@VDM.viewType: #COMPOSITE
@VDM.private: true
@ClientDependent: true
@AbapCatalog.compiler.compareFilter: true
//@EndUserText.label: 'Product Plant Union (draft)'

@AccessControl.authorizationCheck: #NOT_REQUIRED
define view P_ProductPlantWD
  as select from    I_ProductPlant           as ActiveDocument
    left outer join P_ProductPlantD          as DraftDocument on  DraftDocument.ActiveProduct = ActiveDocument.Product
                                                              and DraftDocument.ActivePlant   = ActiveDocument.Plant
    left outer join P_Productplantreferences as Reference     on  ActiveDocument.Plant   = Reference.Plant
                                                              and ActiveDocument.Product = Reference.Product
{
  key cast ( hextobin('00000000000000000000000000000000') as sysuuid_x )                       as Draftkey,
  key ActiveDocument.Product                                                                   as ActiveProduct,
  key ActiveDocument.Plant                                                                     as ActivePlant,
      cast ( hextobin('00000000000000000000000000000000') as sysuuid_x )                       as ParentDraftKey,
      ActiveDocument.Product,
      ActiveDocument.Plant,
      ActiveDocument.PurchasingGroup,
      ActiveDocument.CountryOfOrigin,
      ActiveDocument.RegionOfOrigin,
      ActiveDocument.ProductionInvtryManagedLoc,

      ActiveDocument.ProfileCode,
      ActiveDocument.ProfileValidityStartDate,
      ActiveDocument.AvailabilityCheckType,

      ActiveDocument.FiscalYearVariant,

      ActiveDocument.PeriodType,

      ActiveDocument.ProfitCenter,

      //ActiveDocument.Commodity,  //pstat changes

      //ActiveDocument.GoodsReceiptDuration, "PSTAT Changes

      ActiveDocument.MaintenanceStatusName,
      cast(ActiveDocument.IsMarkedForDeletion as boole_d)                                      as IsMarkedForDeletion,

      ActiveDocument.ConsumptionTaxCtrlCode,
      ActiveDocument.IsCoProduct,

      ActiveDocument.ProductIsConfigurable,

      ActiveDocument.StockDeterminationGroup,
      ActiveDocument.StockInTransferQuantity,
      ActiveDocument.StockInTransitQuantity,

      ActiveDocument.HasPostToInspectionStock,
      // ActiveDocument.IsBatchManagementRequired, "PSTAT Changes


      //ActiveDocument.SerialNumberProfile, "PSTAT Changes

      //ActiveDocument.IsNegativeStockAllowed, "PSTAT Changes

      ActiveDocument.GoodsReceiptBlockedStockQty,

      ActiveDocument.HasConsignmentCtrl,
      //  ActiveDocument.TiedEmptiesStockQuantity,


      //ActiveDocument.FiscalYearCurrentPeriod, //pstat changes

      //ActiveDocument.FiscalMonthCurrentPeriod, //pstat changes

      ActiveDocument.IsPurgAcrossPurgGroup,
      ActiveDocument.IsInternalBatchManaged,
      ActiveDocument.ProductCFOPCategory,


      // Retail fields added on 21.4.16


     // ActiveDocument.GoodsIssueUnit,  //pstat changes

      ActiveDocument.SourceOfSupplyCategory,
//      ActiveDocument.ConsumptionReferenceProduct,

//      ActiveDocument.ConsumptionReferencePlant,

//      ActiveDocument.ConsumptionRefUsageEndDate,

//      ActiveDocument.ConsumptionQtyMultiplier,

      ActiveDocument.ProductUnitGroup,
      ActiveDocument.DistrCntrDistributionProfile,
      ActiveDocument.ConsignmentControl,
      ActiveDocument.GoodIssueProcessingDays,
      //Reference Handling

      Reference.SalesOrganization,
      Reference.DistributionChannel,
      Reference.PlantCategory,
      Reference.ReferenceDistributionCenter,
      Reference.ReferenceStore,
      Reference.IsReferenceDistributionCenter,
      Reference.IsReferenceStore,

      cast( 'X' as boole_d )                                                                   as IsActiveEntity,
      cast( ' ' as boole_d )                                                                   as HasActiveEntity,
      cast(
      case
        when DraftDocument.Draftkey is null
        then ' '
        else 'X'
      end  as boole_d)                                                                         as HasDraftEntity,
      cast(DraftDocument.Parentdraftkey as sysuuid_x )                                         as DraftAdministrativeDataUUID
}

union all

select from  P_ProductPlantD           as DraftDocument
  inner join I_DraftAdministrativeData as DraftAdministrativeData on DraftAdministrativeData.DraftUUID = DraftDocument.Parentdraftkey

{
  key DraftDocument.Draftkey,
  key DraftDocument.ActiveProduct,
  key DraftDocument.ActivePlant,
      DraftDocument.Parentdraftkey,
      DraftDocument.product,
      DraftDocument.plant,
      DraftDocument.purchasinggroup,
      DraftDocument.countryoforigin,
      DraftDocument.regionoforigin,

      DraftDocument.productioninvtrymanagedloc,

      DraftDocument.profilecode,
      DraftDocument.profilevaliditystartdate,
      DraftDocument.availabilitychecktype,

      DraftDocument.fiscalyearvariant,

      DraftDocument.periodtype,

      DraftDocument.profitcenter,

      //DraftDocument.commodity, //pstat changes

      //DraftDocument.goodsreceiptduration, "PSTAT Changes

      DraftDocument.maintenancestatusname,
      cast(DraftDocument.ismarkedfordeletion as boole_d) as IsMarkedForDeletion,

      DraftDocument.consumptiontaxctrlcode,
      DraftDocument.iscoproduct,

      DraftDocument.productisconfigurable,

      DraftDocument.stockdeterminationgroup,
      DraftDocument.stockintransferquantity,
      DraftDocument.stockintransitquantity,

      DraftDocument.hasposttoinspectionstock,
      //DraftDocument.isbatchmanagementrequired, "PSTAT Changes


      // DraftDocument.serialnumberprofile, "PSTAT Changes

      //DraftDocument.isnegativestockallowed, "PSTAT Changes

      DraftDocument.goodsreceiptblockedstockqty,

      DraftDocument.hasconsignmentctrl,
      // DraftDocument.tiedemptiesstockquantity,


     // DraftDocument.fiscalyearcurrentperiod, //pstat changes

     // DraftDocument.fiscalmonthcurrentperiod, //pstat changes

      DraftDocument.ispurgacrosspurggroup,
      DraftDocument.isinternalbatchmanaged,
      DraftDocument.productcfopcategory,


      //Retail fields added on  21.4.16


     // DraftDocument.goodsissueunit, //pstat changes

      DraftDocument.sourceofsupplycategory,
//      DraftDocument.consumptionreferenceproduct,

//      DraftDocument.consumptionreferenceplant,

//      DraftDocument.consumptionrefusageenddate,

//      DraftDocument.consumptionqtymultiplier,

      DraftDocument.productunitgroup,
      DraftDocument.distrcntrdistributionprofile,
      DraftDocument.consignmentcontrol,
      DraftDocument.goodissueprocessingdays,
      DraftDocument.salesorganization,
      DraftDocument.distributionchannel,
      DraftDocument.plantcategory,
      DraftDocument.referencedistributioncenter,
      DraftDocument.referencestore,
      DraftDocument.isreferencedistributioncenter,
      DraftDocument.isreferencestore,



      cast( ' ' as boole_d )                             as IsActiveEntity,
      cast( DraftDocument.HasActiveEntity as boole_d )   as HasActiveEntity,
      cast( ' ' as boole_d )                             as HasDraftEntity,
      cast(DraftDocument.Parentdraftkey as sysuuid_x )   as DraftAdministrativeDataUUID
}
where
     DraftAdministrativeData.CreatedByUser   = $session.user
  or DraftAdministrativeData.InProcessByUser = $session.user
// where DraftAdministrativeData.CreatedByUser = $session.user

//          or DraftAdministrativeData.InProcessByUser = $session.user