P_MlPrice_Period_By_Periodtype

DDL: P_MLPRICE_PERIOD_BY_PERIODTYPE SQL: PMLPRICEPERTYPE Type: view COMPOSITE

P_MlPrice_Period_By_Periodtype is a Composite CDS View in SAP S/4HANA. It reads from 3 data sources (marv, marv, marv).

Data Sources (3)

SourceAliasJoin Type
marv marv inner
marv marv inner
marv marv inner

Annotations (7)

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

define view P_MlPrice_Period_By_Periodtype
  // Current Period

  as select
    key          CostEstimate,
    key          ValuationArea,
    key          Material,
    key          'LF'                  as PeriodType,
    key          'LF'                  as FiscalPeriodType,
    key          CurrencyRole,
                 max(FiscalYearPeriod) as MLPriceLatestFiscalYearPeriod,
                 marv.lfgja            as FiscalYear,
                 concat('0', marv.lfmon) as FiscalPeriod,
                 CompanyCode,
                 MatlPrcMigratedUntilFsclYrPerd
  from         I_MLPricePersistedPeriod as mlper
    inner join marv on marv.bukrs = CompanyCode
  where
    FiscalYearPeriod <= concat(
      marv.lfgja, concat(
        '0', marv.lfmon
      )
    )
  group by
    CostEstimate,
    ValuationArea,
    Material,
    CurrencyRole,
    marv.lfgja,
    marv.lfmon,
    CompanyCode,
    MatlPrcMigratedUntilFsclYrPerd

  // Previous Period

  union all select
    key          CostEstimate,
    key          ValuationArea,
    key          Material,
    key          'VM'                  as PeriodType,
    key          'VM'                  as FiscalPeriodType,
    key          CurrencyRole,
                 max(FiscalYearPeriod) as MLPriceLatestFiscalYearPeriod,
                 marv.vmgja            as FiscalYear,
                 concat('0', marv.vmmon) as FiscalPeriod,       
                 CompanyCode,
                 MatlPrcMigratedUntilFsclYrPerd
  from         I_MLPricePersistedPeriod
    inner join marv on marv.bukrs = CompanyCode
  where
    FiscalYearPeriod <= concat(
      marv.vmgja, concat(
        '0', marv.vmmon
      )
    )
  group by
    CostEstimate,
    ValuationArea,
    Material,
    CurrencyRole,
    marv.vmgja,
    marv.vmmon,
    CompanyCode,
    MatlPrcMigratedUntilFsclYrPerd

  // Last Period of Previous Year

  union all select
    key          CostEstimate,
    key          ValuationArea,
    key          Material,
    key          'VJ'                  as PeriodType,
    key          'VJ'                  as FiscalPeriodType,
    key          CurrencyRole,
                 max(FiscalYearPeriod) as MLPriceLatestFiscalYearPeriod,
                 marv.vjgja            as FiscalYear,
                 concat('0', marv.vjmon) as FiscalPeriod,
                 CompanyCode,
                 MatlPrcMigratedUntilFsclYrPerd
  from         I_MLPricePersistedPeriod
    inner join marv on marv.bukrs = CompanyCode
  where
    FiscalYearPeriod <= concat(
      marv.vjgja, concat(
        '0', marv.vjmon
      )
    )
  group by
    CostEstimate,
    ValuationArea,
    Material,
    CurrencyRole,
    marv.vjgja,
    marv.vjmon,
    CompanyCode,
    MatlPrcMigratedUntilFsclYrPerd
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_MLPRICEPERSISTEDPERIOD",
"MARV"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/