P_ProdAllocSalesSchedLine

DDL: P_PRODALLOCSALESSCHEDLINE SQL: PALSLSORDSCHEDL Type: view CONSUMPTION

Product Allocation Sales Order Schedule Lines

P_ProdAllocSalesSchedLine is a Consumption CDS View that provides data about "Product Allocation Sales Order Schedule Lines" in SAP S/4HANA. It reads from 2 data sources (P_ProdAllocQtyAssgmtOrderItem, I_SalesDocumentScheduleLine) and exposes 11 fields with key fields SalesDocument, SalesDocumentItem.

Data Sources (2)

SourceAliasJoin Type
P_ProdAllocQtyAssgmtOrderItem QA from
I_SalesDocumentScheduleLine SL inner

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName PALSLSORDSCHEDL view
EndUserText.label Product Allocation Sales Order Schedule Lines view
VDM.private true view
VDM.viewType #CONSUMPTION view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #TRANSACTIONAL view

Fields (11)

KeyFieldSource TableSource FieldDescription
KEY SalesDocument I_SalesDocumentScheduleLine SalesDocument
KEY SalesDocumentItem I_SalesDocumentScheduleLine SalesDocumentItem
ScheduleLineOrderQuantity
OrderQuantityUnit I_SalesDocumentScheduleLine OrderQuantityUnit
CorrectedQtyInOrderQtyUnit
DeliveredQtyInOrderQtyUnit
CumltvDlvrdBaseUnitOfMeasure CDQ CumltvDlvrdBaseUnitOfMeasure
CumulativeDeliveredQty CDQ CumulativeDeliveredQty
ConfdOrderQtyByMatlAvailCheck
RequestedDeliveryDate
ProductAllocationPeriodEndDate
@AbapCatalog.sqlViewName: 'PALSLSORDSCHEDL'
@EndUserText.label: 'Product Allocation Sales Order Schedule Lines'
@VDM.private: true
@VDM.viewType: #CONSUMPTION
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #L
@ObjectModel.usageType.dataClass: #TRANSACTIONAL

define view P_ProdAllocSalesSchedLine
  as select from P_ProdAllocQtyAssgmtOrderItem as QA
    inner join I_SalesDocumentScheduleLine as SL
     on QA.ProdAllocAssignedOrder = SL.SalesDocument
     and QA.ProdAllocAssignedOrderItem = SL.SalesDocumentItem
     and QA.ProdAllocAssignedOrderType = '01'
    left outer to one join P_ProdAllocItmCumltvDlvrdQts as CDQ
     on QA.ProdAllocAssignedOrder = CDQ.DocumentNumber
     and QA.ProdAllocAssignedOrderItem = CDQ.ItemNumber
  /*association[0..1]to P_ProdAllocSalesStatus as _ProdAllocSalesStatus on $projection.SalesDocument = _ProdAllocSalesStatus.SalesDocument
  and $projection.SalesDocumentItem = _ProdAllocSalesStatus.SalesDocumentItem*/
{

      //Key

  key SL.SalesDocument,
  key SL.SalesDocumentItem,
      //    key ProdAllocSchedLineType,

      sum(SL.ScheduleLineOrderQuantity)  as ScheduleLineOrderQuantity,
      SL.OrderQuantityUnit,
      sum(SL.CorrectedQtyInOrderQtyUnit) as CorrectedQtyInOrderQtyUnit,
      sum(SL.DeliveredQtyInOrderQtyUnit) as DeliveredQtyInOrderQtyUnit,
      CDQ.CumltvDlvrdBaseUnitOfMeasure as CumltvDlvrdBaseUnitOfMeasure,
      CDQ.CumulativeDeliveredQty as CumulativeDeliveredQty,
      sum(SL.ConfdOrderQtyByMatlAvailCheck) as ConfdOrderQtyByMatlAvailCheck,
      min(SL.DeliveryDate) as RequestedDeliveryDate,
      max(SL.DeliveryDate) as ProductAllocationPeriodEndDate,
      //coalesce( _ProdAllocSalesStatus.NrOfNotFullyConfdSchedLines, 0 )

      sum( case when SL.ConfdOrderQtyByMatlAvailCheck < SL.ScheduleLineOrderQuantity
        then 1
        else 0
        end )
       as NrOfNotFullyConfdSchedLines
      
}
where SL.OrderQuantityUnit <> ''
  and SL.RequirementsClass <> ''
group by
  SL.SalesDocument,
  SL.SalesDocumentItem,
  SL.OrderQuantityUnit,
  CDQ.CumulativeDeliveredQty,
  CDQ.CumltvDlvrdBaseUnitOfMeasure //,

  //_ProdAllocSalesStatus.NrOfNotFullyConfdSchedLines

/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_SALESDOCUMENTSCHEDULELINE",
"P_PRODALLOCITMCUMLTVDLVRDQTS",
"P_PRODALLOCQTYASSGMTORDERITEM"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/