P_ProductSalesDeliveryWD

DDL: P_PRODUCTSALESDELIVERYWD SQL: PPRDSALESDELIVWD Type: view COMPOSITE

P_ProductSalesDeliveryWD is a Composite CDS View in SAP S/4HANA. It reads from 5 data sources (I_ProductSalesDelivery, I_DraftAdministrativeData, P_ProductSalesDeliveryD, P_ProductSalesDeliveryD, P_ProductD) and exposes 60 fields with key fields Draftkey, ActiveProduct, ActiveProductSalesOrg, ActiveProductDistributionChnl.

Data Sources (5)

SourceAliasJoin Type
I_ProductSalesDelivery ActiveDocument from
I_DraftAdministrativeData DraftAdministrativeData inner
P_ProductSalesDeliveryD DraftDocument left_outer
P_ProductSalesDeliveryD DraftDocument union_all
P_ProductD DraftRootDocument inner

Annotations (6)

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

Fields (60)

KeyFieldSource TableSource FieldDescription
KEY Draftkey
KEY ActiveProduct I_ProductSalesDelivery Product
KEY ActiveProductSalesOrg I_ProductSalesDelivery ProductSalesOrg
KEY ActiveProductDistributionChnl I_ProductSalesDelivery ProductDistributionChnl
ParentDraftKey
Product I_ProductSalesDelivery Product
MinimumOrderQuantity I_ProductSalesDelivery MinimumOrderQuantity
SupplyingPlant I_ProductSalesDelivery SupplyingPlant
PriceSpecificationProductGroup I_ProductSalesDelivery PriceSpecificationProductGroup
AccountDetnProductGroup I_ProductSalesDelivery AccountDetnProductGroup
DeliveryNoteProcMinDelivQty I_ProductSalesDelivery DeliveryNoteProcMinDelivQty
ItemCategoryGroup I_ProductSalesDelivery ItemCategoryGroup
DeliveryQuantityUnit I_ProductSalesDelivery DeliveryQuantityUnit
DeliveryQuantity
ProductSalesStatus I_ProductSalesDelivery ProductSalesStatus
ProductSalesStatusValidityDate I_ProductSalesDelivery ProductSalesStatusValidityDate
SalesMeasureUnit I_ProductSalesDelivery SalesMeasureUnit
IsMarkedForDeletion
ProductHierarchy I_ProductSalesDelivery ProductHierarchy
FirstSalesSpecProductGroup I_ProductSalesDelivery FirstSalesSpecProductGroup
SecondSalesSpecProductGroup I_ProductSalesDelivery SecondSalesSpecProductGroup
ThirdSalesSpecProductGroup I_ProductSalesDelivery ThirdSalesSpecProductGroup
FourthSalesSpecProductGroup I_ProductSalesDelivery FourthSalesSpecProductGroup
FifthSalesSpecProductGroup I_ProductSalesDelivery FifthSalesSpecProductGroup
MinimumMakeToOrderOrderQty I_ProductSalesDelivery MinimumMakeToOrderOrderQty
LogisticsStatisticsGroup I_ProductSalesDelivery LogisticsStatisticsGroup
VolumeRebateGroup I_ProductSalesDelivery VolumeRebateGroup
ProductCommissionGroup I_ProductSalesDelivery ProductCommissionGroup
CashDiscountIsDeductible I_ProductSalesDelivery CashDiscountIsDeductible
PricingReferenceProduct I_ProductSalesDelivery PricingReferenceProduct
AssortmentGrade I_ProductSalesDelivery AssortmentGrade
StoreListingProcedure I_ProductSalesDelivery StoreListingProcedure
DistrCntrListingProcedure I_ProductSalesDelivery DistrCntrListingProcedure
StoreListingStartDate I_ProductSalesDelivery StoreListingStartDate
StoreListingEndDate I_ProductSalesDelivery StoreListingEndDate
DistrCntrListingStartDate I_ProductSalesDelivery DistrCntrListingStartDate
DistrCntrListingEndDate I_ProductSalesDelivery DistrCntrListingEndDate
StoreSaleStartDate I_ProductSalesDelivery StoreSaleStartDate
StoreSaleEndDate I_ProductSalesDelivery StoreSaleEndDate
DistrCntrSaleStartDate I_ProductSalesDelivery DistrCntrSaleStartDate
DistrCntrSaleEndDate I_ProductSalesDelivery DistrCntrSaleEndDate
RoundingProfile I_ProductSalesDelivery RoundingProfile
ProductUnitGroup I_ProductSalesDelivery ProductUnitGroup
MaxDeliveryQtyStoreOrder I_ProductSalesDelivery MaxDeliveryQtyStoreOrder
PriceFixingCategory I_ProductSalesDelivery PriceFixingCategory
VariableSalesUnitIsNotAllowed I_ProductSalesDelivery VariableSalesUnitIsNotAllowed
CompetitionPressureCategory I_ProductSalesDelivery CompetitionPressureCategory
IsActiveEntity
HasActiveEntity
DraftkeyasDraftkey
ActiveProduct P_ProductSalesDeliveryD ActiveProduct
ActiveProductSalesOrg P_ProductSalesDeliveryD ActiveProductSalesOrg
ActiveProductDistributionChnl P_ProductSalesDeliveryD ActiveProductDistributionChnl
ParentDraftKey P_ProductSalesDeliveryD ParentDraftKey
product P_ProductD product
IsMarkedForDeletion
IsActiveEntity
HasActiveEntity P_ProductSalesDeliveryD hasactiveentity
HasDraftEntity
DraftAdministrativeDataUUID
@AbapCatalog.sqlViewName: 'PPRDSALESDELIVWD'
@VDM.viewType: #COMPOSITE
@VDM.private: true
@ClientDependent: true
@AbapCatalog.compiler.compareFilter: true
//@EndUserText.label: 'Product Sales Delivery Union (draft)'

