ERPClimb logoERPClimb
ABAP short dumpObjectTABLE_FREE_IN_LOOPModuleABAP

New to SAP ABAP? Start with the module overview

TABLE_FREE_IN_LOOP — TABLE_FREE_IN_LOOP short dump

Quick answer

TABLE_FREE_IN_LOOP is raised when the internal table currently being iterated is structurally reset or replaced while its LOOP is active. FREE, CLEAR, REFRESH, SORT or whole-table assignment may be executed directly or indirectly through called routines/callbacks.

Production troubleshooting guide for TABLE_FREE_IN_LOOP: symptoms, likely root causes, ST22 evidence to inspect, safe resolution path, common wrong fixes and ownership.

Published 17 Nov 2026· 625 words

What the dump means

TABLE_FREE_IN_LOOP is raised when the internal table currently being iterated is structurally reset or replaced while its LOOP is active. FREE, CLEAR, REFRESH, SORT or whole-table assignment may be executed directly or indirectly through called routines/callbacks.

In production, do not stop at the runtime-error name. Open the exact occurrence in ST22 and read the short text, error analysis, termination point, source extract, active calls/events and variable values that were captured. The same runtime error can have several different triggers, so the program/include, terminating statement and runtime values matter more than a generic internet fix.

A useful first triage question is whether the failure is deterministic for the same user/input or appeared only after a transport, activation, upgrade, batch run, RFC call or infrastructure change. That distinction separates code/data defects from transient repository, session or environment problems and prevents unnecessary production changes.

Use the ST22 occurrence as a forensic snapshot. Before anyone reruns the transaction or job, record the dump time, client, user, transaction or job name, application server, ABAP program/include, source line and active call stack. If variable values are available, capture the business key and the values used by the terminating statement. This matters because the same runtime name can be caused by custom code, standard SAP code, generated code, stale repository loads, inconsistent DDIC objects, bad external input or infrastructure conditions.

Next classify the scope. Does the same input fail every time? Do all users fail, or only one user/technical user? Does the error occur on every application server or only one? Did it start directly after a transport, support package, upgrade, role change or interface deployment? Can QA reproduce it with the same object versions and data? These questions narrow the fault domain before anyone changes production.

Finally decide whether the terminating program is custom/modified or unmodified SAP standard. For custom code, the call stack and runtime values usually lead directly to the defect. For standard code, search SAP support content with the exact runtime error, exception class, program/include and release information rather than applying a generic fix from another component or release.

Do not let a successful retry erase the incident. A retry can succeed because the data changed, a lock cleared, a new load was generated, the request landed on a different application server, or the user/session context changed. If the dump affected a productive business process, record why the retry succeeded and whether the condition can recur. That distinction is especially important for nightly jobs, inbound interfaces and high-volume transactions where a transient-looking dump can silently create partial processing or repeat the next day.

Root causes that actually produce it

Use these as hypotheses, not as a checklist to change things blindly. Rank them against the terminating statement, call stack and timing in the actual ST22 record.

  • Code clears/frees/refreshes the looped table inside LOOP
  • A called method/function clears a global structure containing the active table
  • Callback/asynchronous logic modifies the same table during processing
  • Whole-table assignment or SORT invalidates the active loop context
  • Aliased field symbols/references hide that the same table is being changed

What to inspect in ST22

Start from the failing runtime record and preserve evidence before retrying or changing the system. Confirm the user or technical user, transaction/job/RFC context, program and include, exact source line, current application server, timestamp and call stack. Then inspect the object/data that the failing statement actually used. If the problem began after a deployment, compare the ST22 time with STMS/activation history. If it is data-dependent, reproduce with the same key/input rather than a convenient test case.

When the dump happens only in production, explicitly compare object versions, customizing, authorizations, destinations, DDIC/runtime objects and data volumes between QA and production before assuming the code itself is different.

A disciplined investigation sequence is: (1) read ST22 completely, including Error Analysis and How to Correct the Error; (2) identify the first customer enhancement, BAdI, exit or Z/Y object in the call stack; (3) verify whether the runtime object or data named in the dump actually exists and has the expected type/version; (4) correlate the timestamp with STMS, SM21, job logs, qRFC/tRFC queues or interface monitoring as relevant; (5) reproduce in a safe system with the same key and object versions; and only then (6) change code, configuration, authorization or data.

