SAP Data Migration Troubleshooting: Connection Refused, TIME_OUT Dumps & Slow Performance Fixes
Fix SAP data migration failures fast: resolve CPIC_CALL_BACK_NOT_REGISTERED, TIME_OUT dumps, and slow LTMC loads with profile tuning, background mode, and RFC a
- Connection refused errors (CPIC_CALL_BACK_NOT_REGISTERED, NIECONN_REFUSED) are caused by a stopped SAP gateway or message server process, or firewall rules blocking ports 33xx/36xx/39xx — verify with ps and ss on the application server, then restart via sapcontrol.
- TIME_OUT short dumps during LTMC migration occur because the dialog work process runtime limit (rdisp/max_wprun_time, default 300s) is shorter than the time needed for a large migration batch — switch LTMC execution to Background mode or raise the profile parameter to 3600 in RZ10.
- Slow migration performance is caused by missing table statistics after bulk inserts, lock contention visible in SM12, or too few background work processes — run UPDATE STATISTICS in HANA, reduce LTMC package size to 200–500 rows, and increase rdisp/wp_no_btc to at least 6.
- Quick diagnostic path: ST22 for dump type → SM21 for system log events → SM59 for RFC status → RZ10 for profile parameter review → apply targeted fix and restart only if required.
| Method | When to Use | Time | Risk |
|---|---|---|---|
| Switch LTMC to Background execution mode | TIME_OUT dumps during dialog-mode migration | 2–5 min config, no restart | Low — no downtime, survives browser disconnect |
| Increase rdisp/max_wprun_time in RZ10 | Persistent TIME_OUT even in background; long-running BAPIs | 15 min + instance restart | Low — only extends runtime window |
| Restart SAP instance via sapcontrol | Connection refused / gateway or ICM crash | 10–20 min downtime | Medium — interrupts active user sessions |
| Reduce LTMC batch/package size to 200–500 | DBIF_RSQL_SQL_ERROR or lock contention mid-migration | 5 min config, reruns needed | Low — may increase total migration clock time |
| Run UPDATE STATISTICS on target tables | Slow INSERT after bulk load on HANA | Minutes to hours depending on table size | Low — metadata-only read operation |
| Add S_RFC authorization object in PFCG | RFC_NO_AUTHORITY blocking source system access | 30–60 min with BASIS team | Low — additive permission change only |
Understanding SAP Data Migration Failures
SAP data migration spans multiple tools and layers: the SAP Migration Cockpit (LTMC/LTMOM), Legacy System Migration Workbench (LSMW), BAPI-based batch loaders, and RFC-connected ETL tools. Each layer introduces distinct failure modes. A connection refused at the RFC gateway looks entirely different from a TIME_OUT dump in the ABAP runtime, even though both prevent data from moving. Misidentifying the layer wastes hours of investigation.
The four most common failure categories are:
- Network and gateway failures:
CPIC_CALL_BACK_NOT_REGISTERED,NIECONN_REFUSED,RFC_NO_AUTHORITY - Runtime timeout dumps:
TIME_OUT,ICM_HTTP_CONNECTION_BROKEN,SYSTEM_FAILURE - Database errors:
DBIF_RSQL_SQL_ERROR,DBIF_REPO_SQL_ERROR, duplicate primary key violations - Data quality errors: mandatory field missing, type conversion failure, orphaned foreign key references
Step 1: Identify the Failure Layer
Check ST22 first — ABAP short dumps. This is the fastest starting point for any SAP crash or timeout.
Transaction ST22 -> Set date range -> Look for:
TIME_OUT — work process runtime exceeded rdisp/max_wprun_time
DBIF_RSQL_SQL_ERROR — database rejected an INSERT or UPDATE
SNAP_NO_NEW_ENTRY — SNAP table (TSP01) is full, call BASIS
MEMORY_NO_MORE_PAGING — system swapping heavily, memory exhausted
DYNPRO_SEND_IN_BACKGROUND — UI call attempted from background process
Check SM21 for infrastructure-level events:
Transaction SM21 -> Local Analysis -> Last 1 hour -> Look for:
"Work process restarted" — process crashed, note reason code
"Enqueue: timeout waiting" — lock contention blocking migration
"RFC: no more sessions" — RFC connection pool exhausted
"DB error 54" or "DB error 60" — Oracle deadlock or lock timeout
Check SM59 for RFC connectivity when migrating between systems:
Transaction SM59 -> Select RFC destination -> Connection Test
Green: "Connection test was successful"
Red: "CPIC_CALL_BACK_NOT_REGISTERED" -> gateway process not running
Red: "RFC_NO_AUTHORITY" -> missing S_RFC authorization object
Red: "TIMEOUT" -> network latency or stateful firewall dropping idle RFC connections
Step 2: Resolve Connection Refused Errors
Symptoms: NIECONN_REFUSED, CPIC_CALL_BACK_NOT_REGISTERED, SM59 connection test fails with a red status.
Root cause: The SAP gateway (gwrd), message server (msServ), or ICM (icman) process has stopped, or a firewall rule is blocking ports required for RFC communication.
Step 2a — Verify running processes on the application server:
# Run as <sid>adm on the SAP application server
ps aux | grep -E 'disp\+work|gwrd|msServ|icman' | grep -v grep
# Expected: one line per process
# <sid>adm ... /usr/sap/<SID>/D<NR>/exe/disp+work
# <sid>adm ... /usr/sap/<SID>/D<NR>/exe/gwrd
# <sid>adm ... /usr/sap/<SID>/D<NR>/exe/icman
# If any process is missing, restart the instance:
sapcontrol -nr <INSTANCE_NR> -function RestartSystem IsRestarted 10 120
Step 2b — Confirm ports are listening (replace 00 with your instance number):
ss -tlnp | grep -E '3200|3300|3600|3900|8000'
# 32<NR> = SAP dispatcher (dialog)
# 33<NR> = RFC/CPIC gateway
# 36<NR> = Gateway server
# 39<NR> = Message server
# 80<NR> or 8000 = HTTP/ICM
Step 2c — Fix gateway ACL if CPIC_CALL_BACK_NOT_REGISTERED persists after restart:
Edit /usr/sap/<SID>/SYS/profile/DEFAULT.PFL and ensure:
gw/acl_mode = 1
gw/sec_info = $(DIR_GLOBAL)/secinfo
gw/reg_info = $(DIR_GLOBAL)/reginfo
Verify the secinfo file contains a P (permit) entry for your source system hostname and IP. Restart the gateway process after any ACL change.
Step 3: Resolve Timeout Errors During Migration
Symptoms: ST22 shows TIME_OUT dump; LTMC browser session shows ICM_HTTP_CONNECTION_BROKEN; migration aborts mid-package with no partial commit.
Root cause: Dialog work process runtime limit (rdisp/max_wprun_time, default 300 seconds) is shorter than the time required to process a migration batch of 1000 rows with full validation and commit.
Step 3a — Switch to Background execution in LTMC (preferred — no restart):
- LTMC → Open your migration project
- Navigate to the Migrate Data step
- Click Settings → change Execution Mode from
DialogtoBackground - Set Background Job Priority to A (highest)
- Optionally verify the scheduled job in SM37 after launching
Step 3b — Extend profile parameters for persistent timeout issues (requires restart):
In RZ10 → Instance Profile → Extended Maintenance, add or modify:
rdisp/max_wprun_time = 3600
rdisp/scheduler/prio_high/max_wprun_time = 7200
icm/keep_alive_timeout = 600
icm/conn_timeout = 600
http/session_timeout = 3600
Then restart the instance:
sapcontrol -nr <NR> -function Stop
sapcontrol -nr <NR> -function Start
sapcontrol -nr <NR> -function GetProcessList
Step 4: Resolve Slow Migration Performance
Symptoms: Migration runs but takes 10x longer than expected; SM50 shows work processes locked in "Running" state for minutes at a time; RFC calls to the source system intermittently time out.
Step 4a — Diagnose lock contention via SM12 and SM50:
Transaction SM12 -> Display Lock Entries -> Sort by Lock Time
Entries older than 5 minutes during an active migration indicate a blocking transaction.
Note the locked table name and the owning user/session.
Go to SM50 and find the matching work process.
If the process is confirmed hung, use SM50 -> Process -> Cancel with Core (emergency only).
Step 4b — Identify expensive database statements on HANA via DBACOCKPIT:
-- Find the slowest statements in the last migration window
SELECT TOP 20
SUBSTR(STATEMENT_STRING, 1, 120) AS SQL_SNIPPET,
DURATION_MICROSECOND / 1000000 AS DURATION_SEC,
EXECUTION_COUNT,
USER_NAME
FROM M_EXPENSIVE_STATEMENTS
WHERE START_TIME > ADD_SECONDS(NOW(), -3600)
AND DURATION_MICROSECOND > 10000000
ORDER BY DURATION_MICROSECOND DESC;
-- Force statistics refresh on the migration target table
UPDATE STATISTICS "SAPHANADB"."MARA";
Step 4c — Reduce LTMC batch size and enable parallel packages:
LTMC → Migration Project → Settings → Expert Settings:
- Set
Package Sizefrom 1000 (default) to 200–500 - Enable
Parallel Processing: set parallel workers to 2–4 (must not exceed available background WPs minus 2)
Step 4d — Ensure sufficient background work processes in RZ10:
rdisp/wp_no_btc = 8
# Set to: (parallel LTMC workers) + 2 at minimum
# Check current allocation: Transaction SM50 -> Process Overview
Step 5: Resolve Data Quality Errors
Symptoms: LTMC error log shows rows in red; messages include Field LIFNR is mandatory, Duplicate entry for primary key MANDT-MATNR, or Foreign key constraint violation.
Step 5a — Export and triage the LTMC error log:
- LTMC → Migration Project → Migrate Data step → Error Log button
- Export as Excel/CSV using the download icon
- Filter column
Message Type=E - Sort by
Message IDto group the most frequent errors
Step 5b — Check for duplicate key conflicts before re-import:
" Run in SE38 — adjust table and key field to your migration object
REPORT z_check_migration_duplicates.
SELECT matnr, COUNT(*) AS cnt
FROM mara
GROUP BY matnr
HAVING COUNT(*) > 1
INTO TABLE @DATA(lt_dups).
IF lt_dups IS INITIAL.
WRITE: / 'No duplicate keys found — safe to re-import'.
ELSE.
LOOP AT lt_dups INTO DATA(ls_dup).
WRITE: / 'Duplicate:', ls_dup-matnr, 'Count:', ls_dup-cnt.
ENDLOOP.
ENDIF.
Step 5c — Correct source data and re-run migration:
- Fix the source spreadsheet based on error log findings
- In LTMC → Migration Project → click Revert to File Upload to reset the step
- Upload the corrected file, re-run validation, then execute migration
Baseline SAP Configuration Before Any Migration Project
Verify the following parameters are correctly set in RZ10 before starting a large migration. Document before-values and keep a rollback plan. Always validate in a non-production system first.
rdisp/max_wprun_time = 3600
rdisp/wp_no_dia = 10
rdisp/wp_no_btc = 8
ztta/roll_area = 3000000
ztta/roll_first = 1
em/initial_size_MB = 4096
abap/heap_area_dia = 500000000
icm/server_port_0 = PROT=HTTP,PORT=8000,TIMEOUT=3600
icm/keep_alive_timeout = 600
http/session_timeout = 3600
Frequently Asked Questions
#!/bin/bash
# SAP Data Migration Diagnostic Script
# Usage: ./sap_migration_diag.sh <SID> <INSTANCE_NR>
# Run as <sid>adm on the SAP application server
SID=${1:-SAP}
NR=${2:-00}
echo ================================================
echo SAP Migration Diagnostic: SID=$SID Instance=$NR
echo $(date)
echo ================================================
# 1. SAP process status via sapcontrol
echo
echo [1] SAP Process List
echo -------------------
sapcontrol -nr $NR -function GetProcessList 2>/dev/null \
|| echo ERROR: sapcontrol failed -- verify SID and instance number
# 2. Check critical OS-level processes
echo
echo [2] Critical SAP Process Check
echo --------------------------------
for PROC in disp+work gwrd msServ icman; do
PID=$(pgrep -f $PROC 2>/dev/null | head -1)
if [ -n "$PID" ]; then
echo " OK $PROC (PID $PID)"
else
echo " FAIL $PROC NOT RUNNING -- investigate immediately"
fi
done
# 3. Check SAP ports are listening
echo
echo [3] SAP Port Availability
echo --------------------------
for PORT in 32${NR} 33${NR} 36${NR} 39${NR} 80${NR} 8000; do
ss -tlnp 2>/dev/null | grep -q ":${PORT} " \
&& echo " OPEN port $PORT" \
|| echo " CLOSED port $PORT -- check firewall and gateway config"
done
# 4. Check relevant profile parameters
echo
echo [4] Key Profile Parameters
echo ---------------------------
PROF=/usr/sap/${SID}/SYS/profile
for PARAM in rdisp/max_wprun_time rdisp/wp_no_dia rdisp/wp_no_btc \
icm/keep_alive_timeout http/session_timeout em/initial_size_MB; do
VAL=$(grep -rh "^${PARAM}" ${PROF}/ 2>/dev/null | tail -1)
if [ -n "$VAL" ]; then
echo " SET $VAL"
else
echo " DEFAULT $PARAM (not explicitly set -- check SAP default)"
fi
done
# 5. Memory and disk
echo
echo [5] System Resources
echo --------------------
echo -- Memory --
free -h 2>/dev/null
echo -- Disk --
df -h /usr/sap/${SID} /sapmnt 2>/dev/null || df -h /usr/sap 2>/dev/null
# 6. Recent core dumps in SAP work directory
echo
echo [6] Recent Core Dumps in SAP Work Dir (last 24h)
echo --------------------------------------------------
find /usr/sap/${SID}/D${NR}/work/ -name "core*" -mtime -1 \
-exec ls -lh {} \; 2>/dev/null && echo " (none found)" || true
# 7. HANA expensive statements (if hdbsql is available)
echo
echo [7] HANA Expensive Statements Check
echo -------------------------------------
if command -v hdbsql &>/dev/null; then
hdbsql -u SYSTEM -p "${HANA_PASS}" -d SYSTEMDB 2>/dev/null <<'HDBEOF'
SELECT TOP 10
SUBSTR(STATEMENT_STRING,1,80) AS SQL,
DURATION_MICROSECOND/1000000 AS SEC,
USER_NAME
FROM M_EXPENSIVE_STATEMENTS
WHERE DURATION_MICROSECOND > 10000000
ORDER BY DURATION_MICROSECOND DESC;
HDBEOF
else
echo " hdbsql not found on PATH -- run query via DBACOCKPIT in SAP GUI"
fi
# 8. SAP GUI transaction checklist
echo
echo [8] SAP GUI Follow-Up Checklist
echo ---------------------------------
echo " ST22 -- Short dumps today: filter TIME_OUT, DBIF_RSQL_SQL_ERROR"
echo " SM21 -- System log last 1h: RFC errors, work process restarts"
echo " SM59 -- RFC destinations: run Connection Test for migration source"
echo " SM12 -- Lock entries: identify blocking locks during migration"
echo " SM50 -- Work process overview: find processes stuck in Running state"
echo " LTMOM -- Migration Cockpit monitor: per-package status and error log"
echo " RZ10 -- Instance profile: review and tune migration parameters"
echo
echo Diagnostic complete.Error Medic Editorial
The Error Medic Editorial team comprises senior DevOps engineers, SAP BASIS consultants, and SRE practitioners with 10+ years of hands-on experience managing enterprise ERP infrastructure. We specialize in SAP S/4HANA system administration, large-scale data migration projects (LTMC, LSMW, SLT), ABAP runtime tuning, and production incident response across cloud and on-premise deployments.
Sources
- https://help.sap.com/docs/MIGRATIONCOCKPIT/c0c54048d35849128be8e872df5bea6d/en-US/0e2e61b5a0e34fe8bfb2c1017e23753c.html
- https://community.sap.com/t5/enterprise-resource-planning-blogs-by-sap/sap-s-4hana-migration-cockpit-troubleshooting-common-errors/ba-p/13520834
- https://launchpad.support.sap.com/#/notes/2492235
- https://help.sap.com/docs/SAP_S4HANA_ON-PREMISE/c0c54048d35849128be8e872df5bea6d/en-US/ltmc-background-processing.html