P_ReqdProdAllocSalesSchedLine

DDL: P_REQDPRODALLOCSALESSCHEDLINE Type: view_entity COMPOSITE

Requested Product Allocation Sales Order Schedule Lines

P_ReqdProdAllocSalesSchedLine is a Composite CDS View that provides data about "Requested Product Allocation Sales Order Schedule Lines" in SAP S/4HANA. It reads from 2 data sources (P_AllocQtyAssgmtOrdItmValCombn, I_SalesDocumentScheduleLine) and exposes 7 fields with key fields ProdAllocAssignedOrder, ProdAllocAssignedOrderItem, CharcValueCombinationUUID, RequestedDeliveryDate, RequestedDeliveryTime.

Data Sources (2)

SourceAliasJoin Type
P_AllocQtyAssgmtOrdItmValCombn QA from
I_SalesDocumentScheduleLine SL inner

Annotations (7)

NameValueLevelField
EndUserText.label Requested Product Allocation Sales Order Schedule Lines view
VDM.private true view
VDM.viewType #COMPOSITE view
AccessControl.authorizationCheck #NOT_REQUIRED view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #TRANSACTIONAL view

Fields (7)

KeyFieldSource TableSource FieldDescription
KEY ProdAllocAssignedOrder I_SalesDocumentScheduleLine SalesDocument
KEY ProdAllocAssignedOrderItem I_SalesDocumentScheduleLine SalesDocumentItem
KEY CharcValueCombinationUUID P_AllocQtyAssgmtOrdItmValCombn CharcValueCombinationUUID
KEY RequestedDeliveryDate I_SalesDocumentScheduleLine RequestedDeliveryDate
KEY RequestedDeliveryTime I_SalesDocumentScheduleLine RequestedDeliveryTime
ScheduleLineOrderQuantity
OrderQuantityUnit I_SalesDocumentScheduleLine OrderQuantityUnit
@EndUserText.label: 'Requested Product Allocation Sales Order Schedule Lines'
@VDM.private: true
@VDM.viewType: #COMPOSITE
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #L
@ObjectModel.usageType.dataClass: #TRANSACTIONAL

define view entity P_ReqdProdAllocSalesSchedLine
  as select from P_AllocQtyAssgmtOrdItmValCombn as QA
    inner join I_SalesDocumentScheduleLine as SL
     on QA.ProdAllocAssignedOrder = SL.SalesDocument
     and QA.ProdAllocAssignedOrderItem = SL.SalesDocumentItem
     and QA.ProdAllocAssignedOrderType = '01'
{

      //Key

  key SL.SalesDocument as ProdAllocAssignedOrder,
  key SL.SalesDocumentItem as ProdAllocAssignedOrderItem,
  key QA.CharcValueCombinationUUID,
  key SL.RequestedDeliveryDate,
  key SL.RequestedDeliveryTime,
      //SL._SalesDocumentItem._SalesDocument._SoldToParty._StandardAddress.AddressTimeZone as AddressTimeZone,

      //SL._SalesDocumentItem._Plant._Address.AddressTimeZone as AddressTimeZone,

      dats_tims_to_tstmp(SL.RequestedDeliveryDate, SL.RequestedDeliveryTime,
                          SL._SalesDocument._SoldToParty._AddressDefaultRepresentation.AddressTimeZone,
                          $session.client , 'INITIAL') as ProdAllocReqdDelivUTCDateTime,
      @Semantics.quantity.unitOfMeasure: 'OrderQuantityUnit'
      sum(SL.ScheduleLineOrderQuantity)  as ScheduleLineOrderQuantity,
      //SL._SalesDocumentItem.BaseUnit as BaseUnit,

      SL.OrderQuantityUnit as OrderQuantityUnit /*, 
      min(SL.DeliveryDate) as RequestedDeliveryDate ,
      sum( case when SL.ConfdOrderQtyByMatlAvailCheck < SL.ScheduleLineOrderQuantity
        then 1
        else 0
        end )
       as NrOfNotFullyConfdSchedLines */
      
}
where SL.OrderQuantityUnit <> ''
  and SL.RequestedDeliveryDate <> '00000000'
  and SL.RequirementsClass <> ''
group by
  SL.SalesDocument,
  SL.SalesDocumentItem,
  QA.CharcValueCombinationUUID,
  SL.RequestedDeliveryDate,
  SL.RequestedDeliveryTime,
  SL._SalesDocument._SoldToParty._AddressDefaultRepresentation.AddressTimeZone,
  //SL._SalesDocumentItem._Plant._Address.AddressTimeZone,

  //SL._SalesDocumentItem.BaseUnit

  SL.OrderQuantityUnit
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CUSTOMER",
"I_ORGANIZATIONADDRESS",
"I_SALESDOCUMENT",
"I_SALESDOCUMENTSCHEDULELINE",
"P_ALLOCQTYASSGMTORDITMVALCOMBN"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/