P_EBOC_OrderKeyStatusByPeriod

DDL: P_EBOC_ORDERKEYSTATUSBYPERIOD SQL: PEBOCORDKYSTSBP Type: view COMPOSITE

P_EBOC_OrderKeyStatusByPeriod is a Composite CDS View in SAP S/4HANA. It reads from 2 data sources (P_EBOC_MaxOrdKeyStatusByPeriod, I_StatusObjectStatusChange_2) and exposes 1 field with key field StatusCode.

Data Sources (2)

SourceAliasJoin Type
P_EBOC_MaxOrdKeyStatusByPeriod P_EBOC_MaxOrdKeyStatusByPeriod inner
I_StatusObjectStatusChange_2 StatusChange from

Parameters (4)

NameTypeDefault
P_StatusObject j_objnr
P_Ledger fins_ledger
P_CompanyCode fis_bukrs
P_ToFiscalYearPeriod fins_fyearperiod

Annotations (7)

NameValueLevelField
AbapCatalog.sqlViewName PEBOCORDKYSTSBP view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.viewType #COMPOSITE view
VDM.private true view

Fields (1)

KeyFieldSource TableSource FieldDescription
KEY StatusCode I_StatusObjectStatusChange_2 StatusCode
@AbapCatalog.sqlViewName: 'PEBOCORDKYSTSBP'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE

@VDM.viewType: #COMPOSITE
@VDM.private: true

define view P_EBOC_OrderKeyStatusByPeriod
  with parameters
    P_StatusObject       : j_objnr,
    P_Ledger             : fins_ledger,
    P_CompanyCode        : fis_bukrs,
    @Semantics.fiscal.yearPeriod: true
    P_ToFiscalYearPeriod : fins_fyearperiod
  as select from I_StatusObjectStatusChange_2                                                   as StatusChange
    inner join   P_EBOC_MaxOrdKeyStatusByPeriod( P_StatusObject       : :P_StatusObject,
                                                 P_Ledger             : :P_Ledger,
                                                 P_CompanyCode        : :P_CompanyCode,
                                                 P_ToFiscalYearPeriod : :P_ToFiscalYearPeriod ) as MaxOrderKeyStatus on  MaxOrderKeyStatus.StatusCode                  = StatusChange.StatusCode
                                                                                                                     and MaxOrderKeyStatus.MaxObjectStatusChangeNumber = StatusChange.StatusObjectStatusChangeNumber
{
  key StatusChange.StatusCode,

      cast(
        case StatusChange.StatusCode
          when 'I0042' then 1 // Partially Released

          when 'I0002' then 2 // Released

          when 'I0009' then 3 // Confirmed

          when 'I0012' then 4 // Delivered

          when 'I0045' then 5 // Technically Completed

          when 'I0046' then 6 // Closed

          when 'I0076' then 7 // Deletion Flag

          else 99
        end
      as fco_ord_key_stat_sort_sequence ) as SortSequence
}
where
      StatusChange.StatusObject     = :P_StatusObject
  and StatusChange.StatusIsInactive = '' // Exclude inactive statuses

/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_STATUSOBJECTSTATUSCHANGE_2",
"P_EBOC_MAXORDKEYSTATUSBYPERIOD"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/