P_PrevWeekForCurrentWeek

DDL: P_PREVWEEKFORCURRENTWEEK SQL: PPREVWEEK Type: view CONSUMPTION

Previous Week Details for Current Week

P_PrevWeekForCurrentWeek is a Consumption CDS View that provides data about "Previous Week Details for Current Week" in SAP S/4HANA. It reads from 2 data sources (I_CalendarDate, I_CalendarDate) and exposes 2 fields with key field WeekNumber.

Data Sources (2)

SourceAliasJoin Type
I_CalendarDate CurrWeek from
I_CalendarDate LastWeek left_outer

Annotations (8)

NameValueLevelField
AbapCatalog.sqlViewName PPREVWEEK view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
EndUserText.label Previous Week Details for Current Week view
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.viewType #CONSUMPTION view
VDM.private true view
ClientHandling.algorithm #SESSION_VARIABLE view

Fields (2)

KeyFieldSource TableSource FieldDescription
KEY WeekNumber I_CalendarDate YearWeek Year and Calendar Week
PreviousWeekNumber

Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.

-- Derived SQL interpretation of CDS view P_PrevWeekForCurrentWeek.
-- Reconstructed from parsed metadata (data sources, associations, fields).
-- SAP annotations are omitted and the structure is reformulated as SQL;
-- this is a functional approximation, not the verbatim SAP source. Some join
-- conditions may be unavailable and a few CDS constructs are kept as-is.
-- SQL view name: PPREVWEEK

CREATE VIEW P_PrevWeekForCurrentWeek AS
SELECT
  CurrWeek.YearWeek AS WeekNumber,
  max(LastWeek.YearWeek) AS PreviousWeekNumber
FROM I_CalendarDate AS CurrWeek
LEFT OUTER JOIN I_CalendarDate AS LastWeek ON /* join condition not captured in parsed metadata */
;