P_ProductStorageWD

DDL: P_PRODUCTSTORAGEWD SQL: PPRDSTORAGEWD Type: view COMPOSITE Package: VDM_MD_PRODUCT_OBSOLETE

Product Storage Union (draft)

P_ProductStorageWD is a Composite CDS View that provides data about "Product Storage Union (draft)" in SAP S/4HANA. It reads from 5 data sources (I_Productstorage, I_DraftAdministrativeData, P_Productstoraged, P_Productstoraged, P_ProductD) and exposes 28 fields with key fields Draftkey, ActiveProduct, ActiveProduct. Part of development package VDM_MD_PRODUCT_OBSOLETE.

Data Sources (5)

SourceAliasJoin Type
I_Productstorage ActiveDocument from
I_DraftAdministrativeData DraftAdministrativeData inner
P_Productstoraged DraftDocument left_outer
P_Productstoraged DraftDocument union_all
P_ProductD DraftRootDocument inner

Annotations (6)

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

Fields (28)

KeyFieldSource TableSource FieldDescription
KEY Draftkey
KEY ActiveProduct I_Productstorage Product
ParentDraftKey
Product I_Productstorage Product
StorageConditions I_Productstorage StorageConditions
TemperatureConditionInd I_Productstorage TemperatureConditionInd
HazardousMaterialNumber I_Productstorage HazardousMaterialNumber
NmbrOfGROrGISlipsToPrintQty I_Productstorage NmbrOfGROrGISlipsToPrintQty
LabelType I_Productstorage LabelType
LabelForm I_Productstorage LabelForm
MinRemainingShelfLife I_Productstorage MinRemainingShelfLife
ExpirationDate I_Productstorage ExpirationDate
StorageBinInstruction I_Productstorage StorageBinInstruction
TotalShelfLifeStoragePercent I_Productstorage TotalShelfLifeStoragePercent
ShelfLifeExpirationDatePeriod I_Productstorage ShelfLifeExpirationDatePeriod
ShelfLifeExprtnDateRndingRule I_Productstorage ShelfLifeExprtnDateRndingRule
IsActiveEntity
HasActiveEntity
DraftKeyasDraftKey
KEY ActiveProduct P_Productstoraged ActiveProduct
ParentDraftKey P_Productstoraged ParentDraftKey
Product P_ProductD product
labeltype P_Productstoraged labeltype
labelform P_Productstoraged labelform
IsActiveEntity
HasActiveEntity
HasDraftEntity
DraftAdministrativeDataUUID
@AbapCatalog.sqlViewName: 'PPRDSTORAGEWD'
@VDM.viewType: #COMPOSITE
@VDM.private: true
@ClientDependent: true
@AbapCatalog.compiler.compareFilter: true
//@EndUserText.label: 'Product Storage Union (draft)'

@AccessControl.authorizationCheck: #NOT_REQUIRED
define view P_ProductStorageWD
  as

  select from       I_Productstorage  as ActiveDocument
  //          left outer join P_ProductD as DraftRootDocument on DraftRootDocument.product = ActiveDocument.Product

    left outer join P_Productstoraged as DraftDocument on DraftDocument.ActiveProduct = ActiveDocument.Product
  //                                                                  and DraftDocument.ParentDraftKey = DraftRootDocument.Draftkey

  //                                                                  and DraftDocument.ActiveProduct = DraftRootDocument.product

  //         inner join I_DraftAdministrativeData  as DraftAdministrativeData

  //                                                on   DraftAdministrativeData.DraftUUID       = DraftDocument.ParentDraftKey

{
  key cast ( hextobin('00000000000000000000000000000000') as sysuuid_x )                       as Draftkey,
  key ActiveDocument.Product                                                                   as ActiveProduct,
      cast ( hextobin('00000000000000000000000000000000') as sysuuid_x )                       as ParentDraftKey,
      ActiveDocument.Product,
      ActiveDocument.StorageConditions,
      ActiveDocument.TemperatureConditionInd,
      ActiveDocument.HazardousMaterialNumber,
      ActiveDocument.NmbrOfGROrGISlipsToPrintQty,
      ActiveDocument.LabelType,
      ActiveDocument.LabelForm,
      ActiveDocument.MinRemainingShelfLife,
      ActiveDocument.ExpirationDate,


      //        Retail Fields


      ActiveDocument.StorageBinInstruction,
//      ActiveDocument.TotalShelfLife, //pstat changes

      ActiveDocument.TotalShelfLifeStoragePercent,
      ActiveDocument.ShelfLifeExpirationDatePeriod,
      ActiveDocument.ShelfLifeExprtnDateRndingRule,



      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_Productstoraged         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,
  key DraftDocument.ActiveProduct                                                   as ActiveProduct,
      DraftDocument.ParentDraftKey                                                  as ParentDraftKey,
      DraftRootDocument.product                                                     as Product,
      DraftDocument.storageconditions,
      DraftDocument.temperatureconditionind,
      DraftDocument.hazardousmaterialnumber,
      DraftDocument.nmbrofgrorgislipstoprintqty,
      DraftDocument.labeltype,
      DraftDocument.labelform,
      DraftDocument.minremainingshelflife,
      DraftDocument.expirationdate,


      //    Retail Fields

      DraftDocument.storagebininstruction,
//      DraftDocument.totalshelflife, //pstat changes

      DraftDocument.totalshelflifestoragepercent,
      DraftDocument.shelflifeexpirationdateperiod,
      DraftDocument.shelflifeexprtndaterndingrule,




      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