P_AssldReltdSerialNumberBatch

DDL: P_ASSLDRELTDSERIALNUMBERBATCH SQL: PMPEASSRLTDSRNB Type: view COMPOSITE

P_AssldReltdSerialNumberBatch is a Composite CDS View in SAP S/4HANA. It reads from 2 data sources (I_OpActyComponentAssignment, P_MfgOrderCompAssyWthoutInstce) and exposes 22 fields with key fields Reservation, ReservationItem, RecordType, OpActyNtwkInstance, OpActyNtwkElement.

Data Sources (2)

SourceAliasJoin Type
I_OpActyComponentAssignment OpActyComponentAssignment from
P_MfgOrderCompAssyWthoutInstce RelatedCompAssyWthoutInstce inner

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName PMPEASSRLTDSRNB view
AbapCatalog.preserveKey true view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.serviceQuality #B view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
VDM.viewType #COMPOSITE view
VDM.private true view

Fields (22)

KeyFieldSource TableSource FieldDescription
KEY Reservation I_OpActyComponentAssignment Reservation
KEY ReservationItem I_OpActyComponentAssignment ReservationItem
KEY RecordType I_OpActyComponentAssignment RecordType
KEY OpActyNtwkInstance I_OpActyComponentAssignment OpActyNtwkInstance
KEY OpActyNtwkElement I_OpActyComponentAssignment OpActyNtwkElement
KEY AssemblyShopFloorItem P_MfgOrderCompAssyWthoutInstce AssemblyShopFloorItem
KEY ShopFloorItem P_MfgOrderCompAssyWthoutInstce ShopFloorItem
KEY Batch P_MfgOrderCompAssyWthoutInstce Batch
KEY Material P_MfgOrderCompAssyWthoutInstce Material
KEY Plant P_MfgOrderCompAssyWthoutInstce Plant
AssembledQuantity P_MfgOrderCompAssyWthoutInstce MaterialComponentQuantity
AlreadyDisassembledQuantity
MaterialBaseUnit P_MfgOrderCompAssyWthoutInstce MaterialBaseUnit
EntryUnit P_MfgOrderCompAssyWthoutInstce EntryUnit
_OpActyNtwkInstance I_OpActyComponentAssignment _OpActyNtwkInstance
_OperationActivityInstance I_OpActyComponentAssignment _OperationActivityInstance
_ReservationHeader I_OpActyComponentAssignment _ReservationHeader
_ShopFloorItem P_MfgOrderCompAssyWthoutInstce _ShopFloorItem
_ParentShopFloorItem P_MfgOrderCompAssyWthoutInstce _ParentShopFloorItem
_BatchDistinct P_MfgOrderCompAssyWthoutInstce _BatchDistinct
_Material P_MfgOrderCompAssyWthoutInstce _Material
_Plant P_MfgOrderCompAssyWthoutInstce _Plant
@AbapCatalog.sqlViewName: 'PMPEASSRLTDSRNB'
@AbapCatalog.preserveKey:true
@AbapCatalog.compiler.compareFilter:true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType: {serviceQuality: #B, sizeCategory: #XL, dataClass: #TRANSACTIONAL}
@VDM.viewType: #COMPOSITE
@VDM.private: true
define view P_AssldReltdSerialNumberBatch
  as select from           I_OpActyComponentAssignment    as OpActyComponentAssignment
  -- Join the assembled serial numbers of the related reservation
    inner join             P_MfgOrderCompAssyWthoutInstce as RelatedCompAssyWthoutInstce on  RelatedCompAssyWthoutInstce.Reservation        = OpActyComponentAssignment.RelatedReservation
                                                                                         and RelatedCompAssyWthoutInstce.ReservationItem    = OpActyComponentAssignment.RelatedReservationItem
                                                                                         and RelatedCompAssyWthoutInstce.RecordType         = OpActyComponentAssignment.RelatedRecordType
                                                                                         and RelatedCompAssyWthoutInstce.OpActyNtwkInstance = OpActyComponentAssignment.RelatedOpActyNtwkInstance
                                                                                         and RelatedCompAssyWthoutInstce.OpActyNtwkElement  = OpActyComponentAssignment.RelatedOpActyNtwkElement
  --Join the already assembled
    left outer to one join P_MfgOrderCompAssyWthoutInstce as OwnCompAssyWthoutInstce     on  OwnCompAssyWthoutInstce.Reservation           = OpActyComponentAssignment.Reservation
                                                                                         and OwnCompAssyWthoutInstce.ReservationItem       = OpActyComponentAssignment.ReservationItem
                                                                                         and OwnCompAssyWthoutInstce.RecordType            = OpActyComponentAssignment.RecordType
                                                                                         and OwnCompAssyWthoutInstce.OpActyNtwkInstance    = OpActyComponentAssignment.OpActyNtwkInstance
                                                                                         and OwnCompAssyWthoutInstce.OpActyNtwkElement     = OpActyComponentAssignment.OpActyNtwkElement
                                                                                         and OwnCompAssyWthoutInstce.AssemblyShopFloorItem = RelatedCompAssyWthoutInstce.AssemblyShopFloorItem
                                                                                         and OwnCompAssyWthoutInstce.ShopFloorItem         = RelatedCompAssyWthoutInstce.ShopFloorItem
                                                                                         and OwnCompAssyWthoutInstce.Batch                 = RelatedCompAssyWthoutInstce.Batch
                                                                                         and OwnCompAssyWthoutInstce.Material              = RelatedCompAssyWthoutInstce.Material
                                                                                         and OwnCompAssyWthoutInstce.Plant                 = RelatedCompAssyWthoutInstce.Plant
{
  key OpActyComponentAssignment.Reservation,
  key OpActyComponentAssignment.ReservationItem,
  key OpActyComponentAssignment.RecordType,
  key OpActyComponentAssignment.OpActyNtwkInstance,
  key OpActyComponentAssignment.OpActyNtwkElement,
  key RelatedCompAssyWthoutInstce.AssemblyShopFloorItem,
  key RelatedCompAssyWthoutInstce.ShopFloorItem,
  key RelatedCompAssyWthoutInstce.Batch,
  key RelatedCompAssyWthoutInstce.Material,
  key RelatedCompAssyWthoutInstce.Plant,
      @Semantics.quantity.unitOfMeasure: 'MaterialBaseUnit'
      RelatedCompAssyWthoutInstce.MaterialComponentQuantity                                         as AssembledQuantity,
      @Semantics.quantity.unitOfMeasure: 'MaterialBaseUnit'
      cast(coalesce(OwnCompAssyWthoutInstce.MaterialComponentQuantity, 0) as kmpmg preserving type) as AlreadyDisassembledQuantity,
      @Semantics.quantity.unitOfMeasure: 'MaterialBaseUnit'
      cast(RelatedCompAssyWthoutInstce.MaterialComponentQuantity - coalesce(OwnCompAssyWthoutInstce.MaterialComponentQuantity, 0)
           as kmpmg)                                                                                as MaterialComponentQuantity,
      RelatedCompAssyWthoutInstce.MaterialBaseUnit,
      @Semantics.quantity.unitOfMeasure: 'EntryUnit'
      cast(RelatedCompAssyWthoutInstce.QuantityInEntryUnit - coalesce(OwnCompAssyWthoutInstce.QuantityInEntryUnit, 0)
           as erfmgv)                                                                               as QuantityInEntryUnit,
      RelatedCompAssyWthoutInstce.EntryUnit,
      OpActyComponentAssignment._OpActyNtwkInstance,
      OpActyComponentAssignment._OperationActivityInstance,
      OpActyComponentAssignment._ReservationHeader,
      RelatedCompAssyWthoutInstce._ShopFloorItem,
      RelatedCompAssyWthoutInstce._ParentShopFloorItem,
      RelatedCompAssyWthoutInstce._BatchDistinct,
      RelatedCompAssyWthoutInstce._Material,
      RelatedCompAssyWthoutInstce._Plant
}
where
       OpActyComponentAssignment.RelatedReservation <> '0000000000'
  and(
       RelatedCompAssyWthoutInstce.ShopFloorItem    <> 0
    or RelatedCompAssyWthoutInstce.Batch            <> ''
  )