Introduction:
Migrating data is a key part of moving to SAP S/4HANA. When dealing with large datasets from older systems, it's important to migrate them effectively. In this blog, we'll look at how to leverage Parallel Processing in CDS Views to enhance the data migration process.
Business Scenario:
We're moving sales orders from an old system into the target table [zsodet_target]. We pull the data using a CDS view [ ZSALESDATA_MIGRATION_USINGPP] and handle it with AMDP logic. To speed things up, we break the migration into date ranges and run them in parallel using destination groups.
Steps for Implementation:
1. Create Source and Target Tables:
a. Source Table: ZSODET_LEGACY(Sales Data Source Table).
Entries of legacy table.
b. Target Table: ZSODET_TARGET(Sales data target table) - Initially it doesn't have any record, the data will be migrated from legacy table.
2. Create a CDS View: The CDS view "ZSALESDATA_MIGRATION_USINGPP" is designed to access old sales data in a modular, secure, and efficient manner — particularly when filtered by date ranges — prior to its migration to the S/4HANA system.
| Encapsulation | Encapsulates the logic to read only relevant legacy data (e.g., only for given date ranges) | Reusability | Makes the selection logic reusable across AMDP methods, reports, and more | Security & Readability | CDS views are clearer, safer, and easier to optimize than raw SELECT statements | Integration with AMDP | AMDP can easily consume CDS entities for fast, pushdown-enabled data processing in HANA |
To achieve parallel processing, we will use AMDP (ABAP Managed Database Procedures) along with the above CDS view for high performance and complex data processing directly in HANA — instead of slow ABAP logic. It runs entirely on the HANA DB, not in ABAP layer — so it's much faster.
AMDP:
3. Create Remote-Enabled FM: Wraps AMDP method in a RFC-enabled FM for remote execution.
4. Create Server Group (RFC Destination Group):
Purpose: Server groups allow ABAP programs to run function modules in parallel across multiple application servers using CALL FUNCTION->STARTING NEW TASK -> DESTINATION IN GROUP.
Steps for creating server group:
5. Purpose of the Report Program
Dividing the Data: It breaks down the entire dataset (like sales orders) into smaller, more manageable pieces based on date ranges that the user can set. Starting Parallel Tasks: For every piece, the report kicks off a remote-enabled function module using STARTING NEW TASK, which lets multiple tasks run at the same time, greatly boosting performance.
Monitoring Tasks and Handling Completion: It keeps an eye on each parallel task and makes sure everything is in sync by waiting for all tasks to finish before wrapping up the process.
Enhanced Efficiency and Runtime: By using parallel processing, the report cuts down the total migration time and makes better use of system resources.
Now, check the target table to see the migrated data from legacy table.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 14 | |
| 13 | |
| 12 | |
| 11 | |
| 10 | |
| 9 | |
| 8 | |
| 8 | |
| 7 | |
| 6 |