P_CCLDGRSHIFTEDPREVYEARPER

CDS View

P_CCLDGRSHIFTEDPREVYEARPER is a CDS View in S/4HANA. It contains 9 fields. 1 CDS views read from this table.

CDS Views using this table (1)

ViewTypeJoinVDMDescription
P_MatVal_By_Period_Types view inner BASIC

Fields (9)

KeyField CDS FieldsUsed in Views
KEY CurrentFiscalPeriod FiscalPeriod 1
KEY CurrentFiscalYear FiscalYear 1
KEY PrevFiscalYearLastFiscalPeriod FiscalPeriod 1
KEY PreviousFiscalPeriod FiscalPeriod 1
KEY PreviousFiscalPeriodFiscalYear FiscalYear 1
KEY PreviousFiscalYear FiscalYear 1
CurrentFiscalYearPeriod FiscalYearPer 1
PrevFsclYearLastFsclYearPeriod FiscalYearPer 1
PreviousFiscalYearPeriod FiscalYearPer 1
@AbapCatalog.sqlViewName: 'PCCLDRSHIFTPYPER'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM.private: true
@VDM.viewType: #BASIC

// I_MatlCtrlRecdLdgrFiscalPeriod provides "true" last period of previous year (counting back to last year)

// This view simply shifts the period according to periv of the ledger in order to

// match with FMLT_PRICE records 

define view P_CCLdgrShiftedPrevYearPer
  as select from I_CoCodeLdngLdgrPeriodDates  as ccllpd
  
     inner join I_LedgerCompanyCodeCrcyRoles  as ldcmp on ldcmp.CompanyCode = ccllpd.CompanyCode
     inner join I_FiscalPeriodForVariant      as vmfp  on  vmfp.FiscalYearVariant     = ldcmp.FiscalYearVariant
                                                       and vmfp.FiscalPeriodStartDate = ccllpd.PreviousFiscalPeriodStartDate
                                                       and vmfp.FiscalPeriodEndDate   = ccllpd.PreviousFiscalPeriodEndDate
                                                       and vmfp.IsSpecialPeriod       = ' '
     inner join I_FiscalPeriodForVariant      as vjfp  on  vjfp.FiscalYearVariant     = ldcmp.FiscalYearVariant
                                                       and vjfp.FiscalPeriodStartDate = ccllpd.PrevFsclYrLastFsclPerdStrtDate
                                                       and vjfp.FiscalPeriodEndDate   = ccllpd.PrevFsclYrLastFsclPerdEndDate
                                                       and vjfp.IsSpecialPeriod       = ' '
  
{
  key ccllpd.CompanyCode          as CompanyCode,
  key ldcmp.Ledger                as Ledger,

      vmfp.FiscalPeriod           as PreviousFiscalPeriod,
      vmfp.FiscalYear             as PreviousFiscalPeriodFiscalYear,
      vmfp.FiscalYearPeriod       as PreviousFiscalYearPeriod,
      vmfp.FiscalPeriodStartDate  as PreviousFiscalPeriodStartDate,
      vmfp.FiscalPeriodEndDate    as PreviousFiscalPeriodEndDate,
      
      vjfp.FiscalPeriod           as PrevFiscalYearLastFiscalPeriod,
      vjfp.FiscalYear             as PreviousFiscalYear,
      vjfp.FiscalYearPeriod       as PrevFsclYearLastFsclYearPeriod,
      vjfp.FiscalPeriodStartDate  as PrevFsclYrLastFsclPerdStrtDate,
      vjfp.FiscalPeriodEndDate    as PrevFsclYrLastFsclPerdEndDate
  
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_COCODELDNGLDGRPERIODDATES",
"I_FISCALPERIODFORVARIANT",
"I_LEDGERCOMPANYCODECRCYROLES"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/