P_LastDayOfFsclDteFunction

DDL: P_LASTDAYOFFSCLDTEFUNCTION SQL: PLSTDAYDTEFUNC Type: view BASIC

Last day of fiscal date function

P_LastDayOfFsclDteFunction is a Basic CDS View that provides data about "Last day of fiscal date function" in SAP S/4HANA. It reads from 2 data sources (I_Datefunction, I_FiscalDateFunctionValue) and exposes 2 fields with key fields DateFunctionendasDateFunction, FiscalYearVariant.

Data Sources (2)

SourceAliasJoin Type
I_Datefunction _DateFunction from
I_FiscalDateFunctionValue _fsclDateFunctionValue inner

Annotations (8)

NameValueLevelField
AbapCatalog.sqlViewName PLSTDAYDTEFUNC 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 #BASIC view
EndUserText.label Last day of fiscal date function view

Fields (2)

KeyFieldSource TableSource FieldDescription
KEY DateFunctionendasDateFunction
KEY FiscalYearVariant I_FiscalDateFunctionValue FiscalYearVariant
@AbapCatalog.sqlViewName: 'PLSTDAYDTEFUNC'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM.private:true
@VDM.viewType: #BASIC
@EndUserText.label: 'Last day of fiscal date function'
define view P_LastDayOfFsclDteFunction 
as select from I_Datefunction            as _DateFunction

    inner join            I_FiscalDateFunctionValue as _fsclDateFunctionValue on  _fsclDateFunctionValue.DateFunction             = _DateFunction.DateFunction
                                                                              and _fsclDateFunctionValue.DateFunctionValidityDate = $session.system_date                                                           
    left outer to one join P_LastDayOfTwoPeriodsAgoText as _LastDayOfTwoPeriodsAgoText on DomainValue = '01' 
                                                                                       and Language = $session.system_language                                                                        
{
  key case when _DateFunction.DateFunction = 'FIRSTDAYOFPREVIOUSFISCALPERIOD'
  then 'LASTDAYOF2PERIODSAGO'
  else _DateFunction.DateFunction end                                                            as DateFunction,
  
  key _fsclDateFunctionValue.FiscalYearVariant                                                   as FiscalYearVariant,

      case when _DateFunction.DateFunction = 'FIRSTDAYOFPREVIOUSFISCALPERIOD'
      then _LastDayOfTwoPeriodsAgoText.DateFunctionDescription
      else _DateFunctionText[1: Language = $session.system_language].DateFunctionDescription end as DateFunctionDescription,

      cast( case when _DateFunction.DateFunction = 'FIRSTDAYOFPREVIOUSFISCALPERIOD'
      then dats_add_days(_fsclDateFunctionValue.DateFunctionEndDate, -1,'NULL')
      else _fsclDateFunctionValue.DateFunctionEndDate end as datum)                            as DateFunctionEndDate
}
where
     _DateFunction.DateFunction = 'LASTDAYOFPREVIOUSFISCALPERIOD'
  or _DateFunction.DateFunction = 'LASTDAYOFCURRENTFISCALPERIOD'
  or _DateFunction.DateFunction = 'FIRSTDAYOFPREVIOUSFISCALPERIOD'
  or _DateFunction.DateFunction = 'LASTDAYOFNEXTFISCALPERIOD'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_DATEFUNCTION",
"I_DATEFUNCTIONTEXT",
"I_FISCALDATEFUNCTIONVALUE",
"P_LASTDAYOFTWOPERIODSAGOTEXT"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/