I_SupDmndAllDocPOBsc

DDL: I_SUPDMNDALLDOCPOBSC Type: view BASIC

Basic View for Purchase Order

I_SupDmndAllDocPOBsc is a Basic CDS View that provides data about "Basic View for Purchase Order" in SAP S/4HANA. It reads from 6 data sources and exposes 30 fields.

Data Sources (6)

SourceAliasJoin Type
ekkn ekkn left_outer
ekko ekko from
ekpo ekpo inner
I_SupDmndMaterialPlant marc inner
I_SupDmndPurOrderSchedLine Sched inner
t16fb t16fb left_outer

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 ISUPDMNDADPOB 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 Purchase Order view

Fields (30)

KeyFieldSource TableSource FieldDescription
SupplyNumber
SupplyItem
SupplyScheduleLine
sobkzEthenEelseBendasAssignedSupplyType
SupAssgmtSource
SupplyDeliveryDate I_SupDmndPurOrderSchedLine ScheduleLineDeliveryDate
ProductAvailabilityDate I_SupDmndPurOrderSchedLine ScheduleLineDeliveryDate
RequestedDeliveryDate I_SupDmndPurOrderSchedLine ScheduleLineDeliveryDate
BaseUnit ekpo meins
MRPArea ekpo berid
Material ekpo matnr
MaterialGroup ekpo matkl
Plant ekpo werks
MaterialType I_SupDmndMaterialPlant MaterialType
StockSegment ekpo sgt_scat
CrossPlantConfigurableProduct I_SupDmndMaterialPlant CrossPlantConfigurableProduct
OrderType ekko bsart
PurchasingOrganization ekko ekorg
PurchasingGroup ekko ekgrp
Batch
StorageLocation ekpo lgort
Customer ekpo kunnr
Supplier ekko lifnr
CompanyCode ekpo bukrs
vbelnelseendasSalesOrder
vbelp000000else000000endasSalesOrderItem
PurgReleaseSequenceStatus ekko frgzu
NetPriceAmount ekpo netpr
DocumentCurrency ekko waers
GoodsReceiptDurationInDays ekpo webaz
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM: {
  viewType: #BASIC,
  lifecycle.contract.type: #PUBLIC_LOCAL_API
}
@AccessControl: {
  authorizationCheck: #NOT_REQUIRED,
  personalData.blocking: #('TRANSACTIONAL_DATA')
}
@AbapCatalog: {
  sqlViewName: 'ISUPDMNDADPOB',
  compiler.compareFilter: true
 }
