ERPClimb logoERPClimb

Code examples · Modern ABAP · Beginner

Your first short dump: cause, read and fix GETWA_NOT_ASSIGNED

The problem

A report that looked at a price list ends with a short dump after a new item was added.

How we solve it

  1. 1Make it failreproduce
  2. 2Read the dumpST22
  3. 3Fix itcheck first

The result

The broken program dumps with GETWA_NOT_ASSIGNED.

SAP objects in play

Overview drawn by ERPClimb from this example. The steps are the same as in the code below.

1. The requirement

A report that looked at a price list ends with a short dump after a new item was added. The developer on duty must find the line that failed, say why it failed and repair it without hiding the error.

2. How we design it

A short dump is not a mystery: it is a report that SAP writes when a program cannot continue. It names the runtime error, shows the source code line that failed and the values at that moment. Here the runtime error is GETWA_NOT_ASSIGNED: the program used a field symbol that points to nothing. The cause is an ASSIGN that did not find its row. We first reproduce the dump on purpose, then read it, then fix the code so that the missing row is a normal answer and not a crash.

Why we decided it this way

  1. 1Reproduce before fixingA fix you cannot test is a guess. Making the dump happen on purpose proves that you understood the cause.
  2. 2Read the three parts of the dumpThe runtime error name says what, the source extract says where, and the variable values say why.
  3. 3Check instead of catching everythingAn unassigned field symbol is a logic gap. The right repair is a check at the place where the row may be missing.

Before you start

  • ADT. On a classic system you can also open the dump in transaction ST22.
  • Do this in a sandbox or the free trial system: the first step is a program that crashes on purpose.

3. The code, step by step

Step 1 of 3: Reproduce the dump

A program that ends in the runtime error GETWA_NOT_ASSIGNED.

ABAP · Class · ZCL_DUMP_DEMO (broken version)
" A small price list
CLASS zcl_dump_demo DEFINITION PUBLIC FINAL CREATE PUBLIC.
  PUBLIC SECTION.
    INTERFACES if_oo_adt_classrun.
ENDCLASS.

CLASS zcl_dump_demo IMPLEMENTATION.
  METHOD if_oo_adt_classrun~main.
    TYPES: BEGIN OF ty_price,
             item  TYPE c LENGTH 1,
             price TYPE p LENGTH 8 DECIMALS 2,
           END OF ty_price,
           ty_prices TYPE STANDARD TABLE OF ty_price WITH EMPTY KEY.

    DATA(prices) = VALUE ty_prices(
      ( item = 'A' price = '10.00' )
      ( item = 'B' price = '20.00' ) ).
    " ASSIGN a row that does not exist and use it
    ASSIGN prices[ item = 'Z' ] TO FIELD-SYMBOL(<price>).
    out->write( |Item Z costs { <price>-price }| ).
  ENDMETHOD.
ENDCLASS.
Part by part (plain text)
  1. A small price list. A table with two items. The type of one row has an item letter and a price. The data is kept in the program so that nothing depends on your system.
  2. ASSIGN a row that does not exist and use it. ASSIGN with a table expression points the field symbol at the row with item Z. There is no such row, so ASSIGN does not raise an error: it sets SY-SUBRC to 4 and leaves the field symbol as it was. Here it was never assigned, so it is still unassigned, and the next line reads from it, which ends the program with a short dump.

Open in the portal

The SAP objects named in this code are linked in the code above and listed here. Each opens its page in the SAP Library.

4. The final outcome

The broken program dumps with GETWA_NOT_ASSIGNED. The repaired one reports that item Z is not in the list.

What you should see

Broken version: short dump GETWA_NOT_ASSIGNED, visible in ST22 Fixed version: Item A costs 10.00 Item Z is not in the price list

Try it and check the result

  • Activate and run the broken version with F9. The run ends with an error. In ADT open the runtime error from the feed, or in SAP GUI call transaction ST22 and open today's dump of your user.
  • In the dump find the arrow line and the value of SY-SUBRC. They tell you the row was not found.
  • Set a breakpoint on the ASSIGN line (double-click the left margin), run again with F9 in debug mode and press F6 over the ASSIGN: SY-SUBRC shows 4 in the variables view.
  • Run the fixed version: it prints one line for item A and one for item Z, with no dump.

Common mistakes

  • Do not wrap the failing line in a catch-all just to make the dump disappear. The cause, a row that may be missing, stays and shows up elsewhere.
  • After a loop iteration the field symbol still points to the last row. UNASSIGN it, or the next iteration may use an old row without noticing.
  • ASSIGN with a table expression does not raise an exception, but reading an itab row directly with the expression itab[ ... ] does: it raises CX_SY_ITAB_LINE_NOT_FOUND. Know which of the two you are using.

Keep learning

Checking status: Reviewed line by line against SAP documentation. Not executed on a live system. Reviewed 2026-11-25. Release: ABAP 7.54+ / S/4HANA on-premise 2020+ and ABAP Environment on BTP. Check on your release.

Original ERPClimb teaching code with illustrative names. Not taken from a customer system. Syntax can differ by release; check the references below and activate in a sandbox first. ERPClimb is independent of SAP SE.