For intermittent failures, compare successful and failing executions instead of staring only at source code. Look for differences in user, server, work process type, variant, payload size, record count, locale, authorization, RFC destination, batch versus dialog mode, and timing relative to transports. Intermittent behavior is often the clue that points to session state, concurrency, generated loads or environment rather than a simple deterministic syntax defect.

  • Active LOOP table from ST22
  • Full call stack, not just the terminating CLEAR/FREE
  • Where-used for the table/global container
  • Callbacks or async RFC handlers
  • Aliased references/field symbols pointing to the same table

Resolution path

Do not structurally reset the active loop table. Work on a separate table/copy, defer the reset until after ENDLOOP, or redesign global/shared state so called routines cannot invalidate the caller's iteration.

After the correction, repeat the original failing scenario with the same business key, user/context and relevant data. Confirm not only that ST22 stays clean, but that the expected business result, database update, queue/job status or downstream document is correct. For a transported code/configuration fix, run a focused regression on the adjacent path that shares the changed object.

Treat the correction as incomplete until the original business operation succeeds end to end. Re-run with the same key/input and confirm the expected document, database update, queue state, job result or interface response. Then test one normal adjacent case and one boundary/error case so the change has not merely shifted the failure elsewhere. If a repository/DDIC object was regenerated or retransported, verify all dependent objects are active and that fresh sessions on the relevant application servers behave consistently.

For production incidents in unmodified SAP code, keep the exact ST22 dump and release/support-package information with the ticket. A release-specific SAP Note or KBA may be required even when a community workaround appears similar; do not retrofit a correction intended for a different kernel, component or support-package level.

The fix people try first (and why it fails)

Moving the CLEAR into another method does not help if it still clears the same table while the loop is active.

A disappearing dump is not proof of a correct fix. Avoid broad workarounds that suppress an exception, weaken authorization, bypass validation, delete evidence or change unrelated system parameters unless the ST22 evidence proves that action addresses the root cause.

Prevention

Prefer statically typed data where possible. For dynamic/generic code, validate runtime types, lengths, component names and assignment results explicitly. Add regression tests for empty data, structure extensions and changed DDIC types. Do not base business logic on byte-layout assumptions that can break after upgrades or appends.

Operationally, review ST22 trends rather than treating dumps as isolated tickets. Repeated occurrences of the same runtime error/program should become a defect/problem record with owner, root cause and permanent corrective action. Include dump checks in post-transport smoke tests for critical custom developments, interfaces and background jobs. For high-risk dynamic code, add ABAP Unit or integration tests for empty input, maximum values, malformed external data, changed structures and failure paths.

Keep the support handover reproducible: exact steps, business key, user/context, timestamp, dump ID, screenshots only where useful, and the relevant transport/change reference. This shortens future triage and prevents the same runtime error from being solved repeatedly with different temporary workarounds.

For critical custom developments, add the runtime-error family to peer-review checklists and regression evidence. The goal is not merely to prevent the identical dump string, but to remove the unsafe assumption that allowed the invalid runtime state to occur.

Keep one known-good production-like test case for this path so future transports can be validated against the same runtime assumptions before release.

Whose problem this is

ABAP development owns table lifecycle and callback/global-state design.

For escalation, include the ST22 dump ID/timestamp, program and include, terminating line, user or technical user, transaction/job/RFC destination, business key/input, application server and any transport/change that immediately preceded the issue. That evidence is usually enough to route the case without another discovery cycle.

Before handoff, separate the trigger from the owner. A standard transaction can still dump because of a custom BAdI or user exit; a custom report can still fail because of an SAP standard repository inconsistency, database issue or missing authorization. Route the case to the team that owns the failing layer identified in the call stack and evidence, not simply the module named by the end user.

A strong ticket should contain enough information for the receiving team to act without repeating first-level triage: exact runtime error, timestamp, client, user/technical user, transaction/job/RFC destination, ABAP program/include and line, business key/input, call-stack owner, recent transport/change reference, reproduction status, and what was already checked. If the case is intermittent, include at least one successful comparison with the meaningful difference highlighted.

Take the next diagnostic step

Use these ERPClimb resources to explore the scenario. Verify all actions in your SAP system before making production changes.

Lessons and topics

Source: ERPClimb — https://erpclimb.com/sap-abap-dumps/table-free-in-loopERPClimb is an independent platform and is not affiliated with SAP SE. Reference pages are written and reviewed by SAP consultants for learning and troubleshooting.