P_PrdtdDelivProcgDlyApplyData

DDL: P_PRDTDDELIVPROCGDLYAPPLYDATA SQL: PDELIVPROCGPAD Type: view CONSUMPTION

P_PrdtdDelivProcgDlyApplyData is a Consumption CDS View in SAP S/4HANA. It reads from 2 data sources (I_SalesDocumentItem, I_SalesDocument) and exposes 131 fields with key fields SalesDocument, SalesDocumentItem.

Data Sources (2)

SourceAliasJoin Type
I_SalesDocumentItem Item from
I_SalesDocument SalesDocument inner

Annotations (7)

NameValueLevelField
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.private true view
VDM.viewType #CONSUMPTION view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
AbapCatalog.preserveKey true view
AbapCatalog.sqlViewName PDELIVPROCGPAD view

Fields (131)

KeyFieldSource TableSource FieldDescription
KEY SalesDocument I_SalesDocumentItem SalesDocument
KEY SalesDocumentItem I_SalesDocumentItem SalesDocumentItem
DelivProcgDelayInDays
SDDocumentCategory I_SalesDocumentItem SDDocumentCategory
SalesDocumentItemCategory I_SalesDocumentItem SalesDocumentItemCategory
SalesDocumentItemType I_SalesDocumentItem SalesDocumentItemType
CompletionRule I_SalesDocumentItem CompletionRule
SalesDocumentType I_SalesDocument SalesDocumentType
SalesDocumentProcessingType I_SalesDocument SalesDocumentProcessingType
ItemCreationDate I_SalesDocumentItem CreationDate
ItemCreationTime I_SalesDocumentItem CreationTime
ItemLastChangeDate I_SalesDocumentItem LastChangeDate
CreationDate I_SalesDocument CreationDate
CreationTime I_SalesDocument CreationTime
LastChangeDate I_SalesDocument LastChangeDate
LastChangeDateTime I_SalesDocument LastChangeDateTime
ItemCreationDateYear
ItemCreationCalendarMonth
ItemCreationCalendarWeek
Division I_SalesDocumentItem Division
SalesOrganization I_SalesDocument SalesOrganization
DistributionChannel I_SalesDocument DistributionChannel
OrganizationDivision
SalesGroup I_SalesDocument SalesGroup
SalesOffice I_SalesDocument SalesOffice
Material I_SalesDocumentItem Material
OriginallyRequestedMaterial I_SalesDocumentItem OriginallyRequestedMaterial
MaterialByCustomer I_SalesDocumentItem MaterialByCustomer
InternationalArticleNumber I_SalesDocumentItem InternationalArticleNumber
Batch I_SalesDocumentItem Batch
ProductHierarchyNode I_SalesDocumentItem ProductHierarchyNode
ProductCatalog I_SalesDocumentItem ProductCatalog
MaterialSubstitutionReason I_SalesDocumentItem MaterialSubstitutionReason
MaterialGroup I_SalesDocumentItem MaterialGroup
AdditionalMaterialGroup1 I_SalesDocumentItem AdditionalMaterialGroup1
AdditionalMaterialGroup2 I_SalesDocumentItem AdditionalMaterialGroup2
AdditionalMaterialGroup3 I_SalesDocumentItem AdditionalMaterialGroup3
AdditionalMaterialGroup4 I_SalesDocumentItem AdditionalMaterialGroup4
AdditionalMaterialGroup5 I_SalesDocumentItem AdditionalMaterialGroup5
ProductConfiguration I_SalesDocumentItem ProductConfiguration
MRPArea I_SalesDocumentItem MRPArea
BillOfMaterial I_SalesDocumentItem BillOfMaterial
ProdAvailabilityCheckGroup I_SalesDocumentItem ProdAvailabilityCheckGroup
SoldToParty I_SalesDocument SoldToParty
ShipToParty
SalesDocumentItemText I_SalesDocumentItem SalesDocumentItemText
RequestedDeliveryDate I_SalesDocument RequestedDeliveryDate
OrderQuantity I_SalesDocumentItem OrderQuantity
OrderQuantityUnit I_SalesDocumentItem OrderQuantityUnit
ConfdDelivQtyInOrderQtyUnit I_SalesDocumentItem ConfdDelivQtyInOrderQtyUnit
TargetDelivQtyInOrderQtyUnit I_SalesDocumentItem TargetDelivQtyInOrderQtyUnit
ConfdDeliveryQtyInBaseUnit I_SalesDocumentItem ConfdDeliveryQtyInBaseUnit
BaseUnit I_SalesDocumentItem BaseUnit
RequestedQuantity I_SalesDocumentItem RequestedQuantity
RequestedQuantityUnit I_SalesDocumentItem RequestedQuantityUnit
RequestedQuantityInBaseUnit I_SalesDocumentItem RequestedQuantityInBaseUnit
ItemGrossWeight I_SalesDocumentItem ItemGrossWeight
ItemNetWeight I_SalesDocumentItem ItemNetWeight
ItemWeightUnit I_SalesDocumentItem ItemWeightUnit
ItemVolume I_SalesDocumentItem ItemVolume
ItemVolumeUnit I_SalesDocumentItem ItemVolumeUnit
SalesDistrict I_SalesDocumentItem SalesDistrict
SalesDeal I_SalesDocumentItem SalesDeal
SalesPromotion
RetailPromotion
CustomerGroup I_SalesDocumentItem CustomerGroup
RequirementSegment I_SalesDocumentItem RequirementSegment
QuantityIsFixed I_SalesDocumentItem QuantityIsFixed
AdditionalCustomerGroup1 I_SalesDocument AdditionalCustomerGroup1
AdditionalCustomerGroup2 I_SalesDocument AdditionalCustomerGroup2
AdditionalCustomerGroup3 I_SalesDocument AdditionalCustomerGroup3
AdditionalCustomerGroup4 I_SalesDocument AdditionalCustomerGroup4
AdditionalCustomerGroup5 I_SalesDocument AdditionalCustomerGroup5
CreditControlArea I_SalesDocument CreditControlArea
SalesDocumentDate I_SalesDocument SalesDocumentDate
SDDocumentReason I_SalesDocument SDDocumentReason
NetAmount I_SalesDocumentItem NetAmount
TransactionCurrency I_SalesDocumentItem TransactionCurrency
MaterialPricingGroup I_SalesDocumentItem MaterialPricingGroup
NetPriceAmount I_SalesDocumentItem NetPriceAmount
NetPriceQuantity I_SalesDocumentItem NetPriceQuantity
NetPriceQuantityUnit I_SalesDocumentItem NetPriceQuantityUnit
Subtotal1Amount I_SalesDocumentItem Subtotal1Amount
Subtotal2Amount I_SalesDocumentItem Subtotal2Amount
Subtotal3Amount I_SalesDocumentItem Subtotal3Amount
Subtotal4Amount I_SalesDocumentItem Subtotal4Amount
Subtotal5Amount I_SalesDocumentItem Subtotal5Amount
Subtotal6Amount I_SalesDocumentItem Subtotal6Amount
TotalNetAmount I_SalesDocument TotalNetAmount
ShippingPoint I_SalesDocumentItem ShippingPoint
ShippingType I_SalesDocumentItem ShippingType
InventorySpecialStockType I_SalesDocumentItem InventorySpecialStockType
DeliveryPriority I_SalesDocumentItem DeliveryPriority
Plant I_SalesDocumentItem Plant
StorageLocation I_SalesDocumentItem StorageLocation
Route I_SalesDocumentItem Route
DeliveryGroup I_SalesDocumentItem DeliveryGroup
DeliveryDateQuantityIsFixed I_SalesDocumentItem DeliveryDateQuantityIsFixed
PartialDeliveryIsAllowed I_SalesDocumentItem PartialDeliveryIsAllowed
MaxNmbrOfPartialDelivery I_SalesDocumentItem MaxNmbrOfPartialDelivery
UnlimitedOverdeliveryIsAllowed I_SalesDocumentItem UnlimitedOverdeliveryIsAllowed
OverdelivTolrtdLmtRatioInPct I_SalesDocumentItem OverdelivTolrtdLmtRatioInPct
UnderdelivTolrtdLmtRatioInPct I_SalesDocumentItem UnderdelivTolrtdLmtRatioInPct
MinDeliveryQtyInBaseUnit I_SalesDocumentItem MinDeliveryQtyInBaseUnit
OpenDeliveryLeadingUnitCode I_SalesDocumentItem OpenDeliveryLeadingUnitCode
ShippingCondition I_SalesDocument ShippingCondition
CompleteDeliveryIsDefined I_SalesDocument CompleteDeliveryIsDefined
ProductSeasonYear I_SalesDocumentItem ProductSeasonYear
ProductSeason I_SalesDocumentItem ProductSeason
ProductCollection I_SalesDocumentItem ProductCollection
ProductTheme I_SalesDocumentItem ProductTheme
ProductCharacteristic1 I_SalesDocumentItem ProductCharacteristic1
ProductCharacteristic2 I_SalesDocumentItem ProductCharacteristic2
ProductCharacteristic3 I_SalesDocumentItem ProductCharacteristic3
ShippingGroupNumber I_SalesDocumentItem ShippingGroupNumber
ShippingGroupRule I_SalesDocumentItem ShippingGroupRule
IncotermsClassification I_SalesDocumentItem IncotermsClassification
IncotermsTransferLocation I_SalesDocumentItem IncotermsTransferLocation
IncotermsLocation1 I_SalesDocumentItem IncotermsLocation1
IncotermsLocation2 I_SalesDocumentItem IncotermsLocation2
CustomerPaymentTerms I_SalesDocumentItem CustomerPaymentTerms
PaymentMethod I_SalesDocumentItem PaymentMethod
BusinessArea I_SalesDocumentItem BusinessArea
ProfitCenter I_SalesDocumentItem ProfitCenter
WBSElement I_SalesDocumentItem WBSElement
WBSElementInternalID I_SalesDocumentItem WBSElementInternalID
OrderID I_SalesDocumentItem OrderID
ProfitabilitySegment I_SalesDocumentItem ProfitabilitySegment_2
CostCenter I_SalesDocument CostCenter
ControllingArea I_SalesDocument ControllingArea
HigherLevelItem I_SalesDocumentItem HigherLevelItem
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM.private: true
@VDM.viewType: #CONSUMPTION
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@AbapCatalog.preserveKey: true
@AbapCatalog.sqlViewName: 'PDELIVPROCGPAD'

