Application Development 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: 

delete IDoc

Former Member
0 Kudos

is there any BAPI or FM to delete an IDoc from database.

5 REPLIES 5

Former Member
0 Kudos

Hi,

You can use tx. we11 to delete an idoc. But these idocs are not deleted at once, rather a deletion flag is set. The deletion happens alongwith a background job.

Reward points if helpful.

Regards

0 Kudos

firstly.no WE11 exists.

another thing. what is the background program that u wrote about ?

thanks.

laxmanakumar_appana
Active Contributor
0 Kudos

Hi,

use FM EDI_DOCUMENT_DELETE .

pass the IDoc Number to it and delete the one which you want

Regards

Appana

*Reward points for helpful answers

Former Member
0 Kudos

Hi,

<u><b>Tx. WE11

Prg. -- RSETESTD</b></u>

In the abovesaid program the following fm is used for deletion of idoc. But before the deletion of idoc`s there are several other procedures to be followed. For further reference, explore the abovesaid program.

CALL FUNCTION 'EDI_DOCUMENT_DELETE'
        EXPORTING
          document_number        = gd_edidc-docnum
        EXCEPTIONS
          idoc_does_not_exist    = 1
          document_foreign_lock  = 2
          idoc_cannot_be_deleted = 3
          not_all_tables_deleted = 4
          OTHERS                 = 5.
      IF NOT syst-subrc IS INITIAL.
        MESSAGE ID syst-msgid TYPE syst-msgty NUMBER syst-msgno
            WITH syst-msgv1 syst-msgv2 syst-msgv3 syst-msgv4.
      ENDIF.

This is the code found in the abovesaid program.

Still if you`re not satisfied with my answer, revert back to me with my server details.

Else reward points.

Regards

Former Member
0 Kudos

Hi Surendra,

use the tcode <b>WE11</b> or program <b>RSETESTD</b> to delete an IDOC.

Regards

eswar