SAP Time Slicing
Filter SAP data by date ranges to control data volume and create focused test datasets.
Overview
Time slicing allows you to extract a subset of SAP data based on date fields:
-
Master Data - Filtered by creation date (ERSDA)
-
Transactional Data - Filtered by posting/document date (BUDAT)
This enables you to create smaller, more relevant test datasets from large SAP systems.
How Time Slicing Works
Available Time Periods
| Option | Months | Use Case |
|---|---|---|
No time slicing |
All data |
Complete historical dataset |
Last month |
1 |
Very recent data only |
Last 3 months |
3 |
Current quarter data |
Last 6 months |
6 |
Half-year data |
Last 9 months |
9 |
Three-quarter year data |
Last 12 months |
12 |
Full year data |
Generated Configuration
Referential Integrity
When using transactional data with time slicing, the platform ensures master data referenced by transactions is included:
Scenario: 3-month time slice
Transaction (MSEG) - Created: 2024-01-15
↓ References MATNR = 'MAT-001'
Master Record (MARA) - Created: 2020-06-01
↓ Created 3+ years ago, but STILL INCLUDED
↓ because it's referenced by a transaction within the time window
How It Works
-
Transactional Filter Applied - Only documents within the time period
-
Reference Analysis - Identify master records referenced by included transactions
-
Master Data Expansion - Include referenced master records regardless of creation date
-
Consistency Maintained - All foreign key references resolve correctly
Time Slicing with Full Copy
Optional Date Filtering
When "Full Copy" data scope is selected, time slicing can still be applied to filter by date when needed. Without a time slice, all records are included:
# Full Copy without time slicing - all records
tables:
- table_name_with_schema: "SCHEMA.MARA"
# No filter property - all records included
# Full Copy with optional time slicing
tables:
- table_name_with_schema: "SCHEMA.MARA"
filter: "ERSDA >= ADD_MONTHS(CURRENT_DATE, -6)" # Optional date filter
Choosing the Right Time Period
Considerations
| Factor | Guidance |
|---|---|
Test Scenario |
Match the time period to your test requirements. Testing month-end close? Use last month. |
Data Volume |
Longer periods = more data. Start small, increase if needed. |
Processing Time |
Longer periods increase workflow execution time. |
Storage Requirements |
Target database must accommodate the selected volume. |
Business Seasonality |
Ensure the period captures representative business activity. |
Environment Recommendations
| Environment | Recommended Period | Rationale |
|---|---|---|
Development |
Last month or 3 months |
Quick iterations, minimal data needed |
CI/CD Pipelines |
Last month |
Fast execution, frequent runs |
System Testing |
Last 3-6 months |
Representative data variety |
UAT |
Last 6-12 months |
Cover more scenarios |
Performance Testing |
Last 12 months or Full Copy |
Realistic data volumes |
Production Clone |
Full Copy (no slicing) |
Complete replica |
Estimating Data Volume
Before selecting a time period, estimate the data volume:
-- Transactional data by month
SELECT
YEAR(BUDAT) AS year,
MONTH(BUDAT) AS month,
COUNT(*) AS document_count
FROM SCHEMA.MKPF
WHERE BUDAT >= ADD_MONTHS(CURRENT_DATE, -12)
GROUP BY YEAR(BUDAT), MONTH(BUDAT)
ORDER BY year DESC, month DESC;
-- Master data by creation month
SELECT
YEAR(ERSDA) AS year,
MONTH(ERSDA) AS month,
COUNT(*) AS record_count
FROM SCHEMA.MARA
WHERE ERSDA >= ADD_MONTHS(CURRENT_DATE, -12)
GROUP BY YEAR(ERSDA), MONTH(ERSDA)
ORDER BY year DESC, month DESC;
Custom Date Filters
For advanced scenarios requiring custom date logic, you can manually edit the workflow configuration:
tables:
- table_name_with_schema: "SCHEMA.MKPF"
# Custom filter: specific date range
filter: "BUDAT BETWEEN '2024-01-01' AND '2024-03-31'"
- table_name_with_schema: "SCHEMA.MARA"
# Custom filter: exclude specific material types
filter: "ERSDA >= ADD_MONTHS(CURRENT_DATE, -6) AND MTART != 'SERV'"
|
Custom filters require editing the YAML configuration directly after the wizard generates the initial workflow. |
Troubleshooting
No Data Returned
If the workflow completes but no data is copied:
-
Check Date Field Values - Verify ERSDA/BUDAT contain expected dates
-
Validate Date Format - SAP stores dates in various formats
-
Extend Time Period - Try a longer time slice
-- Verify date field values
SELECT MIN(ERSDA), MAX(ERSDA), COUNT(*) FROM SCHEMA.MARA;
SELECT MIN(BUDAT), MAX(BUDAT), COUNT(*) FROM SCHEMA.MKPF;