P_RblsItmForKeyDteRepPeriod

DDL: P_RBLSITMFORKEYDTEREPPERIOD SQL: PRBLSKDATPERIO Type: view COMPOSITE Package: FINS_FIS_APAR_APPS

reporting period

P_RblsItmForKeyDteRepPeriod is a Composite CDS View that provides data about "reporting period" in SAP S/4HANA. It reads from 1 data source (I_FiscCalendarDateForCompCode) and exposes 4 fields with key fields CalendarDate, CompanyCode. It has 1 association to related views. Part of development package FINS_FIS_APAR_APPS.

Data Sources (1)

SourceAliasJoin Type
I_FiscCalendarDateForCompCode FiscalPeriod from

Parameters (2)

NameTypeDefault
P_KeyDate bzdat
P_PeriodType fis_period_type

Associations (1)

CardinalityTargetAliasCondition
[0..1] I_CalendarDate _CalendarDate _CalendarDate.CalendarDate = $projection.CalendarDate

Annotations (7)

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

Fields (4)

KeyFieldSource TableSource FieldDescription
KEY CalendarDate I_FiscCalendarDateForCompCode CalendarDate
KEY CompanyCode I_FiscCalendarDateForCompCode CompanyCode
CalendarYearendasReportingYear
CalendarWeekendasReportingPeriod
@AbapCatalog.sqlViewName: 'PRBLSKDATPERIO'
@AbapCatalog.preserveKey:true
@AbapCatalog.compiler.compareFilter:true
@VDM.viewType: #COMPOSITE
@VDM.private:true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE

define view P_RblsItmForKeyDteRepPeriod
  with parameters
    P_KeyDate    : bzdat,
    P_PeriodType : fis_period_type

  as select from I_FiscCalendarDateForCompCode as FiscalPeriod

  association [0..1] to I_CalendarDate as _CalendarDate on _CalendarDate.CalendarDate = $projection.CalendarDate

{
  key FiscalPeriod.CalendarDate,
  key FiscalPeriod.CompanyCode,

      case $parameters.P_PeriodType
           when 'F' then FiscalPeriod.FiscalYear
           when 'M' then _CalendarDate.CalendarYear
           when 'W' then _CalendarDate.CalendarYear
      end as ReportingYear,

      case $parameters.P_PeriodType
           when 'F' then FiscalPeriod.FiscalPeriod
           when 'M' then cast(_CalendarDate.CalendarMonth as char3)
           when 'W' then _CalendarDate.CalendarWeek
      end as ReportingPeriod,

      case $parameters.P_PeriodType
           when 'F' then FiscalPeriod.FiscalPeriodStartDate
           when 'M' then _CalendarDate.FirstDayOfMonthDate
           when 'W' then _CalendarDate.FirstDayOfWeekDate
      end as ReportingPeriodStartDate,

      case $parameters.P_PeriodType
           when 'F' then FiscalPeriod.FiscalPeriodEndDate
           when 'M' then dats_add_days(dats_add_months(_CalendarDate.FirstDayOfMonthDate, 1, 'UNCHANGED'), -1, 'UNCHANGED')
           when 'W' then dats_add_days(_CalendarDate.FirstDayOfWeekDate, 7, 'UNCHANGED')
      end as ReportingPeriodEndDate
}
where
  CalendarDate = $parameters.P_KeyDate