SAP Data Scoping
Control the scope of data included in SAP workflows by selecting master data, transactional data, or complete datasets.
Overview
SAP data can be categorized into two main types:
-
Master Data - Reference data that changes infrequently (materials, vendors, customers)
-
Transactional Data - Operational data created by business processes (documents, postings)
The platform allows you to choose which data types to include based on your testing needs.
Scope Options
Master Data Only
Includes: Reference tables only Excludes: All transactional/document tables
MM Module Tables Included
| Table | Description |
|---|---|
MARA |
Material Master - General Data |
MAKT |
Material Descriptions |
MARC |
Material Master - Plant Data |
MARD |
Material Master - Storage Location Stock |
MBEW |
Material Valuation Data |
MARM |
Material Units of Measure |
MVKE |
Material Sales Data |
Transactional + Master Data
Includes: Both master and transactional tables Behavior: Automatically includes master data referenced by transactions
MM Module Tables Included
| Table | Description | Type |
|---|---|---|
MARA |
Material Master - General Data |
Master |
MAKT |
Material Descriptions |
Master |
MARC |
Material Master - Plant Data |
Master |
MARD |
Material Master - Storage Location Stock |
Master |
MBEW |
Material Valuation Data |
Master |
MARM |
Material Units of Measure |
Master |
MVKE |
Material Sales Data |
Master |
MKPF |
Material Document Header |
Transactional |
MSEG |
Material Document Item |
Transactional |
Automatic Master Data Inclusion
When selecting transactional data, the platform ensures referential integrity:
Transactional Record (MSEG)
↓ References MATNR
Master Record (MARA)
↓ Automatically included even if created before time period
Example: A material document from last month references a material created 2 years ago. The material master record is included to maintain data consistency.
When to Use
-
Realistic test data - Complete business scenarios with documents
-
Process testing - Testing workflows that create/modify documents
-
UAT environments - User acceptance testing with real transactions
-
Performance testing - Testing with realistic data volumes
Configuration
# Generated for Transactional scope with 3-month filter
tables:
# Master data - filtered by creation date
- table_name_with_schema: "SCHEMA.MARA"
filter: "ERSDA >= ADD_MONTHS(CURRENT_DATE, -3)"
transformations:
# ...
# Transactional data - filtered by posting date
- table_name_with_schema: "SCHEMA.MKPF"
filter: "BUDAT >= ADD_MONTHS(CURRENT_DATE, -3)"
transformations:
# ...
- table_name_with_schema: "SCHEMA.MSEG"
transformations:
# Linked to MKPF, inherits filter
Full Copy
Includes: All master data and transactional tables Use case: Complete dataset replication for environments requiring full data history
Characteristics
-
Includes all historical records
-
Can be combined with time slicing when date-based filtering is needed
-
Table truncation mode typically set to
DO_NOT_TRUNCATEfor additive loads -
Largest data volume
Scope Comparison
| Aspect | Master Only | Transactional | Full Copy |
|---|---|---|---|
Master Tables |
Yes |
Yes |
Yes |
Transaction Tables |
No |
Yes |
Yes |
Time Slicing |
Optional |
Available |
Available |
Relative Size |
Small |
Medium |
Large |
Use Case |
Development |
Testing |
Production Clone |
Data Volume Considerations
Estimating Data Volume
Use these queries to estimate row counts before running workflows:
-- Master data count
SELECT 'MARA' AS table_name, COUNT(*) AS row_count FROM SCHEMA.MARA
UNION ALL
SELECT 'MAKT', COUNT(*) FROM SCHEMA.MAKT
UNION ALL
SELECT 'MARC', COUNT(*) FROM SCHEMA.MARC;
-- Transactional data by date range
SELECT
'MKPF' AS table_name,
COUNT(*) AS total_rows,
COUNT(CASE WHEN BUDAT >= ADD_MONTHS(CURRENT_DATE, -3) THEN 1 END) AS last_3_months
FROM SCHEMA.MKPF;
Combining Scope with Time Slicing
The scope selection interacts with time slicing:
| Scope | Time Slicing | Behavior |
|---|---|---|
Master Only |
Available |
Filters master data by creation date (ERSDA) |
Transactional |
Available |
Filters transactions by posting date (BUDAT) |
Full Copy |
Available |
Filters by date when configured; includes all records when not specified |
Best Practices
Start Small, Expand Later
-
Begin with Master Data Only to validate setup
-
Add Transactional + 3 months for realistic testing
-
Use Full Copy only when complete data is required
Match Scope to Environment
| Environment | Recommended Scope |
|---|---|
Development |
Master Only |
System Testing |
Transactional (3-6 months) |
UAT |
Transactional (6-12 months) |
Performance Testing |
Full Copy or Transactional (12 months) |
Production Clone |
Full Copy |
Consider Storage Requirements
Full Copy can require significant storage. Plan target database sizing accordingly:
-- Estimate storage for MM tables
SELECT
TABLE_NAME,
ROUND(TABLE_SIZE / 1024 / 1024, 2) AS SIZE_MB
FROM M_TABLES
WHERE SCHEMA_NAME = 'SCHEMA'
AND TABLE_NAME IN ('MARA', 'MAKT', 'MARC', 'MARD', 'MKPF', 'MSEG')
ORDER BY TABLE_SIZE DESC;