@AccessControl.authorizationCheck: #NOT_REQUIRED
define view P_ProductSalesDeliveryWD
  as

  select from       I_ProductSalesDelivery  as ActiveDocument
    left outer join P_ProductSalesDeliveryD as DraftDocument on  DraftDocument.ActiveProduct                 = ActiveDocument.Product
                                                             and DraftDocument.ActiveProductSalesOrg         = ActiveDocument.ProductSalesOrg
                                                             and DraftDocument.ActiveProductDistributionChnl = ActiveDocument.ProductDistributionChnl

{
  key cast ( hextobin('00000000000000000000000000000000') as sysuuid_x )                           as Draftkey,
  key ActiveDocument.Product                                                                       as ActiveProduct,
  key ActiveDocument.ProductSalesOrg                                                      as ActiveProductSalesOrg,
  key ActiveDocument.ProductDistributionChnl                                                    as ActiveProductDistributionChnl,
      cast ( hextobin('00000000000000000000000000000000') as sysuuid_x )                           as ParentDraftKey,
      ActiveDocument.Product,
//      ActiveDocument.ProductSalesOrganization,

//      ActiveDocument.ProductDistributionChannel,

      ActiveDocument.MinimumOrderQuantity,
      ActiveDocument.SupplyingPlant,
      ActiveDocument.PriceSpecificationProductGroup,
      ActiveDocument.AccountDetnProductGroup,
      ActiveDocument.DeliveryNoteProcMinDelivQty,
      ActiveDocument.ItemCategoryGroup,
      ActiveDocument.DeliveryQuantityUnit,
      ActiveDocument. DeliveryQuantity,
      ActiveDocument.ProductSalesStatus,
      ActiveDocument.ProductSalesStatusValidityDate,
      ActiveDocument.SalesMeasureUnit,
      cast(ActiveDocument.IsMarkedForDeletion as boole_d)                                          as IsMarkedForDeletion,
      ActiveDocument.ProductHierarchy,
      ActiveDocument.FirstSalesSpecProductGroup,
      ActiveDocument.SecondSalesSpecProductGroup,
      ActiveDocument.ThirdSalesSpecProductGroup,
      ActiveDocument.FourthSalesSpecProductGroup,
      ActiveDocument.FifthSalesSpecProductGroup,
      ActiveDocument.MinimumMakeToOrderOrderQty,
      //retail fields added on 25.4.16

      ActiveDocument.LogisticsStatisticsGroup,
      ActiveDocument.VolumeRebateGroup,
      ActiveDocument.ProductCommissionGroup,
      ActiveDocument.CashDiscountIsDeductible,
      ActiveDocument.PricingReferenceProduct,
      ActiveDocument.AssortmentGrade,
      ActiveDocument.StoreListingProcedure,
      ActiveDocument.DistrCntrListingProcedure,
      ActiveDocument.StoreListingStartDate,
      ActiveDocument.StoreListingEndDate,
      ActiveDocument.DistrCntrListingStartDate,
      ActiveDocument.DistrCntrListingEndDate,
      ActiveDocument.StoreSaleStartDate,
      ActiveDocument.StoreSaleEndDate,
      ActiveDocument.DistrCntrSaleStartDate,
      ActiveDocument.DistrCntrSaleEndDate,
      ActiveDocument.RoundingProfile,
      ActiveDocument.ProductUnitGroup,
      ActiveDocument.MaxDeliveryQtyStoreOrder,
      ActiveDocument.PriceFixingCategory,
      ActiveDocument.VariableSalesUnitIsNotAllowed,
      ActiveDocument.CompetitionPressureCategory,

      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_ProductSalesDeliveryD   as DraftDocument
  inner join P_ProductD                as DraftRootDocument       on DraftRootDocument.Draftkey = DraftDocument.ParentDraftKey

  inner join I_DraftAdministrativeData as DraftAdministrativeData on DraftAdministrativeData.DraftUUID = DraftDocument.ParentDraftKey

{
  key DraftDocument.Draftkey                                                        as Draftkey,
      DraftDocument.ActiveProduct                                                   as ActiveProduct,
      DraftDocument.ActiveProductSalesOrg                                           as ActiveProductSalesOrg,
      DraftDocument.ActiveProductDistributionChnl                                   as ActiveProductDistributionChnl,
      DraftDocument.ParentDraftKey                                                  as ParentDraftKey,
      DraftRootDocument.product,
//      DraftDocument.productsalesorganization,

//      DraftDocument.productdistributionchannel,

      DraftDocument.minimumorderquantity,
      DraftDocument.supplyingplant,
      DraftDocument.pricespecificationproductgroup,
      DraftDocument.accountdetnproductgroup,
      DraftDocument.deliverynoteprocmindelivqty,
      DraftDocument.itemcategorygroup,
      DraftDocument.deliveryquantityunit,
      DraftDocument.deliveryquantity,
      DraftDocument.productsalesstatus,
      DraftDocument.productsalesstatusvaliditydate,
      DraftDocument.salesmeasureunit,
      cast(DraftDocument.ismarkedfordeletion as boole_d)                            as IsMarkedForDeletion,
      DraftDocument.producthierarchy,
      DraftDocument.firstsalesspecproductgroup,
      DraftDocument.secondsalesspecproductgroup,
      DraftDocument.thirdsalesspecproductgroup,
      DraftDocument.fourthsalesspecproductgroup,
      DraftDocument.fifthsalesspecproductgroup,
      DraftDocument.minimummaketoorderorderqty,
      //retail fields added on 25.4.16

      DraftDocument.logisticsstatisticsgroup,
      DraftDocument.volumerebategroup,
      DraftDocument.productcommissiongroup,
      DraftDocument.cashdiscountisdeductible,
      DraftDocument.pricingreferenceproduct,
      DraftDocument.assortmentgrade,
      DraftDocument.storelistingprocedure,
      DraftDocument.distrcntrlistingprocedure,
      DraftDocument.storelistingstartdate,
      DraftDocument.storelistingenddate,
      DraftDocument.distrcntrlistingstartdate,
      DraftDocument.distrcntrlistingenddate,
      DraftDocument.storesalestartdate,
      DraftDocument.storesaleenddate,
      DraftDocument.distrcntrsalestartdate,
      DraftDocument.distrcntrsaleenddate,
      DraftDocument.roundingprofile,
      DraftDocument.productunitgroup,
      DraftDocument.maxdeliveryqtystoreorder,
      DraftDocument.pricefixingcategory,
      DraftDocument.variablesalesunitisnotallowed,
      DraftDocument.competitionpressurecategory,

      cast( ' ' as boole_d )                                                        as IsActiveEntity,
      DraftDocument.hasactiveentity                                                 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      
  
  
  
  
  
 /*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_DRAFTADMINISTRATIVEDATA",
"I_PRODUCTSALESDELIVERY",
"P_PRODUCTD",
"P_PRODUCTSALESDELIVERYD"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/