'DD_DATABASE_UTILITY'

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.

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

Similar Messages

  • Use of DD_DATABASE_UTILITY in loop

    Hi,
    I have a scenario where a certain buffer z table needs to be cleared (all entries should be deleted). A RFC FM  calls (call from CRM) several FMs one after another on BI. At the end of every called FM on BI this z table is being cleared by 'DD_DATABASE_UTILITY'. However on the first FM run on BI the buffer is locked & 2nd FM run gives a dump :  "A newer version of data type "ZDE_MSA_BUFFER" was found than one required ". Now i use delete from z-table and it seems to work.
    Is there a better way to handle this ? I have tried using lock objects-unlock & etc...but in vain.
    Please let me know.
    Best Regards
    Neeraj

    Deleting data from your own Z-table (beware for foreign keys if available, direct relations with other transparant tables) using the DELETE statement is fine.

  • Is there a way to speed up data deletion ?

    i am purging data from  MEREP_10700 and MEREP_108 using MEREP_RDB_T01_RESET tool in the middleware
    Note that this is running **very** slowly at the moment (~100,000 records per hour, will take days to complete).  Is there a way to speed it up?
    Thanks & Regards
    Prashant Gupta

    There is no other easy way to achieve this (unless you write your own program to do so). But if you are looking for cleaning the entire table, you can use the  FM "DD_DATABASE_UTILITY" to delete the entire table..
    Regards
    Ajith

  • How to delete data in SAP Tables

    Can i delete data in SAP tables in IDES version? I need step wise answer.
    Best answer get good points.
    Regards
    Kalyan Pothini

    Hope this helps:
    http://searchsap.techtarget.com/tip/1,289483,sid21_gci1159707,00.html
    Fast deletion of SAP table content
    Stan Shuralyov
    01.17.2006
    Rating: -3.86- (out of 5)
    If a table has millions of records, full deletion becomes time consuming. Try this tip when you need to delete data quickly -- it works in seconds.
    Editor's note: This tip works on an SAP 4.6C, WAS620 and WAS640 system (i.e., all currently suppported SAP platforms). Note that it is a tricky function that should only be used by programmers who know what they are doing.
    Code
    Use function from SE14
            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.

Maybe you are looking for

  • Problem with storing pictures to the Media Card

    I set my 8330 to store pictures to the media card.  It works for a while and then the device reverts to storing it on the device memory.  It does this without asking or telling me that it's done so.  It's very frustrating.  Anybody have any idea why

  • Profit Center Balances

    Hi How to reverse profit center balances. Regds, Sannari Moderator: Please, read the rules of this forum

  • Creating TCODE for ABAP Query

    Hello everyone! I have created my very first ABAP Query, but I still need to create/assign TCODE for the said report.  Can anyone help me with it? Somebody told me to use SE93.  I found out that there are 5 options in SE93 to create a TCode, I tried

  • Sad to say I've tried everything to f gure out Blackberry ID sign up Verification code!!

    Hello, I've tried several times today to register for a new Blackberry ID.  I was able to sign up for the Community Feedback forum but evidently this log on and profile have nothing to do with Blackberry ID.  I need the ID and profile so I can downlo

  • I am experiencing faux successful updates to 4.0.1.

    Running Firefox 4.0, Yahoo 1.8, on Windows Vista Home, on HP Pavilion Elite m9260f 64bit. I receive an "Update Available" to 4.0.1 message. I agree to the update. Files are downloaded and installed. Firefox is rebooted and everything seems fine. Next