P_CoEvtBsdOrderMaxKeyStatus

DDL: P_COEVTBSDORDERMAXKEYSTATUS SQL: PCOEBOMKST Type: view COMPOSITE Package: ODATA_CO_RT_PRODUCTION_COSTS

Event Based Order Key Max Status

P_CoEvtBsdOrderMaxKeyStatus is a Composite CDS View that provides data about "Event Based Order Key Max Status" in SAP S/4HANA. It reads from 1 data source (I_StatusObjectStatusBasic) and exposes 2 fields with key field ControllingObject. Part of development package ODATA_CO_RT_PRODUCTION_COSTS.

Data Sources (1)

SourceAliasJoin Type
I_StatusObjectStatusBasic I_StatusObjectStatusBasic from

Annotations (11)

NameValueLevelField
AbapCatalog.sqlViewName PCOEBOMKST view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.representativeKey ControllingObject view
ObjectModel.usageType.dataClass #MASTER view
ObjectModel.usageType.serviceQuality #B view
ObjectModel.usageType.sizeCategory #L view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.viewType #COMPOSITE view
VDM.private true view

Fields (2)

KeyFieldSource TableSource FieldDescription
KEY ControllingObject StatusObject
StatusCode
@AbapCatalog.sqlViewName: 'PCOEBOMKST'
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.representativeKey: 'ControllingObject'
@ObjectModel.usageType.dataClass: #MASTER
@ObjectModel.usageType.serviceQuality: #B
@ObjectModel.usageType.sizeCategory: #L

@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.viewType: #COMPOSITE
@VDM.private: true

define view P_CoEvtBsdOrderMaxKeyStatus
  as select from I_StatusObjectStatusBasic
{
  key StatusObject    as ControllingObject,

      case substring(StatusObject, 1, 2)
        when 'OR'
            then substring(StatusObject, 3, 12)
        when 'OP'
            then substring(StatusObject, 3, 12)
        else ''
      end             as OrderID,

      case substring(StatusObject, 1, 2)
        when 'OR'
            then '0000'
        when 'OP'
            then substring(StatusObject, 15, 4)
        else ''
      end             as OrderItem,

      max(StatusCode) as StatusCode
}
where
  (
       StatusCode       = 'I0002' //Released

    or StatusCode       = 'I0009' //Confirmed

    or StatusCode       = 'I0012' //Delivered

    or StatusCode       = 'I0042' //Partially Released

    or StatusCode       = 'I0045' //Technicaly  Completed

    or StatusCode       = 'I0046' //Closed

    or StatusCode       = 'I0076' //Deletion Flag

  )
  and  StatusIsInactive = ''
group by
  StatusObject