ABAP Blog Posts
cancel
Showing results for 
Search instead for 
Did you mean: 
1,111

 

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).

Srikanta_Kumar_Gouda_0-1760070009211.png

Entries of legacy table.

Srikanta_Kumar_Gouda_1-1760070024172.png

 

b. Target Table: ZSODET_TARGET(Sales data target table) - Initially it doesn't have any record, the data will be migrated from legacy table. 

Srikanta_Kumar_Gouda_2-1760070038789.png

Srikanta_Kumar_Gouda_3-1760070050672.png

 

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.

Purpose of the CDS View

Feature Purpose
EncapsulationEncapsulates the logic to read only relevant legacy data (e.g., only for given date ranges)ReusabilityMakes the selection logic reusable across AMDP methods, reports, and moreSecurity & ReadabilityCDS views are clearer, safer, and easier to optimize than raw SELECT statementsIntegration with AMDPAMDP can easily consume CDS entities for fast, pushdown-enabled data processing in HANA

 

Srikanta_Kumar_Gouda_2-1760002207821.png

 

Parallel Processing Logic:

 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:

Srikanta_Kumar_Gouda_4-1760070137074.png

3. Create Remote-Enabled FM:   Wraps AMDP method in a RFC-enabled FM for remote execution.

Srikanta_Kumar_Gouda_5-1760070157677.png

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:

  •  Go to Transaction: RZ12
    Srikanta_Kumar_Gouda_8-1760070225664.png
  • Click on create assignment
  • Give the server group and instance name
  • Give the properties of the instance and click on Copy.
  • Server group will be created and check the server group status.
  • Distribute workload (for parallel execution)

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.

    Srikanta_Kumar_Gouda_9-1760070260619.pngSrikanta_Kumar_Gouda_10-1760070271838.pngSrikanta_Kumar_Gouda_11-1760070298605.png
    • Status Output
      Once all chunks are processed, the report provides confirmation that the data migration has been successfully completed.

     

    Srikanta_Kumar_Gouda_12-1760070348330.pngSrikanta_Kumar_Gouda_13-1760070356513.png

     

  • Now, check the target table to see the migrated data from legacy table.

    Srikanta_Kumar_Gouda_14-1760070380181.png

    Thanks.