Parallel invoice migration from legacy AP system times out during RFC calls in S/4HANA AMDP parallel processing

We’re migrating 850K AP invoices from our legacy system to S/4HANA 1809 using AMDP parallel processing with CDS views. The migration runs for about 2 hours then consistently fails with RFC timeout errors (COMMUNICATION_FAILURE). We’ve configured an RFC server group with 6 dialog work processes, but the parallel tasks don’t seem to distribute evenly. Our AMDP procedure splits data into 10 chunks, but monitoring shows only 3-4 tasks active simultaneously. The timeout occurs when checking task completion with WAIT statements - some tasks never report back. Is there a specific configuration for work process timeout tuning that we’re missing? The RFC destination uses default timeout values, and we’re not sure if AMDP parallel processing requires special server group setup beyond standard configuration.

Let me provide a comprehensive solution for your parallel invoice migration timeout issues. You’re experiencing a combination of configuration gaps and implementation challenges that are common with AMDP parallel processing in migration scenarios.

RFC Server Group Configuration: First, adjust your server group setup in RZ12. For 8 parallel tasks, configure quota to 10 (add 20-25% buffer for coordination overhead). Verify in SM51 that all application servers in the group have sufficient dialog work processes available - you need at least 2-3 free processes per server beyond the parallel tasks for coordination and monitoring.

Work Process Timeout Tuning: Set rdisp/max_wprun_time to 7200 seconds (2 hours) minimum for migration workloads. This is a profile parameter requiring instance restart. Additionally, check rdisp/max_cpic_wait_time - this should be at least 3600 seconds for RFC-based parallel processing. These two parameters work together: max_wprun_time controls overall process runtime, while max_cpic_wait_time specifically handles RFC communication timeouts.

RFC Destination Setup: In SM59, configure your parallel processing RFC destination with these critical settings:

  • Connection Type: 3 (ABAP Connection)
  • Load Balancing: Enabled
  • Target: Your server group name (PARALLEL_01)
  • RFC Timeout: 7200 seconds
  • Serialization Timeout: 7200 seconds

The serialization timeout is often overlooked but crucial for AMDP scenarios where result sets are large.

AMDP Parallel Processing Configuration: Your current approach of splitting 850K records into 8-10 chunks needs optimization. Calculate chunk size based on processing time per record, not just record count. For AP invoices with complex validation logic, aim for chunks that process in 45-60 minutes maximum. This might mean 12-15 smaller chunks rather than 8 large ones. The key is keeping individual task duration well below your timeout thresholds.

Task Completion Monitoring with WAIT Statements: This is where your implementation needs the most work. Replace your current WAIT UNTIL approach with a progressive monitoring pattern:

  1. After starting all parallel tasks, implement a polling loop with 30-second intervals
  2. Use RECEIVE RESULTS FROM FUNCTION with addition NO WAIT to check each task individually
  3. Track completed vs. pending tasks in an internal table
  4. Implement escalating timeout logic: warn at 60 minutes, attempt graceful cancellation at 75 minutes, hard timeout at 90 minutes
  5. For tasks that timeout, log the last processed key and implement restart capability

The pattern should look conceptually like this:


LOOP AT task_handles INTO task_handle.
  RECEIVE RESULTS FROM FUNCTION 'Z_PARALLEL_MIGRATE'
    KEEPING TASK
    IMPORTING result = task_result
    EXCEPTIONS communication_failure = 1
               system_failure = 2.
  IF sy-subrc = 0.
    " Task completed - process results
  ENDIF.
ENDLOOP.

Additional Recommendations:

  1. Enable detailed RFC tracing (dev_rfc.trc) for one test run to identify exactly where timeouts occur
  2. Review HANA SQL trace (transaction SQLTR) to ensure your AMDP procedures aren’t hitting database-side bottlenecks
  3. Consider implementing checkpoint/restart logic - write completed chunk ranges to a control table so you can resume from last successful point
  4. Monitor HANA memory consumption during parallel execution (transaction DBACOCKPIT) - insufficient memory can cause silent task failures
  5. For the WAIT implementation, set maximum overall wait time to 150% of your longest expected task duration

After implementing these changes, start with 6 parallel tasks for initial testing, then scale to 8 once stable. The combination of proper RFC/work process configuration and robust task monitoring should eliminate your timeout issues while maintaining good throughput. Your 850K invoice migration should complete in 3-4 hours with this setup.


This draft is based on general SAP S/4HANA knowledge. It has not been verified against your specific version and environment. Practitioners: verify the steps and share your experience below.

Check your RFC server group configuration in SM59 and RZ12. For AMDP parallel processing, you need explicit resource allocation. The server group should have quota set to at least match your parallel degree (10 in your case). Also verify the rdisp/max_wprun_time parameter - if it’s too restrictive, long-running tasks get terminated before completion. Your symptom of only 3-4 active tasks suggests resource starvation at the server group level.

Thanks for the pointer. Checked RZ12 - our server group ‘PARALLEL_01’ shows quota of 6, which explains why only partial tasks run. Should I increase this to 10 to match the parallel degree, or is there overhead to consider? Also found rdisp/max_wprun_time set to 1800 seconds (30 min). Given our 2-hour runtime, this could definitely cause the timeout. What’s the recommended value for migration scenarios? And does AMDP handle automatic retry when work processes timeout, or do we need explicit error handling in the procedure?

For AMDP parallel tasks with large data volumes, I typically recommend rdisp/max_wprun_time between 3600-7200 seconds depending on chunk size. However, there’s another consideration - your WAIT statement implementation. If you’re using WAIT UNTIL with a simple timeout, tasks that exceed work process limits won’t be caught properly. You need explicit status checking through the task handle. Also, 10 parallel tasks for 850K records might be over-parallelizing. Consider reducing to 6-8 tasks with larger chunks - this often performs better due to reduced coordination overhead and matches your available work processes.

Have you looked at the actual RFC destination timeout parameters in SM59? The default timeout in the RFC connection itself is often 60 seconds, separate from work process timeout. For parallel processing destinations, you need to set both ‘RFC Timeout’ and ‘Serialization Timeout’ to higher values - I use 7200 for migration jobs. Also enable ‘Load Balancing’ on the RFC destination if you haven’t already, so tasks properly distribute across available work processes in the server group.

Tested this on S/4HANA 2021 FPS02 with RZ12 quota set to 10 for 8 parallel tasks, eliminating RFC timeout failures in our AP invoice migration AMDP jobs.

Updated RFC destination timeout to 7200 and increased rdisp/max_wprun_time to 5400. Also adjusted server group quota to 8. Ran a test with 8 parallel tasks instead of 10. Still seeing failures, but now getting more detail in ST22 - ‘TIME_OUT’ exceptions from the WAIT statements after about 90 minutes. The dump shows some tasks completing successfully but the framework timing out while waiting for stragglers. Is there a way to implement progressive timeout monitoring rather than waiting for all tasks simultaneously?

Your WAIT implementation needs refinement. Instead of a single WAIT UNTIL for all tasks, implement a polling loop that checks task status individually with shorter intervals. This lets you identify which specific tasks are hanging and handle them separately. You can use RECEIVE RESULTS FROM FUNCTION to check completion status without blocking. For tasks that exceed threshold, you might need to implement a cancel-and-restart strategy. This is especially important with AMDP parallel processing where HANA-side execution can have different timeout characteristics than the ABAP framework expects.