‎2006 Nov 14 3:59 PM
Hi,
I want to use DD_DATABASE_UTILITY to delete the contents of a table but it seems to cause difficulties:
call function 'DD_DATABASE_UTILITY'
EXPORTING
fct = 'MDF'
obj_name = 'ZDELLIST'
obj_type = 'TABL'
exec_modus = 'S'
IMPORTING
subrc = sl_subrc
EXCEPTIONS
unexpected_error = 1
unsupported_function = 2
unsupported_obj_type = 3
table_is_locked_by_tcnv = 4
authority_check_failed = 5
abort_function = 6
conversion_error = 7
others = 8
......
*Insert new values:
modify zdellist.
The <i>modify</i> causes a short dump:
<i>The data type "ZDELLIST" was reloaded from the database while the program was running. However, the system found a version of the type that was newer than the one required.</i>
Any thoughts? Am I allowed add entries to the table after deleting the entries?
Thanks.
‎2006 Nov 14 4:06 PM
‎2006 Nov 14 4:05 PM
‎2006 Nov 14 4:06 PM
‎2006 Nov 14 4:07 PM
A shot in the dark, but did you commit your deletion?
you could also use SQL:
delete from ZDELLIST where ...
Warren
‎2006 Nov 14 4:10 PM
Hi,
can you try this one ....
call function 'DD_DATABASE_UTILITY'
exporting
fct = 'MDF'
obj_name = 'TABLE_NAME'
obj_type = 'TABL'
exec_modus = 'S'
importing
subrc = sl_subrc
exceptions
unexpected_error = 1
unsupported_function = 2
unsupported_obj_type = 3
table_is_locked_by_tcnv = 4
authority_check_failed = 5
abort_function = 6
conversion_error = 7
others = 8.
if sl_subrc = 0 and sy-subrc = 0.
write:/ '&1', '- Table Deleted OK'.
commit work and wait.
else.
sl_status = 1. "Deletion Failed
write:/ '&1', '- Table Deletion FAILED'.
endif.
Regards
Sudheer
‎2006 Nov 14 4:12 PM
what i mean by the commit is :
call function 'DD_DATABASE_UTILITY'
EXPORTING
fct = 'MDF'
obj_name = 'ZDELLIST'
obj_type = 'TABL'
exec_modus = 'S'
IMPORTING
subrc = sl_subrc
EXCEPTIONS
unexpected_error = 1
unsupported_function = 2
unsupported_obj_type = 3
table_is_locked_by_tcnv = 4
authority_check_failed = 5
abort_function = 6
conversion_error = 7
others = 8
......
COMMIT WORK.
*Insert new values:
modify zdellist.
COMMIT WORK.
‎2006 Nov 14 4:19 PM
Thanks All,
I know about
DELETE FROM Zdellist CLIENT SPECIFIED WHERE mandt EQ sy-mandt.but was under the impression that it was slow. I tried it out and the performance was fine so I will use that method. I only have about 13000 entries at the moment and that's only going to decrease so should be fine going forward.
FYI:
I did <i>commit work</i> as well but still dumped.
Does anyone know when it is a good idea to use the 'DD_DATABASE_UTILITY' FM?
Thanks.
‎2006 Nov 14 4:46 PM
Hi Aidan,
Please use standard program RADCVBTC instead of delete statement for deleting
all contents of a custom table due to volume and performance issue.
It worked for me when I tried to delete over 25 million records in a custom table.
It took less than 5 seconds. So please give it try.
You can pass the following parameters.
OBJ_NAME = 'ZDELLIST'
OBJ_TYPE = 'TABL'
FCT = 'MDF'
Hope this will work for you.
Regards,
Ferry Lianto