define view P_PrdtdDelivProcgDlyApplyData

as select from I_SalesDocumentItem as Item                                                         
                                                                   
inner join I_SalesDocument                     as SalesDocument     on  Item.SalesDocument = SalesDocument.SalesDocument

left outer to one join I_CalendarDate          as CalendarDate      on  Item.CreationDate = CalendarDate.CalendarDate                                                      

left outer to one join I_SDDocumentPartner     as HeaderShipToParty on  Item.SalesDocument = HeaderShipToParty.SDDocument
                                                                    and HeaderShipToParty.PartnerFunction = 'WE' 

left outer to one join I_SDDocumentItemPartner as ItemShipToParty   on  Item.SalesDocument = ItemShipToParty.SDDocument
                                                                    and Item.SalesDocumentItem = ItemShipToParty.SDDocumentItem
                                                                    and ItemShipToParty.PartnerFunction = 'WE'                                                            

{
  //Key

  key Item.SalesDocument,
  key Item.SalesDocumentItem,
  
  // Delivery Processing

  cast (0 as deliveryprocgdelay) as DelivProcgDelayInDays, //the apply data set needs the same data structure as the training data set

  
  //Category 

  Item.SDDocumentCategory, 
  Item.SalesDocumentItemCategory, 
  Item.SalesDocumentItemType, 
  Item.CompletionRule, 
  
  SalesDocument.SalesDocumentType, 
  SalesDocument.SalesDocumentProcessingType, 
    
  //Admin 

  Item.CreationDate as ItemCreationDate,  
  Item.CreationTime as ItemCreationTime,
  Item.LastChangeDate as ItemLastChangeDate,  
  
  SalesDocument.CreationDate, 
  SalesDocument.CreationTime, 
  SalesDocument.LastChangeDate, 
  SalesDocument.LastChangeDateTime, 
  
  cast (CalendarDate.CalendarYear as creation_date_year) as ItemCreationDateYear,
  cast (CalendarDate.CalendarMonth  as creation_date_month) as ItemCreationCalendarMonth,
  cast (CalendarDate.CalendarWeek  as creation_date_week) as ItemCreationCalendarWeek,
  
  //Organization 

  Item.Division,
  
  SalesDocument.SalesOrganization, 
  SalesDocument.DistributionChannel, 
  cast (SalesDocument.OrganizationDivision as organization_division) as OrganizationDivision, 
  SalesDocument.SalesGroup, 
  SalesDocument.SalesOffice, 
   
  //Product

  Item.Material, 
  Item.OriginallyRequestedMaterial, 
  Item.MaterialByCustomer, 
  Item.InternationalArticleNumber, 
  Item.Batch, 
  Item.ProductHierarchyNode, 
  Item.ProductCatalog, 
  Item.MaterialSubstitutionReason, 
  Item.MaterialGroup, 
  Item.AdditionalMaterialGroup1, 
  Item.AdditionalMaterialGroup2, 
  Item.AdditionalMaterialGroup3, 
  Item.AdditionalMaterialGroup4, 
  Item.AdditionalMaterialGroup5, 
  Item.ProductConfiguration, 
  Item.MRPArea, 
  Item.BillOfMaterial, 
  Item.ProdAvailabilityCheckGroup,  
  
  //Partner

  SalesDocument.SoldToParty,
  cast( coalesce(ItemShipToParty.Customer, HeaderShipToParty.Customer)as kunwe) as ShipToParty,
  
  //Sales 

  Item.SalesDocumentItemText,
  SalesDocument.RequestedDeliveryDate as RequestedDeliveryDate, //only in apply data set 

  Item.OrderQuantity, 
  Item.OrderQuantityUnit, 
  Item.ConfdDelivQtyInOrderQtyUnit, 
  Item.TargetDelivQtyInOrderQtyUnit, 
  Item.ConfdDeliveryQtyInBaseUnit, 
  Item.BaseUnit, 
  Item.RequestedQuantity, 
  Item.RequestedQuantityUnit, 
  Item.RequestedQuantityInBaseUnit, 
  Item.ItemGrossWeight, 
  Item.ItemNetWeight, 
  Item.ItemWeightUnit, 
  Item.ItemVolume, 
  Item.ItemVolumeUnit, 
  Item.SalesDistrict, 
  Item.SalesDeal, 
  cast (Item.SalesPromotion as sales_promotion) as  SalesPromotion, 
  cast (Item.RetailPromotion as retail_promotion) as  RetailPromotion, 
  Item.CustomerGroup, 
  Item.RequirementSegment, 
  Item.QuantityIsFixed,  
  
  SalesDocument.AdditionalCustomerGroup1, 
  SalesDocument.AdditionalCustomerGroup2, 
  SalesDocument.AdditionalCustomerGroup3, 
  SalesDocument.AdditionalCustomerGroup4, 
  SalesDocument.AdditionalCustomerGroup5, 
  SalesDocument.CreditControlArea, 
  SalesDocument.SalesDocumentDate,
  SalesDocument.SDDocumentReason, 
       
  //Pricing

  Item.NetAmount, 
  Item.TransactionCurrency, 
  Item.MaterialPricingGroup, 
  Item.NetPriceAmount, 
  Item.NetPriceQuantity, 
  Item.NetPriceQuantityUnit, 
  Item.Subtotal1Amount, 
  Item.Subtotal2Amount, 
  Item.Subtotal3Amount, 
  Item.Subtotal4Amount, 
  Item.Subtotal5Amount, 
  Item.Subtotal6Amount,  
  SalesDocument.TotalNetAmount,
   
  //Shipping

  Item.ShippingPoint, 
  Item.ShippingType, 
  Item.InventorySpecialStockType, 
  Item.DeliveryPriority, 
  Item.Plant, 
  Item.StorageLocation, 
  Item.Route, 
  Item.DeliveryGroup, 
  Item.DeliveryDateQuantityIsFixed, 
  Item.PartialDeliveryIsAllowed, 
  Item.MaxNmbrOfPartialDelivery, 
  Item.UnlimitedOverdeliveryIsAllowed, 
  Item.OverdelivTolrtdLmtRatioInPct, 
  Item.UnderdelivTolrtdLmtRatioInPct, 
  Item.MinDeliveryQtyInBaseUnit, 
  Item.OpenDeliveryLeadingUnitCode, 
  
  SalesDocument.ShippingCondition, 
  SalesDocument.CompleteDeliveryIsDefined, 
  
  //Fashion

  Item.ProductSeasonYear, 
  Item.ProductSeason, 
  Item.ProductCollection, 
  Item.ProductTheme, 
  Item.ProductCharacteristic1, 
  Item.ProductCharacteristic2, 
  Item.ProductCharacteristic3, 
  Item.ShippingGroupNumber, 
  Item.ShippingGroupRule,
  
  //Payment 

  Item.IncotermsClassification, 
  Item.IncotermsTransferLocation, 
  Item.IncotermsLocation1, 
  Item.IncotermsLocation2, 
  Item.CustomerPaymentTerms, 
  Item.PaymentMethod, 
    
  //Accounting

  Item.BusinessArea, 
  Item.ProfitCenter, 
  @VDM.lifecycle: { status: #DEPRECATED, successor: 'WBSElementInternalID' }
  Item.WBSElement, 
  @Analytics.internalName: #LOCAL
  Item.WBSElementInternalID, 
  Item.OrderID,
  Item.ProfitabilitySegment_2 as ProfitabilitySegment, 
  SalesDocument.CostCenter, 
  SalesDocument.ControllingArea, 
  
  //Reference

  Item.HigherLevelItem 
   
 }
       
 where ( Item.SDDocumentCategory = 'C' or      --> Order
         Item.SDDocumentCategory = 'I' )       --> Order w/o charge
  and  ( TotalDeliveryStatus = 'A' or
         TotalDeliveryStatus = 'B'  )  
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CALENDARDATE",
"I_SALESDOCUMENT",
"I_SALESDOCUMENTITEM",
"I_SDDOCUMENTITEMPARTNER",
"I_SDDOCUMENTPARTNER"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/