I_SupDmndAllDocProdnOrdBsc

DDL: I_SUPDMNDALLDOCPRODNORDBSC Type: view BASIC Package: VDM_ARUN_ANALYTICS_ALL

Basic View for Production Order

I_SupDmndAllDocProdnOrdBsc is a Basic CDS View that provides data about "Basic View for Production Order" in SAP S/4HANA. It reads from 3 data sources (afpo, aufk, I_SupDmndMaterialPlant) and exposes 23 fields. Part of development package VDM_ARUN_ANALYTICS_ALL.

Data Sources (3)

SourceAliasJoin Type
afpo afpo inner
aufk aufk from
I_SupDmndMaterialPlant marc inner

Annotations (10)

NameValueLevelField
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.viewType #BASIC view
VDM.lifecycle.contract.type #PUBLIC_LOCAL_API view
AccessControl.authorizationCheck #NOT_REQUIRED view
AbapCatalog.sqlViewName ISUPDMNDADPRODB view
AbapCatalog.compiler.compareFilter true view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.serviceQuality #X view
ObjectModel.usageType.sizeCategory #XXL view
EndUserText.label Basic View for Production Order view

Fields (23)

KeyFieldSource TableSource FieldDescription
SupplyNumber afpo aufnr
SupplyItem
SupplyScheduleLine
SupAssgmtSource
SupplyDeliveryDate afpo dgltp
MRPArea afpo berid
ProductAvailabilityDate afpo dgltp
RequestedDeliveryDate afpo dgltp
TotalQuantity afpo psmng
OpenSupplyQuantity
BaseUnit afpo meins
Material afpo matnr
MaterialGroup I_SupDmndMaterialPlant MaterialGroup
Plant afpo pwerk
MaterialType I_SupDmndMaterialPlant MaterialType
StockSegment afpo sgt_scat
CrossPlantConfigurableProduct I_SupDmndMaterialPlant CrossPlantConfigurableProduct
OrderType aufk auart
Batch
StorageLocation afpo lgort
kdaufelseendasSalesOrder
kdpos000000else000000endasSalesOrderItem
GoodsReceiptDurationInDays afpo webaz
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM: {
  viewType: #BASIC,
  lifecycle.contract.type: #PUBLIC_LOCAL_API
}
@AccessControl: {
  authorizationCheck: #NOT_REQUIRED,
  personalData.blocking: #('TRANSACTIONAL_DATA')
}
@AbapCatalog: {
  sqlViewName: 'ISUPDMNDADPRODB',
  compiler.compareFilter: true
 }
@ObjectModel: {
   usageType: {
     dataClass:      #TRANSACTIONAL,
     serviceQuality: #X,
     sizeCategory:   #XXL
   }
}
@EndUserText.label: 'Basic View for Production Order'
define view I_SupDmndAllDocProdnOrdBsc
  as select from aufk                   as aufk
    inner join   afpo                   as afpo on  aufk.aufnr = afpo.aufnr
    inner join   I_SupDmndMaterialPlant as marc on  afpo.matnr = marc.Material
                                                and afpo.pwerk = marc.Plant
{
  afpo.aufnr                                            as SupplyNumber,
  cast(afpo.posnr as abap.char(5))                      as SupplyItem,
  cast('0000' as abap.char(4))                          as SupplyScheduleLine,
  case
    when afpo.sobkz = 'E'
    then 'M'  -- Make To Order
    else 'F'  -- Production Order
  end                                                   as AssignedSupplyType,
  'F'                                                   as SupAssgmtSource,
  afpo.dgltp                                            as SupplyDeliveryDate,
  afpo.berid                                            as MRPArea,
  afpo.dgltp                                            as ProductAvailabilityDate,
  afpo.dgltp                                            as RequestedDeliveryDate,
  afpo.psmng                                            as TotalQuantity,
  ( afpo.psmng - afpo.wemng - afpo.iamng - afpo.psamg ) as OpenSupplyQuantity,
  afpo.meins                                            as BaseUnit,
  afpo.matnr                                            as Material,
  marc.MaterialGroup                                    as MaterialGroup,
  afpo.pwerk                                            as Plant,
  marc.MaterialType,
  afpo.sgt_scat                                         as StockSegment,
  marc.CrossPlantConfigurableProduct,
  aufk.auart                                            as OrderType,
  cast('' as charg_d )                                  as Batch,
  afpo.lgort                                            as StorageLocation,
  case when afpo.sobkz = 'E'
    then coalesce( afpo.kdauf, '' )
    else ''
  end                                                   as SalesOrder,
  case when afpo.sobkz = 'E'
    then coalesce( afpo.kdpos, '000000' )
    else '000000'
  end                                                   as SalesOrderItem,
  afpo.webaz                                            as GoodsReceiptDurationInDays
}
where

  (    -- Order Category
       afpo.dauty = '40' -- Process Order
    or afpo.dauty = '30' -- Maintenance order
    or afpo.dauty = '20' -- Network
    or afpo.dauty = '10' -- PP Production Order
  )
  and  afpo.elikz = ''   -- Delivery Completion
  and  afpo.dnrel = ''   -- Order Item is not Relevant for MRP
  and  afpo.wepos = 'X'  -- Goods receipt
  and  afpo.arsnr = '0000000000' // direct procurement (see FORM afpo_check)