Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Why do I still report an error after using a dynamic DELETE statement?

mimanchi
Explorer
0 Kudos
239
Hello everyone:
I defined an inner table using any table in the function change parameter, and after checking, I cleared the non-eligible table rows.
Finally, I'm going to use DELETE ct_tab WHERE ('table_line IS INITIAL') to delete the unwanted data, but it still reports an error, prompting:
The row type of the table must be identifiable statically in "... WHERE...".
How can I adjust?
Thanks.
PS: Use DELETE ct_tab WHERE table_line IS INITIAL The same error.
3 REPLIES 3

radinator
Participant
0 Kudos
180

Hi, I think your mistake is enclosing the actual condition you use in the WHERE clause in single quotes. Try removing them and check the results.

Hope this helps!

0 Kudos
177

thanks

I see why, single quotes must be close to parentheses, no spaces.

thomas_mller13
Participant
0 Kudos
142

 

REPORT zzz_test.

DATA: ct_tab TYPE TABLE OF tadir,
      ldref  TYPE REF TO data.

FIELD-SYMBOLS: <lt_tab> TYPE STANDARD TABLE.


SELECT * FROM tadir INTO TABLE ct_tab UP TO 10 ROWS.

APPEND INITIAL LINE TO ct_tab.
APPEND INITIAL LINE TO ct_tab.
APPEND INITIAL LINE TO ct_tab.


CREATE DATA ldref LIKE ct_tab.

ASSIGN ldref->* TO <lt_tab>.

LOOP AT ct_tab ASSIGNING FIELD-SYMBOL(<fs_any>).
  IF <fs_any> IS NOT INITIAL.
    APPEND <fs_any> TO <lt_tab>.
  ENDIF.
ENDLOOP.


BREAK-POINT.

The result is in <lt_tab>.