Let me provide the complete implementation details for our automated lease data archiving project, covering all three focus areas: lease contract archiving strategy, automated SARA jobs, and compliance validation.
For lease contract archiving, we developed a comprehensive strategy based on contract lifecycle and financial status. Our real estate portfolio of 8,500 contracts breaks down as:
- Active contracts: 1,280 (15%)
- Terminated <5 years: 2,140 (25%)
- Terminated >5 years, financially closed: 4,680 (55%)
- Terminated >5 years, open items: 400 (5%)
We targeted the 4,680 fully closed contracts for archiving. The selection criteria implemented in SARA:
- Contract status = Terminated (VIOBJE-STATUS = ‘T’)
- Termination date < current_date - 5 years (business retention)
- No open financial items (checked against VIFPOB, DFKKOP tables)
- No active legal disputes (checked against custom dispute tracking table)
- All associated documents scanned and attached (DMS completeness check)
This conservative approach ensured we only archived contracts with zero operational dependencies. The 5-year retention window aligns with our business need for recent historical data while the 10-year legal requirement is met through compliant archive storage.
For automated SARA jobs implementation, we built a three-phase automation framework:
Phase 1 - Data Preparation (Monthly Job):
Scheduled ABAP program runs on the 1st of each month to identify archiving candidates:
// Pseudocode - Archive candidate identification:
1. Query VIOBJE for terminated contracts older than 5 years
2. Cross-check VIFPOB for zero open financial items
3. Validate DMS completeness for all contract documents
4. Generate candidate list in staging table Z_ARCHIVE_CANDIDATES
5. Send notification to real estate data steward for review
// Review period: 5 business days for exception handling
Phase 2 - Archiving Execution (Automated SARA Job):
After review period, automated SARA job executes via transaction SARA:
- Archiving object: RE_CONTRACT
- Residence time: 1,825 days (5 years)
- Commit interval: 100 contracts (balance between performance and rollback capability)
- Archive file size: 2GB maximum (optimal for retrieval performance)
- Write program: RE_CONTRACT_WRITE
- Delete program: RE_CONTRACT_DELETE (runs only after successful archive verification)
We scheduled this as a background job (SM36) running every 2nd Saturday at 2 AM during maintenance window. Runtime: 4-6 hours for ~400 contracts per run.
Phase 3 - Post-Archiving Validation (Automated):
Immediate validation job after archiving completes:
// Pseudocode - Archive validation routine:
1. Compare archived record count vs source selection count (must match 100%)
2. Perform random sampling: retrieve 5% of archived contracts via AS03
3. Validate data completeness: all contract fields populated in archive
4. Check archive file integrity: verify checksums on storage system
5. Generate validation report and email to IT and compliance teams
6. Only proceed to DELETE phase if validation passes all checks
// Automated rollback if validation fails
For compliance validation, we implemented a multi-layered verification approach:
Layer 1 - Archive Info Structure:
Created custom info structure (transaction AS08) for lease contracts:
- Fields indexed: Contract ID, Property ID, Tenant Name, Start Date, End Date, Total Rent
- This provides instant summary access without full document retrieval
- Query performance: <1 second for filtered searches across 4,680 archived contracts
- Used by compliance team for quick lookups during audits
Layer 2 - Full Document Retrieval:
Configured archive retrieval via transaction AS03:
- Average retrieval time: 3.2 seconds per contract (includes all associated documents)
- Acceptable for audit scenarios (infrequent, specific contract reviews)
- Integrated with Fiori UI for business user access (no technical transaction codes required)
Layer 3 - Audit Trail:
Implemented comprehensive logging:
- Every archiving session logged with timestamp, user, record count
- Every archive retrieval logged (who accessed, when, which contract)
- Retention of archive access logs: 10 years (matches legal requirement)
- Quarterly audit reports generated automatically showing archiving activity and retrieval patterns
Compliance certification process:
We engaged external auditors to validate our archiving approach:
- Provided archiving policy document detailing retention rules and technical implementation
- Demonstrated archive retrieval process for sample contracts
- Showed audit trail completeness and tamper-evidence
- Received written certification that archived data meets legal retention requirements
This certification was critical for CFO and legal team buy-in.
Results after 6 months of operation:
- Database size reduction: 780GB → 452GB (42% reduction, 328GB archived)
- Backup time improvement: 9.2 hours → 5.1 hours (45% faster)
- System performance: Query response times on lease tables improved 30-35% due to smaller active dataset
- Storage costs: $12K annual savings (HANA in-memory vs NAS archive storage cost differential)
- Compliance: Zero audit findings related to archived data access in two external audits
Archive storage strategy:
We use SAP Content Server connected to enterprise NAS with:
- Primary archive storage: High-availability NAS with daily snapshots
- Secondary archive copy: Replicated to offsite disaster recovery location
- Archive file format: SAP-standard archive format (ADK-based, not proprietary)
- This ensures long-term accessibility even if SAP system architecture changes
To address the HANA partitioning question: We did not implement HANA-level data aging or partitioning for lease tables. SARA archiving alone achieved our objectives. However, if you have very high transaction volumes, combining SARA with HANA partitioning could provide additional benefits-partition active contracts separately from near-active (terminated <5 years) for further performance optimization.
Key lessons learned:
- Conservative selection criteria prevent operational issues-exclude any contract with potential future activity
- Automated validation is essential-manual spot-checks miss edge cases
- Business user training on archive retrieval is critical-technical barrier was our biggest adoption challenge
- Start with small batches (100-200 contracts) to validate process before scaling to thousands
- Engage compliance and legal teams early-their certification provides organizational confidence
For anyone implementing similar archiving, I recommend a 3-month pilot: archive 500 contracts, validate thoroughly, gather business feedback, then scale. The technical implementation via SARA is straightforward; the organizational change management is the real challenge.