P_SalesInsightDuration

DDL: P_SALESINSIGHTDURATION SQL: PSLSINDURATION Type: view COMPOSITE Package: VDM_SD_SP

Sales Insight Period

P_SalesInsightDuration is a Composite CDS View that provides data about "Sales Insight Period" in SAP S/4HANA. It reads from 1 data source (I_CalendarDate) and exposes 7 fields with key field CurrentDate. Part of development package VDM_SD_SP.

Data Sources (1)

SourceAliasJoin Type
I_CalendarDate I_CalendarDate from

Annotations (5)

NameValueLevelField
AbapCatalog.sqlViewName PSLSINDURATION view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #CHECK view
VDM.private true view
VDM.viewType #COMPOSITE view

Fields (7)

KeyFieldSource TableSource FieldDescription
KEY CurrentDate CalendarDate
CurrentYearMonth YearMonth
StartDateYearMonth
ValidityStartYearMonth
ValidityEndYearMonth
YoYStartYearMonth
YoYEndYearMonth
@AbapCatalog.sqlViewName: 'PSLSINDURATION'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@VDM.private: true
@VDM.viewType: #COMPOSITE

define view P_SalesInsightDuration as select from I_CalendarDate  {
    
    key CalendarDate as CurrentDate,
    
//    CalendarYear as CurrentYear,

//    YearQuarter as CurrentYearQuarter,

    @Semantics.calendar.yearMonth: true
    YearMonth as CurrentYearMonth,
//    @Semantics.calendar.yearMonth: true

//    left(dats_add_months(CalendarDate, -1,'FAIL'), 6)  as LastYearMonth, 

    @Semantics.calendar.yearMonth: true
    left(dats_add_months(CalendarDate, -5,'FAIL'), 6) as StartDateYearMonth,   

    @Semantics.calendar.yearMonth: true
    cast( left(dats_add_months(CalendarDate, -12,'FAIL'), 6)  as vdm_yearmonth ) as ValidityStartYearMonth,
    @Semantics.calendar.yearMonth: true
    cast( left(dats_add_months(CalendarDate, 1,'FAIL'), 6)  as vdm_yearmonth )  as ValidityEndYearMonth,

    // For year over year data

    @Semantics.calendar.yearMonth: true
    left(dats_add_months(CalendarDate, -24,'FAIL'), 6) as YoYStartYearMonth,
    @Semantics.calendar.yearMonth: true
    left(dats_add_months(CalendarDate, -11,'FAIL'), 6) as YoYEndYearMonth    
}
where CalendarDate = $session.system_date