Introduction
If you've ever hardcoded a date in a SELECT statement or asked a user to manually key in a date range every time they run a report, you'll appreciate what Date Functions bring to the table.
Date Functions in SAP S/4HANA Public Cloud and the SAP BTP ABAP Environment (Steampunk) let you define dynamic, human-readable date definitions — think FirstDayOfCurrentMonth or LastDayOfCurrentYear or CURRENT_QUARTER or Next30DaysFromToday orTOMORROW, CURRENT_QUARTER, or LAST_FISCAL_YEAR — that automatically resolve to the correct calendar values at runtime. No hardcoding. No manual input. Just clean, reusable date logic that works across analytical queries, ABAP code, and CDS views.
In this post, I'll walk through what Date Functions are, who uses them, and how developers and key users can leverage them across the stack.
What Are Date Functions?
A Date Function is a named, dynamic date or date range definition. Instead of storing a fixed date, you define a rule — and the system calculates the actual value at runtime based on the current system date.
Supported Combinations
SAP supports three types of Date Function definitions:
- Single Date — A dynamic single-date definition. For example, a Date Function defined as
TOMORROWwill always return the date for tomorrow. If today is 21st May 2026, the function returns 22nd May 2026 — automatically, every time. - Relative to Base Date Range — A date range defined with an offset (days, weeks, months, quarters, or years) relative to a single dynamic base date.
- Configured Range — A date range with both a dynamic start date and a dynamic end date, giving full flexibility for complex time window definitions.
SAP has delivered more than 40 predefined Date Functions out of the box, and the Manage Date Functions app has been available to key users since 2017.
The Three Personas — Who Uses Date Functions and How
Date Functions are designed to serve three distinct personas, each interacting with them differently.
1. Key User — Define and Manage
The Key User is the starting point. Using the Manage Date Functions application, key users can:
- Browse and explore SAP's 40+ predefined Date Functions
- Create custom Date Functions tailored to their business calendar or reporting needs
- Simulate the dynamic values a Date Function will return, before it goes live
- Transport Date Functions from development through to quality and production systems
This is a no-code capability — no developer involvement needed to define or adjust Date Functions. It puts time-intelligence directly in the hands of functional consultants and power users.
2. Developer — Use in CDS Views
The Developer persona integrates Date Functions directly into CDS view source code.
A developer can declare a Date Function parameter in a CDS view with a default value. This makes the CDS view inherently time-aware — the date range it operates on is no longer hardcoded but driven by a named, maintainable definition.
Key users can then further customise Date Function parameters through apps like Custom Analytical Queries, without touching the underlying code.
Coming soon: SAP is also working on enabling developers to define Date Functions directly within ABAP Development Tools (ADT) — using the same development environment as CDS views, with a form-based UI and simulate/test capabilities built in. This is currently in progress (WIP) and subject to change, but it will further unify the developer experience.
3. Business User — Consume in Analytical Reports
The Business User benefits from Date Functions through Analytical Reporting tools built on Date-Function-enabled CDS views.
Instead of entering raw date values, users:
- Select from a value help showing all available Date Functions with their human-readable names
- Easily toggle between different Date Functions to shift the analysis window — for example, switching from
CURRENT_MONTHtoPREVIOUS_MONTHwith a single selection - Get results that are always current and accurate, because the date range resolves at query execution time
This dramatically simplifies the reporting experience and reduces the chance of user error when specifying time periods.
4. ABAP Developer — Consume via API
For developers who need to use dynamic date logic in ABAP programs, reports, or classes, Date Functions are accessible via a C1-released CDS view API.
This API returns the resolved dynamic date or date range for a given Date Function — which the developer can then use directly in SELECT statements or any time-based processing logic.
" Example: Use the Date Function API to resolve a dynamic date range
" and filter records within that time frame
SELECT * FROM your_cds_view
WHERE posting_date BETWEEN @LV_start_date AND @LV_end_date.
The value help integration also works in ABAP contexts, making it easy to discover and reference available Date Functions programmatically.
Coming soon: SAP is also working on enabling developers to define Date Functions directly within ABAP Development Tools (ADT) — using the same development environment as CDS views, with a form-based UI and simulate/test capabilities built in. This is currently in progress (WIP) and subject to change, but it will further unify the developer experience.
Why This Matters for Steampunk / BTP ABAP Cloud Environment
If you're building on the SAP BTP ABAP Environment (Steampunk), Date Functions are particularly valuable because:
- They align with the clean core philosophy — time logic lives in a maintainable, transportable definition rather than scattered across code
- They support extensibility without modification — key users can evolve date definitions independently of developer cycles
- The CDS parameter approach keeps analytical views flexible and reusable across multiple time horizons
- The upcoming ADT integration will make Date Functions a first-class citizen of the developer toolchain, consistent with how other CDS artefacts are managed
Summary
| Key User | Manage Date Functions app | Define, simulate, and transport Date Functions |
| Developer | CDS Views | Declare Date Function parameters with defaults |
| Business User | Analytical Reports | Select Date Functions via value help at runtime |
| ABAP Developer | ABAP Development Tool Kit (ADT) | Resolve dynamic dates for use in ABAP logic (WIP) |
Coming soon: SAP is also working on enabling developers to define Date Functions directly within ABAP Development Tools (ADT) — using the same development environment as CDS views, with a form-based UI and simulate/test capabilities built in. This is currently in progress (WIP) and subject to change, but it will further unify the developer experience.
ABAP Developer Define and Consume Custom Date Function in ADT (Development User)
High-Impact Use Cases
- Dynamic Financial Period Reporting: Instead of hard-coding dates, developers can use the PREVIOUSMONTH or Fiscal Year conversion reuse functions. This allows an analytical dashboard to automatically adjust its data range based on the system's current date without any code changes.
- SLA and Deadline Tracking: Partners can leverage standardized functions like DATN_DAYS_BETWEEN or utcl_add_seconds to calculate service level agreement (SLA) breaches or invoice due dates in real-time. This ensures that “Time to Resolve” calculations are identical whether they run on-stack in S/4HANA or side-by-side on BTP.
- Time-Zone Aware Global Operations: For apps serving users in different regions, reuse components like abap_system_timezone or utcl_to_local automatically handle daylight savings and regional conversions. This is critical for logistics or workforce management apps where a “Requested Delivery Date” must be accurately localized for warehouses worldwide.
Key Benefits of Adoption
- Zero-Downtime Upgrades: Because these components are “Released APIs” (C1 contract), they are guaranteed to remain stable during automated SAP cloud upgrades.
- Performance Optimization: Date Functions is significantly faster than fetching data into the application layer for manual date math.
- Reduced Development Maintenance: By using Date Functions partners offload the maintenance.
👉 Please let us know if you have any busines case / functional usecase in which you would like to use the Custom Date Function in ABAP Development Tool Kit (ADT)
👉 Drop your experience or questions in the comments — always happy to discuss!
👉Have you used Date Functions in your projects? Drop your experience or questions in the comments — always happy to discuss!



