Skip to Content
Author's profile photo Former Member

Dumps in internal table due to modify/delete

I had several dumps while I tried to delete entries in an internal standard table:

– OBJECTS_NOT_NUMLIKE or

– TABLE_ILLEGAL_STATEMENT.

The table was declared normally like TYPE TABLE OF <dictionary-structure>.

I tried in a loop at a little (standard-)table to read the bigger standard table with a key:

READ TABLE itab INTO wa

WITH KEY …

to get the specific entry into the wa to delete or to modify it.

This is regulary creating a dump because the MODIFY or DELETE statement uses the complete line of the standard table as a key.

The solution for me is to define a sorted table, to move the data there (I couldn’t use the sorted table from the start) and to define and to use a primary key to access the internal table to modify/delete it:
I. Definition of sorted table with unique key:

types: BEGIN OF ty_selected_line.
            INCLUDE TYPE <ddic-structure>.
    TYPES END OF ty_selected_line .
  types:
    tt_selected_tab TYPE SORTED TABLE OF ty_selected_line
      WITH UNIQUE KEY primary_key
      COMPONENTS
      bukrs
      field2

      etc…
II. With the delete-command you can delete the obsolete entries in your internal table: 

    DELETE lt_selected_tab USING KEY primary_key
          WHERE
          bukrs = <fs>bukrs AND
          field2 = <fs>field2.

I know it’s basic knowledge, but I was wondering for a while where the heck the dumps had their real origin.

Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Sandra Rossi
      Sandra Rossi

      For the OBJECTS_NOT_NUMLIKE dump, a frequent error is to use DELETE itab FROM wa, which is an error because the only syntax SAP knows is DELETE itab FROM tabindex, where tabindex must be an integer to delete all lines from this row number. So it attemps converting wa into an integer which often leads to the dump.

      To delete a line based on field values wa, we must use DELETE TABLE itab FROM wa.