@ObjectModel: {
   usageType: {
     dataClass:      #TRANSACTIONAL,
     serviceQuality: #X,
     sizeCategory:   #XXL
   }
}
@EndUserText.label: 'Basic View for Purchase Order'
define view I_SupDmndAllDocPOBsc
  as select from    ekko                       as ekko
    inner join      ekpo                       as ekpo  on  ekko.ebeln = ekpo.ebeln
    inner join      I_SupDmndPurOrderSchedLine as Sched on  ekpo.ebeln = Sched.PurchasingDocument
                                                        and ekpo.ebelp = Sched.PurchasingDocumentItem
    inner join      I_SupDmndMaterialPlant     as marc  on  ekpo.matnr = marc.Material
                                                        and ekpo.werks = marc.Plant
    left outer join ekkn                       as ekkn  on  ekpo.ebeln = ekkn.ebeln
                                                        and ekpo.ebelp = ekkn.ebelp
    left outer join t16fb                      as t16fb on ekko.frgke = t16fb.frgke
{
  cast(ekpo.ebeln as abap.char(12))                                             as SupplyNumber,
  cast(ekpo.ebelp as abap.char(5))                                              as SupplyItem,
  cast(Sched.ScheduleLine as abap.char(4))                                      as SupplyScheduleLine,
  case
    when ekpo.pstyp = '5'
    then 'T'
    when ekpo.sobkz = 'E'
    then 'E'
    else 'B'
  end                                                                           as AssignedSupplyType,
  'B'                                                                           as SupAssgmtSource,
  Sched.ScheduleLineDeliveryDate                                                as SupplyDeliveryDate,
  Sched.ScheduleLineDeliveryDate                                                as ProductAvailabilityDate,
  Sched.ScheduleLineDeliveryDate                                                as RequestedDeliveryDate,
  case
    when ekpo.umren != 0
    then OpenSupplyQuantity * div( ekpo.umrez , ekpo.umren )
    else OpenSupplyQuantity
  end                                                                           as TotalQuantity,
  case
    when ekpo.umren != 0
    then OpenSupplyQuantity * div( ekpo.umrez, ekpo.umren )
    else OpenSupplyQuantity
  end                                                                           as OpenSupplyQuantity,
  ekpo.meins                                                                    as BaseUnit,
  ekpo.berid                                                                    as MRPArea,
  ekpo.matnr                                                                    as Material,
  ekpo.matkl                                                                    as MaterialGroup,
  ekpo.werks                                                                    as Plant,
  marc.MaterialType,
  ekpo.sgt_scat                                                                 as StockSegment,
  marc.CrossPlantConfigurableProduct,
  ekko.bsart                                                                    as OrderType,
  ekko.ekorg                                                                    as PurchasingOrganization,
  ekko.ekgrp                                                                    as PurchasingGroup,
  cast('' as charg_d )                                                          as Batch,
  ekpo.lgort                                                                    as StorageLocation,
  ekpo.kunnr                                                                    as Customer,
  ekko.lifnr                                                                    as Supplier,
  ekpo.bukrs                                                                    as CompanyCode,
  case
  when ekpo.pstyp = '5' or ekpo.sobkz = 'E'
  then coalesce(ekkn.vbeln,'')
  else ''
  end                                                                           as SalesOrder,
  case
    when ekpo.pstyp = '5' or ekpo.sobkz = 'E'
    then coalesce(ekkn.vbelp,'000000')
    else '000000'
  end                                                                           as SalesOrderItem,
  ekko.frgzu                                                                    as PurgReleaseSequenceStatus,
  ekpo.netpr                                                                    as NetPriceAmount,
  ekko.waers                                                                    as DocumentCurrency,
  ekpo.webaz                                                                    as GoodsReceiptDurationInDays

}
where
           ekko.bstyp      =  'F' -- purchasing doc category  , F is PO
  and      ekko.memorytype =  ''  -- Category of Incompletess
  and(
           ekpo.knttp      =  ''  -- Account Assignment Category
    or(
           ekpo.knttp      <> ''
      and(
           ekpo.pstyp      =  '5' -- Third Party
        or ekpo.sobkz      =  'E' -- Orders on Hand
      )
    )
  )
  and      ekpo.loekz      =  ''  -- Deletion indicator
  and      ekpo.elikz      =  ''  -- Delivery Completion
  and      ekpo.eglkz      =  ''  -- Final Delivery
  and      ekpo.bstyp      =  'F' -- Purchase Order
  and(
           ekpo.pstyp      =  '0' -- Standard
    or     ekpo.pstyp      =  '2' -- Consignment
    or     ekpo.pstyp      =  '3' -- Subcontracting
    or     ekpo.pstyp      =  '5' -- Third Party
    or     ekpo.pstyp      =  '7' -- Stock Transfer
  )
  and      ekpo.retpo      =  ''  -- Returns Item
  //  and      ekpo.lblkz      =  ''  -- Subcontracting Supplier

  //---  In ATP unreleased POCONTR/PO is treated as supply - 3137980

 //and(

 //          ekko.frgrl      =  ''

 //   or(

 //          ekko.frgrl      =  'X'

 //    and  t16fb.kzfre     =  'X'

 //    )

 //) -- Subjected to Release

  and(
           ekpo.sobkz      =  ''  -- Special Stock
    or     ekpo.sobkz      =  'E' -- Orders on Hand
    or     ekpo.sobkz      =  'K' -- Supplier Consignment
  )
  and ekko.iseopblocked  = ''
  and(
  ekko.process_indicator is initial
  and
  ekpo.vcm_chain_category is initial
  )
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_SUPDMNDMATERIALPLANT",
"I_SUPDMNDPURORDERSCHEDLINE",
"EKKN",
"EKKO",
"EKPO",
"T16FB"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/