P_Productprocurementwd

DDL: P_PRODUCTPROCUREMENTWD SQL: PPRDPROCWD Type: view COMPOSITE

P_Productprocurementwd is a Composite CDS View in SAP S/4HANA. It reads from 5 data sources (I_Productprocurement, I_DraftAdministrativeData, P_Productprocurementd, P_Productprocurementd, P_ProductD) and exposes 18 fields with key fields Draftkey, ActiveProduct, ActiveProduct.

Data Sources (5)

SourceAliasJoin Type
I_Productprocurement ActiveDocument from
I_DraftAdministrativeData DraftAdministrativeData inner
P_Productprocurementd DraftDocument left_outer
P_Productprocurementd DraftDocument union_all
P_ProductD DraftRootDocument inner

Annotations (5)

NameValueLevelField
AbapCatalog.sqlViewName PPRDPROCWD view
VDM.viewType #COMPOSITE view
VDM.private true view
ClientDependent true view
AbapCatalog.compiler.compareFilter true view

Fields (18)

KeyFieldSource TableSource FieldDescription
KEY Draftkey
KEY ActiveProduct I_Productprocurement Product
ParentDraftKey
Product I_Productprocurement Product
PurchaseOrderQuantityUnit I_Productprocurement PurchaseOrderQuantityUnit
PurchasingAcknProfile I_Productprocurement PurchasingAcknProfile
VarblPurOrdUnitStatus I_Productprocurement VarblPurOrdUnitStatus
SourceOfSupplyCategory I_Productprocurement SourceOfSupplyCategory
IsActiveEntity
HasActiveEntity
DraftkeyasDraftkey
KEY ActiveProduct P_Productprocurementd ActiveProduct
ParentDraftKey P_Productprocurementd ParentDraftKey
product P_ProductD product
IsActiveEntity
HasActiveEntity P_Productprocurementd hasactiveentity
HasDraftEntity
DraftAdministrativeDataUUID
@AbapCatalog.sqlViewName: 'PPRDPROCWD'
@VDM.viewType: #COMPOSITE
@VDM.private: true
@ClientDependent: true
@AbapCatalog.compiler.compareFilter: true
//@EndUserText.label: 'Product: Union for product procurement'

define view P_Productprocurementwd

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

    left outer join P_Productprocurementd as DraftDocument on DraftDocument.ActiveProduct = ActiveDocument.Product
{
  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.PurchaseOrderQuantityUnit,
      ActiveDocument.PurchasingAcknProfile,
      ActiveDocument.VarblPurOrdUnitStatus,
      //      ActiveDocument.ManufacturerNumber, //pstat changes


      //         Retail Field

      ActiveDocument.SourceOfSupplyCategory, // Ref. Handling For MARC

      //      ActiveDocument.PurchasingGroup, // ref. handling for MARC


      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_Productprocurementd     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,
      DraftDocument.purchaseorderquantityunit,
      DraftDocument.purchasingacknprofile,
      DraftDocument.varblpurordunitstatus,
      //      DraftDocument.manufacturernumber, //pstat changes


      //        Retail Field

      DraftDocument.sourceofsupplycategory, // Ref Handling for MARC

      //      DraftDocument.purchasinggroup, // ref. handling for MARC


      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_PRODUCTPROCUREMENT",
"P_PRODUCTD",
"P_PRODUCTPROCUREMENTD"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/