Skip to content

ADR 0034 special periods

Karthik P edited this page Nov 21, 2026 · 1 revision

ADR-0034: Special periods

A subdivision can add up to four zero-length special periods after its last period. They are numbered after the regular periods, start and end on the fiscal year's end_exclusive, never contain a date, and appear wherever an operation lists or names periods, but never in locate, shift or dimension.

Last reviewed: 21 Nov 2026

Status

Accepted on 21 Nov 2026 by the maintainer, proposed in issue #83. Planned for 0.3 (ADR-0031). Not built. The implementation is issue #89. The discussion is on issue #83, because the Design decisions category of Discussions does not exist yet.

Context

FR-009 on the PDR asks for "Zero-length special periods attached to the last period (SAP periods 13–16); never returned by locate." SAP's documentation says: "Special periods are used to subdivide the last posting period for closing operations." (SAP Learning, verified on the Analysis page). The "13–16" range is the PDR's. It has not been checked against SAP's own documentation, so the limit of four below is unverified.

Accounting systems post closing entries to these periods, so a definition used to label ledger data needs them to exist as periods. They cover no days: every date already belongs to a regular period. ADR-0007 allows an interval with start == end_exclusive.

Decision drivers

  • Labels and coordinates for special periods, so ledger data can be joined to them.
  • No change to any operation's result for a definition without special periods.
  • No silent choice where an operation has no clear answer (design rule 8).

Considered options

Option 1: Special periods as ordinary periods with zero length (chosen)

Pros:

  • They get coordinates (period, year, index), labels from the existing {pp} placeholder, and a parent quarter, with no new level.

Cons:

  • Operations that walk periods in order must say what they do with an empty one.

Option 2: A separate special level

Pros:

  • Operations on the period level stay unchanged.

Cons:

  • A new level for every operation, template and binding, and the ledger's period numbers 13 to 16 would no longer be period indexes.

Option 3: Leave them out; users add them outside fiscalclock

Pros:

  • Nothing to build.

Cons:

  • FR-009 stays unmet, and every user rebuilds the same numbering.

Decision

Option 1.

Shape

subdivision.special_periods is an integer from 1 to 4. It is allowed with calendar_months, week_pattern and anchored, at the top level and in a history entry. In a transition, and in a table subdivision, it is UNSUPPORTED_COMBINATION. Omitting it means none; that is not an organisation-specific choice, because a calendar without special periods has none.

Meaning

With n regular periods in a fiscal year and s special periods:

  • Special period j (1 ≤ j ≤ s) is the period with index n + j. Its start and end_exclusive are both the fiscal year's end_exclusive.
  • Its parent is the quarter that holds period n.
  • It is never returned by locate or explain, because it contains no date, and it adds no rows to dimension.
  • period("period", year, n + j) returns it. children of the year or of the last quarter at the period level lists it after period n.
  • format names it with the scheme's period template, so P{pp} gives P13 to P16 in a twelve-period year. parse finds it the same way.
  • shift counts regular periods only: shifting period n by 1 gives period 1 of the next fiscal year. Shifting a special period is INVALID_ARGUMENT at period, with a hint, because "one period after period 13" has more than one reasonable answer.

Consequences

Good:

  • SAP-style period numbers 13 to 16 exist and have labels, with no new level, placeholder or error code.
  • Definitions without special_periods are unchanged.

Bad:

  • children and period can return empty intervals, which a caller that divides by a period's length must handle.
  • The limit of four comes from the PDR, not from a verified SAP source.

What 0.3 must implement (issue #89): the shape and meaning above in both spec files, the widened description of INVALID_ARGUMENT, and vectors for every operation listed.

Links

Clone this wiki locally